:root {
  color-scheme: dark;
  --bg: #05070a;
  --ink: #edf7ff;
  --muted: #8393a7;
  --muted-2: #526174;
  --panel: rgba(9, 14, 20, 0.88);
  --panel-2: rgba(13, 21, 31, 0.92);
  --line: rgba(131, 147, 167, 0.22);
  --line-strong: rgba(86, 220, 255, 0.38);
  --cyan: #56dcff;
  --green: #25d091;
  --amber: #f3b84a;
  --champagne: #f7df9b;
  --red: #ff5f70;
  --violet: #a786ff;
  --radius: 8px;
  --shadow: 0 26px 90px rgba(0, 0, 0, 0.52);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #030609;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(3, 6, 9, 0.76), rgba(3, 6, 9, 0.2) 42%, rgba(3, 6, 9, 0.76)),
    linear-gradient(180deg, rgba(3, 6, 9, 0.06), rgba(3, 6, 9, 0.68) 48%, #030609 86%),
    url("/assets/matrixflow-hero-bg.png") center top / min(1320px, 170vw) auto no-repeat;
  filter: saturate(1.14) contrast(1.05);
}

body::after {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(86, 220, 255, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(86, 220, 255, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 50% 118px, rgba(247, 223, 155, 0.26), transparent 320px),
    radial-gradient(circle at 18% 320px, rgba(86, 220, 255, 0.18), transparent 260px),
    radial-gradient(circle at 82% 390px, rgba(167, 134, 255, 0.16), transparent 250px);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
  mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%);
  opacity: 0.72;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  width: min(100%, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 14px 104px;
  position: relative;
  isolation: isolate;
}

.boot {
  min-height: 78vh;
  display: grid;
  place-items: center;
  gap: 16px;
  text-align: center;
}

.brand-logo {
  width: 54px;
  height: 54px;
  display: block;
  border-radius: 16px;
  padding: 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 42%),
    rgba(2, 7, 11, 0.78);
  border: 1px solid rgba(247, 223, 155, 0.36);
  box-shadow:
    0 0 34px rgba(86, 220, 255, 0.28),
    0 0 64px rgba(243, 184, 74, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.boot-logo {
  width: 94px;
  height: 94px;
  border-radius: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid rgba(247, 223, 155, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018)),
    rgba(3, 7, 11, 0.62);
  backdrop-filter: blur(22px) saturate(1.15);
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.28);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.title {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--champagne);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 17px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 6px;
  font-size: 14px;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ticker {
  display: flex;
  gap: 6px;
  overflow: hidden;
  max-width: 58vw;
  padding: 6px;
  border: 1px solid rgba(86, 220, 255, 0.24);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.language-select {
  width: 138px;
  min-width: 118px;
  height: 38px;
  color: var(--ink);
  border-radius: var(--radius);
  border: 1px solid rgba(247, 223, 155, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.012)),
    rgba(0, 0, 0, 0.3);
  padding: 0 9px;
  outline: 0;
}

.language-select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(86, 220, 255, 0.12);
}

.ticker span {
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.ticker strong {
  color: var(--champagne);
}

html[dir="rtl"] .brand,
html[dir="rtl"] .topbar,
html[dir="rtl"] .section-head,
html[dir="rtl"] .timeline-item,
html[dir="rtl"] .progress-row {
  direction: rtl;
}

html[dir="rtl"] .mono,
html[dir="rtl"] input,
html[dir="rtl"] .ticker {
  direction: ltr;
  text-align: left;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.panel,
.tile,
.table-row,
.timeline-item,
.level-card {
  border: 1px solid rgba(247, 223, 155, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 243, 206, 0.07), rgba(255, 255, 255, 0.014)),
    linear-gradient(135deg, rgba(86, 220, 255, 0.04), rgba(243, 184, 74, 0.035)),
    rgba(6, 11, 16, 0.78);
  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.065);
  backdrop-filter: blur(18px) saturate(1.16);
}

.panel {
  padding: 13px;
  min-width: 0;
  max-width: 100%;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 310px;
  background:
    linear-gradient(90deg, rgba(3, 7, 11, 0.92), rgba(3, 7, 11, 0.64) 55%, rgba(3, 7, 11, 0.84)),
    radial-gradient(circle at 76% 18%, rgba(247, 223, 155, 0.3), transparent 36%),
    radial-gradient(circle at 50% 70%, rgba(86, 220, 255, 0.2), transparent 42%),
    rgba(5, 10, 15, 0.78);
  border-color: rgba(247, 223, 155, 0.28);
  box-shadow:
    0 30px 110px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(86, 220, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background:
    linear-gradient(90deg, rgba(247, 223, 155, 0.16) 1px, transparent 1px),
    linear-gradient(180deg, rgba(86, 220, 255, 0.12) 1px, transparent 1px),
    url("/assets/matrixflow-hero-bg.png") center 34% / cover no-repeat;
  background-size: 32px 32px, 32px 32px, cover;
  mask-image: linear-gradient(90deg, #000, transparent 90%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
}

.hero-brand {
  position: absolute;
  right: 20px;
  bottom: 18px;
  width: 176px;
  height: 176px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.hero-logo {
  width: 118px;
  height: 118px;
  z-index: 2;
  padding: 8px;
  border-radius: 30px;
  background: rgba(2, 7, 11, 0.72);
  border: 1px solid rgba(247, 223, 155, 0.34);
  box-shadow:
    0 0 44px rgba(86, 220, 255, 0.28),
    0 0 90px rgba(243, 184, 74, 0.18);
}

.hero-pulse,
.hero-pulse span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.hero-pulse {
  border: 1px solid rgba(86, 220, 255, 0.22);
  box-shadow: inset 0 0 40px rgba(86, 220, 255, 0.12);
}

.hero-pulse span {
  border: 1px solid rgba(247, 223, 155, 0.16);
}

.hero-pulse span:nth-child(1) {
  inset: 18px;
}

.hero-pulse span:nth-child(2) {
  inset: 36px;
  border-color: rgba(37, 208, 145, 0.18);
}

.hero-pulse span:nth-child(3) {
  inset: 54px;
  border-color: rgba(86, 220, 255, 0.18);
}

.leader-arena {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 248px;
  border-color: rgba(86, 220, 255, 0.3);
  background:
    linear-gradient(110deg, rgba(2, 7, 11, 0.96), rgba(5, 15, 22, 0.68) 52%, rgba(3, 7, 11, 0.92)),
    radial-gradient(circle at 28% 50%, rgba(86, 220, 255, 0.22), transparent 36%),
    radial-gradient(circle at 74% 30%, rgba(243, 184, 74, 0.18), transparent 34%),
    rgba(3, 8, 12, 0.82);
}

.leader-arena::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(86, 220, 255, 0.09) 1px, transparent 1px),
    linear-gradient(180deg, rgba(247, 223, 155, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 28% 50%, #000 0%, transparent 70%);
  opacity: 0.5;
}

.leader-stage {
  position: relative;
  z-index: 1;
  min-height: 220px;
  display: grid;
  place-items: center;
}

.power-core {
  position: relative;
  z-index: 4;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 44%),
    rgba(3, 8, 12, 0.86);
  border: 1px solid rgba(247, 223, 155, 0.4);
  box-shadow:
    0 0 38px rgba(86, 220, 255, 0.38),
    0 0 70px rgba(243, 184, 74, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  animation: corePulse 2.8s ease-in-out infinite;
}

.power-core img {
  width: 58px;
  height: 58px;
}

.energy-ring,
.downline-node,
.energy-beam {
  position: absolute;
  pointer-events: none;
}

.energy-ring {
  border-radius: 50%;
  border: 1px solid rgba(86, 220, 255, 0.24);
  box-shadow: inset 0 0 28px rgba(86, 220, 255, 0.08);
  animation: orbitPulse 4.8s linear infinite;
}

.ring-one {
  width: 118px;
  height: 118px;
}

.ring-two {
  width: 168px;
  height: 168px;
  border-color: rgba(247, 223, 155, 0.22);
  animation-duration: 6.4s;
  animation-direction: reverse;
}

.ring-three {
  width: 214px;
  height: 214px;
  border-color: rgba(37, 208, 145, 0.2);
  animation-duration: 8s;
}

.downline-node {
  z-index: 3;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translate(var(--x, 0), var(--y, 0));
  background: var(--cyan);
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    0 0 18px rgba(86, 220, 255, 0.78),
    0 0 34px rgba(37, 208, 145, 0.28);
  animation: nodeBlink 2.6s ease-in-out infinite;
}

.n1 {
  --x: -94px;
  --y: -62px;
}

.n2 {
  --x: 98px;
  --y: -46px;
  animation-delay: 0.35s;
}

.n3 {
  --x: -112px;
  --y: 54px;
  background: var(--green);
  animation-delay: 0.7s;
}

.n4 {
  --x: 88px;
  --y: 72px;
  background: var(--amber);
  animation-delay: 1s;
}

.n5 {
  --x: 0;
  --y: -104px;
  animation-delay: 1.25s;
}

.energy-beam {
  z-index: 2;
  width: 172px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(86, 220, 255, 0.78), transparent);
  transform-origin: center;
  animation: beamFlow 2.2s ease-in-out infinite;
}

.b1 {
  transform: rotate(24deg);
}

.b2 {
  transform: rotate(-34deg);
  animation-delay: 0.5s;
}

.b3 {
  transform: rotate(90deg);
  animation-delay: 0.9s;
}

.leader-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.leader-copy h2 {
  margin: 12px 0 8px;
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.02;
}

.leader-copy p {
  max-width: 620px;
  margin-bottom: 14px;
  color: #e6f6ff;
  font-size: 16px;
  line-height: 1.48;
}

.leader-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.leader-stats span,
.leader-stats strong {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border-radius: var(--radius);
  border: 1px solid rgba(86, 220, 255, 0.22);
  background: rgba(0, 0, 0, 0.2);
  font-size: 12px;
  font-weight: 820;
}

.leader-stats strong {
  color: #041016;
  border-color: rgba(255, 255, 255, 0.28);
  background: linear-gradient(135deg, var(--champagne), var(--cyan), var(--green));
}

@keyframes corePulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}

@keyframes orbitPulse {
  0% {
    transform: rotate(0deg) scale(1);
    opacity: 0.78;
  }
  50% {
    transform: rotate(180deg) scale(1.035);
    opacity: 1;
  }
  100% {
    transform: rotate(360deg) scale(1);
    opacity: 0.78;
  }
}

@keyframes nodeBlink {
  0%,
  100% {
    opacity: 0.58;
    transform: translate(var(--x, 0), var(--y, 0)) scale(0.9);
  }
  50% {
    opacity: 1;
    transform: translate(var(--x, 0), var(--y, 0)) scale(1.18);
  }
}

@keyframes beamFlow {
  0%,
  100% {
    opacity: 0.22;
  }
  50% {
    opacity: 0.92;
  }
}

.kpi-value {
  margin: 0;
  font-size: clamp(34px, 8vw, 62px);
  line-height: 0.95;
  font-weight: 900;
  text-shadow:
    0 0 28px rgba(86, 220, 255, 0.22),
    0 0 52px rgba(243, 184, 74, 0.13);
}

.kpi-value small {
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.metric-grid,
.level-grid {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.level-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tile {
  min-height: 92px;
  padding: 11px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    rgba(3, 8, 12, 0.66);
}

.tile span,
.level-text span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.tile strong {
  display: block;
  margin-top: 7px;
  font-size: 23px;
  color: #fff7dc;
  overflow-wrap: anywhere;
}

.tile.cyan {
  border-color: rgba(86, 220, 255, 0.34);
}

.tile.green {
  border-color: rgba(37, 208, 145, 0.34);
}

.tile.amber {
  border-color: rgba(243, 184, 74, 0.34);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: var(--radius);
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  font-size: 12px;
  white-space: nowrap;
}

.chip.green {
  color: #d9ffef;
  border-color: rgba(37, 208, 145, 0.36);
  background: rgba(37, 208, 145, 0.12);
}

.chip.amber {
  color: #ffe8bb;
  border-color: rgba(243, 184, 74, 0.36);
  background: rgba(243, 184, 74, 0.12);
}

.chip.cyan {
  color: #ddf8ff;
  border-color: rgba(86, 220, 255, 0.36);
  background:
    linear-gradient(90deg, rgba(86, 220, 255, 0.18), rgba(243, 184, 74, 0.06)),
    rgba(86, 220, 255, 0.09);
}

.section-head,
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.matrix-chart {
  width: 100%;
  min-height: 330px;
  display: block;
}

.node circle {
  stroke-width: 2;
}

.node text {
  fill: var(--ink);
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  dominant-baseline: middle;
  text-anchor: middle;
}

.edge {
  stroke: rgba(131, 147, 167, 0.36);
  stroke-width: 1.2;
}

.progress-list {
  display: grid;
  gap: 9px;
}

.progress-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) minmax(76px, max-content);
  align-items: center;
  gap: 8px;
}

.progress-row strong {
  white-space: nowrap;
}

.level-progress-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--champagne);
}

