:root {
  --bg: #020712;
  --panel: #071321;
  --panel2: #091a2a;
  --line: #15344b;
  --cyan: #18e6ff;
  --blue: #1877ff;
  --gold: #ffbd18;
  --green: #4be6a6;
  --muted: #7891a4;
  --text: #eef8ff
}
* {
  box-sizing: border-box
}
html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 78% 0%, #06365a55, transparent 30%),
    radial-gradient(circle at 10% 25%, #003e6b33, transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(#18e6ff08 1px, transparent 1px),
    linear-gradient(90deg, #18e6ff08 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: linear-gradient(to bottom, black, transparent 80%)
}
button,
input {
  font: inherit
}
.main {
  min-height: 100vh
}
.top {
  min-height: 65px;
  height: 85px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 10px 30px;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: #030b14aa;
  backdrop-filter: blur(10px);
  overflow: visible
}
.brand {
  position: static;
  left: auto;
  top: auto;
  transform: none;
  height: 65px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  z-index: 2;
  pointer-events: none
}
.brand img {
  display: block;
  width: 150px;
  height: 55px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px #00bfff55)
}
.top-actions {
  position: static;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  z-index: 5
}
.language-select {
  position: static;
  display: block;
  width: 125px;
  min-width: 125px;
  max-width: 125px;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0 28px 0 10px;
  flex: 0 0 125px;
  box-sizing: border-box;
  border: 1px solid #1b718e;
  background: #061624;
  color: white;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  z-index: 10
}
.language-select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px #18e6ff0d
}
.language-select option {
  background: #071321;
  color: white
}
.connect {
  position: static;
  right: auto;
  top: auto;
  transform: none;
  border: 1px solid #1b718e;
  background: linear-gradient(90deg, #07334a, #08264a);
  color: white;
  border-radius: 9px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  height: 40px;
  white-space: nowrap;
  flex: 0 0 auto;
  z-index: 11
}
.content {
  max-width: 1320px;
  margin: auto;
  padding: 26px 30px 34px
}
.card,
.stat {
  background: linear-gradient(145deg, #091a29, #050d16);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 15px 45px #0004
}
.card {
  padding: 20px
}
.section {
  margin-top: 16px
}
.action {
  border-color: #16d9ff42;
  background:
    radial-gradient(circle at 90% 10%, #083a5540, transparent 35%),
    linear-gradient(145deg, #081a2a, #040b13)
}
.action-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 30px;
  align-items: center
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--cyan);
  font-weight: 800
}
.muted {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6
}
h2 {
  font-size: 19px;
  margin: 5px 0 0
}
.steps {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 18px;
  flex-wrap: wrap
}
.step {
  padding: 9px 12px;
  border: 1px solid #17394d;
  border-radius: 9px;
  color: #8099aa;
  font-size: 10px;
  background: #04101b
}
.step b {
  color: var(--cyan);
  margin-right: 5px
}
.entry {
  background: #030a12;
  border: 1px solid #17364b;
  border-radius: 13px;
  padding: 16px
}
.entry label {
  font-size: 9px;
  color: #6d8799;
  text-transform: uppercase;
  letter-spacing: .7px
}
input {
  width: 100%;
  background: #02070d;
  border: 1px solid #193c52;
  color: white;
  border-radius: 9px;
  padding: 12px;
  margin: 7px 0 12px;
  outline: none;
  font-family: monospace;
  font-size: 10px
}
input:focus {
  border-color: #18e6ff77;
  box-shadow: 0 0 0 3px #18e6ff0d
}
.btn {
  border: 0;
  border-radius: 9px;
  padding: 12px;
  width: 100%;
  font-weight: 800;
  color: white;
  cursor: pointer;
  background: linear-gradient(100deg, #08cde9, #166cff);
  box-shadow: 0 8px 25px #087dd533
}
.btn:disabled {
  opacity: .5;
  cursor: not-allowed
}
.approve {
  background: linear-gradient(100deg, #8b6400, #d6a512);
  box-shadow: 0 8px 25px #8b640033
}
.approval-status {
  font-size: 8px;
  color: #6f8797;
  margin-top: 8px;
  text-align: center
}
.approval-status.ok {
  color: var(--green)
}
.note {
  font-size: 8px;
  color: #536e80;
  display: block;
  margin-top: 9px;
  line-height: 1.5
}
.grid {
  display: grid;
  gap: 12px
}
.stats {
  grid-template-columns: repeat(6, 1fr);
  margin-top: 16px
}
.stat {
  padding: 16px;
  min-height: 110px
}
.stat .icon {
  font-size: 17px;
  color: var(--cyan);
  margin-bottom: 13px
}
.stat .label {
  font-size: 9px;
  color: #6e8799;
  text-transform: uppercase;
  letter-spacing: .7px
}
.stat .value {
  font-size: 21px;
  font-weight: 800;
  margin-top: 7px;
  white-space: nowrap
}
.stat .hint {
  font-size: 8px;
  color: #4f687b;
  margin-top: 5px
}
.two {
  grid-template-columns: 1.15fr .85fr
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 17px
}
.card-head .right {
  color: var(--cyan);
  font-size: 18px
}
.levels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px
}
.level {
  background: #030b13;
  border: 1px solid #153247;
  border-radius: 12px;
  padding: 13px;
  position: relative;
  overflow: hidden
}
.level.current {
  border-color: #18e6ff66;
  box-shadow: inset 0 0 25px #18e6ff08
}
.level .num {
  font-weight: 900;
  font-size: 21px
}
.level .status {
  float: right;
  font-size: 7px;
  color: #607b8d;
  letter-spacing: .8px
}
.level.done .status {
  color: var(--green)
}
.level strong {
  display: block;
  font-size: 23px;
  margin-top: 14px
}
.level small {
  color: #657f91;
  font-size: 8px
}
.level .pay {
  color: var(--cyan);
  font-size: 9px;
  margin-top: 10px
}
.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid #123047;
  font-size: 10px
}
.row span {
  color: #71899a
}
.row b {
  color: #e8f7ff;
  text-align: right;
  word-break: break-all
}
.progress-box {
  padding: 12px 0 16px
}
.progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #8da5b5
}
.progress-top b {
  color: var(--cyan)
}
.bar {
  height: 7px;
  border-radius: 99px;
  background: #0a1b29;
  margin: 10px 0;
  overflow: hidden
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  border-radius: 99px;
  transition: .35s
}
.ref-link {
  display: flex;
  gap: 8px;
  margin-top: 8px
}
.ref-link span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #030a12;
  border: 1px solid #17364b;
  border-radius: 8px;
  padding: 10px;
  font-family: monospace;
  font-size: 8px;
  color: #90a9b8
}
.copy {
  background: #0a2940;
  color: var(--cyan);
  border: 1px solid #1b526c;
  border-radius: 8px;
  padding: 0 13px;
  cursor: pointer
}
.history {
  grid-template-columns: repeat(5, 1fr)
}
.history .h {
  padding: 15px;
  background: #030b13;
  border: 1px solid #132e41;
  border-radius: 11px
}
.history .h span {
  display: block;
  color: #698295;
  font-size: 9px
}
.history .h b {
  display: block;
  font-size: 18px;
  margin-top: 7px
}
.green {
  color: var(--green) !important
}
.footer {
  text-align: center;
  color: #425c6d;
  font-size: 8px;
  padding: 24px
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #071d2c;
  border: 1px solid #1b566f;
  color: #dffaff;
  padding: 12px 15px;
  border-radius: 10px;
  font-size: 10px;
  opacity: 0;
  transform: translateY(10px);
  transition: .25s;
  pointer-events: none;
  z-index: 99
}
.toast.show {
  opacity: 1;
  transform: none
}
.position-wrap {
  overflow: auto;
  border: 1px solid #123047;
  border-radius: 11px
}
.position-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px
}
.position-table th,
.position-table td {
  padding: 10px 11px;
  border-bottom: 1px solid #123047;
  text-align: left;
  font-size: 9px
}
.position-table th {
  color: #6e8799;
  text-transform: uppercase;
  letter-spacing: .7px;
  background: #030b13
}
.position-table td {
  color: #c8d9e2
}
.pill {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid #24485e;
  font-size: 7px;
  letter-spacing: .5px
}
.pill.active {
  color: var(--green);
  border-color: #267052
}
.pill.pending {
  color: #ffbd18
}
.pill.auto {
  color: var(--cyan);
  border-color: #176b80
}
.pill.manual {
  color: #aebdca
}
.empty {
  color: #5d7688 !important;
  text-align: center !important;
  padding: 18px !important
}
.refresh {
  width: auto;
  padding: 8px 12px;
  font-size: 9px;
  background: #0a2940;
  box-shadow: none
}
.notice {
  display: none;
  margin: 12px 0;
  padding: 11px;
  border-radius: 9px;
  font-size: 9px
}
.notice.show {
  display: block
}
.notice.error {
  background: #3a1018;
  border: 1px solid #7d2737;
  color: #ffb7c2
}
.notice.success {
  background: #0b3326;
  border: 1px solid #236e50;
  color: #b9f4d6
}
.notice.info {
  background: #092b3a;
  border: 1px solid #1c647c;
  color: #b9edff
}
.spinner {
  display: none
}
.position-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 12px
}
.mini {
  padding: 10px;
  background: #030b13;
  border: 1px solid #153247;
  border-radius: 10px
}
.mini span {
  display: block;
  color: #607b8d;
  font-size: 7px;
  text-transform: uppercase
}
.mini b {
  display: block;
  margin-top: 5px;
  font-size: 16px
}
.wallet-line {
  font-family: monospace;
  font-size: 9px;
  color: #9db3c0;
  word-break: break-all
}
@media(max-width:1150px) {
  .stats {
    grid-template-columns: repeat(4, 1fr)
  }
  .action-layout {
    grid-template-columns: 1fr 330px
  }
}
@media(max-width:900px) {
  .two {
    grid-template-columns: 1fr
  }
  .history {
    grid-template-columns: repeat(3, 1fr)
  }
  .action-layout {
    grid-template-columns: 1fr
  }
  .position-summary {
    grid-template-columns: repeat(3, 1fr)
  }
  .top {
    padding-left: 20px;
    padding-right: 20px;
    gap: 12px
  }
  .brand img {
    width: 125px;
    height: 52px
  }
  .top-actions {
    gap: 7px
  }
  .language-select {
    width: 115px;
    min-width: 115px;
    max-width: 115px;
    flex-basis: 115px;
    font-size: 9px
  }
  .connect {
    padding: 9px 11px;
    font-size: 10px
  }
}
@media(max-width:650px) {
  .content {
    width: 100%;
    max-width: 100%;
    padding: 17px 12px 28px;
    overflow-x: hidden
  }
  /* HEADER */
  .top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-width: 0;
    min-height: 65px;
    height: 65px;
    padding: 8px 12px;
    gap: 8px
  }
  /* LOGO */
  .brand {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    height: 55px;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start
  }
  .brand img {
    width: 95px;
    height: 52px;
    max-width: 100%;
    object-fit: contain
  }
  /* ACTIONS */
  .top-actions {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    min-width: 0;
    gap: 5px;
    margin: 0;
    padding: 0
  }
  /* LANGUAGE */
  .language-select {
    position: static;
    width: 95px;
    min-width: 95px;
    max-width: 95px;
    height: 36px;
    min-height: 36px;
    flex: 0 0 95px;
    padding: 0 20px 0 7px;
    font-size: 9px
  }
  .top .connect {
    position: static;
    right: auto;
    top: auto;
    transform: none;
    width: auto;
    min-width: 0;
    max-width: 105px;
    height: 36px;
    padding: 8px 8px;
    flex: 0 1 auto;
    font-size: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
  }
  .card,
  .stat,
  .grid,
  .section,
  .action-layout,
  .two,
  .entry {
    min-width: 0;
    max-width: 100%
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important
  }
  .stat {
    padding: 13px;
    overflow: hidden
  }
  .stat .value {
    font-size: 18px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word
  }
  .levels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px
  }
  .level {
    min-width: 0;
    padding: 11px
  }
  .level .num {
    font-size: 18px
  }
  .level strong {
    font-size: 20px
  }
  .history {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }
  .history .h {
    min-width: 0;
    padding: 12px;
    overflow: hidden
  }
  .history .h b {
    font-size: 16px;
    overflow-wrap: anywhere
  }
  .position-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px
  }
  .mini {
    min-width: 0;
    overflow: hidden
  }
  .mini b {
    overflow-wrap: anywhere;
    word-break: break-word
  }
  .action-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px
  }
  .ref-link {
    min-width: 0
  }
  .ref-link span {
    min-width: 0
  }
  .position-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch
  }
  .position-table {
    min-width: 620px
  }
  .card-head {
    min-width: 0
  }
  .card-head>div {
    min-width: 0
  }
  .card-head h2 {
    font-size: 17px;
    overflow-wrap: anywhere
  }
  .muted {
    overflow-wrap: anywhere
  }
  .row {
    min-width: 0
  }
  .row b {
    min-width: 0;
    max-width: 60%
  }
  .footer {
    padding: 20px 8px
  }
  .toast {
    right: 12px;
    left: 12px;
    bottom: 12px;
    text-align: center
  }
}
@media(max-width:380px) {
  .content {
    padding-left: 9px;
    padding-right: 9px
  }
  .stats,
  .history,
  .position-summary {
    grid-template-columns: minmax(0, 1fr) !important
  }
  .levels {
    grid-template-columns: minmax(0, 1fr)
  }
  /* HEADER SMALL */
  .top {
    padding-left: 8px;
    padding-right: 8px;
    gap: 5px
  }
  .brand {
    left: auto;
  }
  .brand img {
    width: 82px;
    height: 48px
  }
  .top-actions {
    gap: 4px
  }
  .language-select {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    flex-basis: 88px;
    height: 34px;
    min-height: 34px;
    font-size: 8px;
    padding-left: 6px;
    padding-right: 16px
  }
  .top .connect {
    max-width: 96px;
    height: 34px;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 8px
  }
  .stat .value {
    font-size: 17px
  }
  .card {
    padding: 15px
  }
}