.level-progress-label svg {
  width: 15px;
  height: 15px;
  color: var(--cyan);
  filter: drop-shadow(0 0 8px rgba(86, 220, 255, 0.35));
}

.progress-row small {
  min-width: 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.bar {
  height: 9px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(131, 147, 167, 0.2);
  background: rgba(0, 0, 0, 0.3);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--champagne), var(--cyan), var(--green));
  box-shadow: 0 0 18px rgba(86, 220, 255, 0.3);
}

.terminal-table {
  display: grid;
  gap: 7px;
}

.table-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px;
}

.table-row small {
  color: var(--muted);
}

.amount {
  color: var(--green);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.level-card {
  position: relative;
  overflow: hidden;
  min-height: 116px;
  padding: 10px;
  isolation: isolate;
}

.level-card::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  z-index: -1;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(86, 220, 255, 0.28), transparent 68%);
  filter: blur(2px);
}

.level-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.level-icon-badge {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #061117;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.08) 42%),
    linear-gradient(135deg, var(--champagne), var(--cyan), var(--green));
  box-shadow:
    0 0 26px rgba(86, 220, 255, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.level-icon-badge svg {
  width: 21px;
  height: 21px;
  stroke-width: 2.4;
}

.level-text {
  min-width: 0;
}

.level-text em {
  display: block;
  margin-top: 2px;
  color: var(--champagne);
  font-style: normal;
  font-size: 14px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.level-card strong {
  display: block;
  margin-top: 13px;
  font-size: 18px;
  color: #fff7dc;
  overflow-wrap: anywhere;
}

.level-card.active {
  border-color: rgba(37, 208, 145, 0.42);
  background:
    linear-gradient(135deg, rgba(37, 208, 145, 0.12), rgba(86, 220, 255, 0.04)),
    var(--panel-2);
}

.level-card.tier-2::before {
  background: radial-gradient(circle, rgba(37, 208, 145, 0.28), transparent 68%);
}

.level-card.tier-3::before {
  background: radial-gradient(circle, rgba(243, 184, 74, 0.3), transparent 68%);
}

.level-card.tier-4::before {
  background: radial-gradient(circle, rgba(167, 134, 255, 0.26), transparent 68%);
}

.level-card.tier-5::before {
  background: radial-gradient(circle, rgba(255, 95, 112, 0.22), transparent 68%);
}

.level-card.tier-6::before {
  background: radial-gradient(circle, rgba(247, 223, 155, 0.36), transparent 68%);
}

.level-card.tier-3 .level-icon-badge {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.08) 42%),
    linear-gradient(135deg, #ffe09b, var(--amber), var(--cyan));
}

.level-card.tier-4 .level-icon-badge {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.08) 42%),
    linear-gradient(135deg, var(--champagne), var(--violet), var(--cyan));
}

.level-card.tier-5 .level-icon-badge {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.08) 42%),
    linear-gradient(135deg, #ffe8bb, var(--red), var(--violet));
}

.level-card.tier-6 .level-icon-badge {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.08) 42%),
    linear-gradient(135deg, #fff7dc, var(--champagne), var(--amber));
  box-shadow:
    0 0 34px rgba(247, 223, 155, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.form-grid {
  display: grid;
  gap: 8px;
}

.input,
.select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  color: var(--ink);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  padding: 0 10px;
  outline: 0;
}

.input:focus,
.select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(86, 220, 255, 0.12);
}

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.66;
  filter: saturate(0.72);
}

.btn.primary {
  color: #041016;
  border-color: rgba(255, 255, 255, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 36%),
    linear-gradient(135deg, var(--champagne), var(--cyan) 46%, var(--green));
  box-shadow: 0 16px 38px rgba(86, 220, 255, 0.18);
}

.btn.amber {
  color: #171006;
  border-color: rgba(255, 255, 255, 0.28);
  background: linear-gradient(135deg, #ffe09b, var(--amber));
}

.btn.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.switch {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid rgba(37, 208, 145, 0.28);
  background: rgba(37, 208, 145, 0.08);
  color: var(--ink);
  font-weight: 760;
}

.switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.icon-cell {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: var(--cyan);
  background: rgba(86, 220, 255, 0.1);
  border: 1px solid rgba(86, 220, 255, 0.22);
}

.explain-list {
  display: grid;
  gap: 8px;
  counter-reset: steps;
}

.explain-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
}

.explain-item::before {
  counter-increment: steps;
  content: counter(steps);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #041016;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  font-weight: 900;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(calc(100% - 20px), 760px);
  display: grid;
  grid-template-columns: repeat(var(--nav-count, 8), minmax(0, 1fr));
  gap: 5px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(247, 223, 155, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 243, 206, 0.08), rgba(255, 255, 255, 0.015)),
    rgba(5, 7, 10, 0.88);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.nav-item {
  min-height: 50px;
  min-width: 0;
  display: grid;
  place-items: center;
  gap: 2px;
  color: var(--muted);
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 760;
}

.nav-item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-block {
  display: grid;
  gap: 7px;
}

.field-block > span,
.payment-box span,
.root-strip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

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

.payment-box > div,
.root-strip,
.referral-card {
  border: 1px solid rgba(86, 220, 255, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(86, 220, 255, 0.08), rgba(255, 255, 255, 0.012)),
    rgba(0, 0, 0, 0.22);
  padding: 10px;
}

.payment-box strong {
  display: block;
  margin-top: 4px;
  color: var(--champagne);
  font-size: 18px;
}

.automation-box strong {
  font-size: 14px;
}

.treasury-panel {
  border-color: rgba(37, 208, 145, 0.28);
}

.treasury-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1.1fr) 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.treasury-flow > div {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid rgba(86, 220, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(86, 220, 255, 0.08), rgba(255, 255, 255, 0.012)),
    rgba(0, 0, 0, 0.22);
}

.treasury-flow span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.treasury-flow strong {
  min-width: 0;
  color: var(--champagne);
  overflow-wrap: anywhere;
}

.treasury-flow svg {
  width: 22px;
  height: 22px;
  color: var(--cyan);
  justify-self: center;
}

.state-on {
  color: var(--green) !important;
}

.state-wait {
  color: var(--amber) !important;
}

.root-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.root-strip strong {
  min-width: 0;
  color: var(--champagne);
  overflow-wrap: anywhere;
}

.referral-card {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  border-color: rgba(243, 184, 74, 0.34);
}

.referral-card span {
  color: var(--cyan);
  font-weight: 900;
}

.referral-card strong {
  color: var(--champagne);
  overflow-wrap: anywhere;
}

.locked-panel {
  display: grid;
  gap: 12px;
  border-color: rgba(243, 184, 74, 0.32);
  background:
    linear-gradient(135deg, rgba(243, 184, 74, 0.13), rgba(86, 220, 255, 0.055)),
    linear-gradient(180deg, rgba(255, 243, 206, 0.07), rgba(255, 255, 255, 0.014)),
    rgba(6, 11, 16, 0.84);
}

.locked-panel h2 {
  margin-bottom: 0;
}

.locked-panel .btn {
  justify-self: start;
}

.referral-team-panel {
  display: grid;
  gap: 12px;
}

.referral-list {
  display: grid;
  gap: 8px;
}

.referral-person {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid rgba(86, 220, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
}

.referral-person strong,
.referral-person small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-panel {
  display: grid;
  gap: 12px;
}

.room-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(86, 220, 255, 0.42) transparent;
}

.room-tab {
  flex: 0 0 auto;
  min-width: 104px;
  min-height: 48px;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  color: var(--muted);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
}

.room-tab span {
  min-width: 0;
  height: 30px;
  display: grid;
  place-items: center;
  color: #041016;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--champagne), var(--cyan));
  font-size: 11px;
  font-weight: 900;
}

.room-tab strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-tab.active {
  border-color: rgba(247, 223, 155, 0.42);
  background:
    linear-gradient(135deg, rgba(86, 220, 255, 0.14), rgba(243, 184, 74, 0.1)),
    rgba(0, 0, 0, 0.26);
  box-shadow: 0 0 24px rgba(86, 220, 255, 0.14);
}

.chat-board {
  min-height: 320px;
  max-height: 520px;
  overflow-y: auto;
  display: grid;
  align-content: end;
  gap: 9px;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid rgba(86, 220, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(86, 220, 255, 0.055), rgba(255, 255, 255, 0.01)),
    rgba(0, 0, 0, 0.2);
}

.chat-message {
  width: min(92%, 560px);
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid rgba(131, 147, 167, 0.22);
  background: rgba(8, 15, 22, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.chat-message.mine {
  justify-self: end;
  border-color: rgba(37, 208, 145, 0.38);
  background:
    linear-gradient(135deg, rgba(37, 208, 145, 0.12), rgba(86, 220, 255, 0.05)),
    rgba(8, 15, 22, 0.82);
}

.chat-author {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  margin-bottom: 5px;
}

.chat-author strong {
  color: var(--champagne);
  font-size: 13px;
}

.chat-author span,
.chat-author time {
  color: var(--muted);
  font-size: 11px;
}

.chat-message p {
  margin: 0;
  color: #f1f9ff;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.chat-empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.chat-input {
  min-height: 58px;
  padding-top: 10px;
  resize: vertical;
}

.chat-send {
  min-width: 118px;
}

.support-hero {
  border-color: rgba(86, 220, 255, 0.26);
}

.support-textarea {
  min-height: 92px;
  padding-top: 10px;
  resize: vertical;
}

.support-list {
  display: grid;
  gap: 9px;
}

.support-ticket {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid rgba(86, 220, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(86, 220, 255, 0.06), rgba(255, 255, 255, 0.012)),
    rgba(0, 0, 0, 0.18);
}

.support-ticket.status-answered {
  border-color: rgba(37, 208, 145, 0.32);
}

.support-ticket.status-closed {
  border-color: rgba(131, 147, 167, 0.26);
  opacity: 0.72;
}

.support-ticket-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
}

.support-ticket-head span,
.support-reply span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.support-ticket-head strong {
  display: block;
  margin-top: 2px;
  color: var(--champagne);
  overflow-wrap: anywhere;
}

.support-ticket-head small {
  flex: 0 0 auto;
  color: var(--cyan);
  font-weight: 860;
}

.support-ticket p {
  margin: 0;
  color: #f1f9ff;
  overflow-wrap: anywhere;
}

.support-reply {
  padding: 9px;
  border-radius: var(--radius);
  border: 1px solid rgba(37, 208, 145, 0.24);
  background: rgba(37, 208, 145, 0.08);
}

.support-admin-actions {
  display: grid;
  gap: 8px;
}

.gate-panel {
  width: min(92vw, 560px);
  text-align: left;
}

.join-gate {
  min-height: 86vh;
}

.table-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.admin-payment.approved {
  opacity: 0.62;
}

.nav-item.active {
  color: var(--champagne);
  background:
    radial-gradient(circle at 50% 0, rgba(247, 223, 155, 0.22), transparent 62%),
    rgba(86, 220, 255, 0.08);
}

.nav-item svg,
.btn svg,
.icon-cell svg,
.chip svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 82px;
  z-index: 20;
  width: min(92vw, 480px);
  transform: translateX(-50%);
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: rgba(5, 9, 14, 0.96);
  box-shadow: var(--shadow);
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .leader-arena {
    grid-template-columns: 1fr;
  }

  .leader-stage {
    min-height: 190px;
  }

  .ticker {
    max-width: 44vw;
  }
}

@media (max-width: 520px) {
  .root-strip,
  .copy-row,
  .payment-box,
  .treasury-flow,
  .chat-input-row,
  .referral-person {
    grid-template-columns: 1fr;
  }

  .referral-person .chip {
    justify-self: start;
  }

  .treasury-flow svg {
    transform: rotate(90deg);
  }

  .topbar {
    align-items: flex-start;
  }

  .top-actions {
    align-items: flex-end;
  }

  .ticker {
    display: none;
  }

  .language-select {
    width: 124px;
  }

  .metric-grid,
  .level-grid {
    grid-template-columns: 1fr;
  }

  .progress-row {
    grid-template-columns: 54px minmax(0, 1fr) minmax(78px, max-content);
    gap: 7px;
  }

  .progress-row small {
    font-size: 10px;
  }

  .matrix-chart {
    min-height: 280px;
  }

  .hero-panel {
    min-height: 360px;
  }

  .hero-brand {
    display: none;
  }

  .leader-arena {
    min-height: 420px;
  }

  .leader-copy h2 {
    font-size: 28px;
  }

  .leader-copy p {
    font-size: 14px;
  }

  .room-tab {
    min-width: 92px;
  }

  .chat-board {
    min-height: 300px;
    padding: 8px;
  }

  .chat-message {
    width: 100%;
  }

  .chat-send {
    width: 100%;
  }

  .nav-item {
    font-size: 9px;
  }
}
