/* Пилюля баланса с переключателем валют */
.bal-switch {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 999px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.bal-switch .curr-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: filter .2s ease, opacity .2s ease, transform .2s ease;
}

.bal-switch .curr-icon img,
.bal-switch .curr-icon svg {
  width: 100%;
  height: 100%;
}

.bal-switch .curr-icon.inactive {
  filter: grayscale(1) brightness(.8);
  opacity: .55;
}

/* Тумблер */
.bal-switch .curr-toggle {
  position: relative;
  width: 76px;   /* было 90 */
  height: 34px;  /* было 44 */
  background: #1e1f22;
  border-radius: 999px;
  display: inline-block;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.06);
}

.curr-amount{
    margin-right: 20px;
}

.bal-switch .curr-toggle input {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  inset: 0;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.bal-switch .curr-toggle .curr-slider {
  position: absolute;
  top: 50%;
  left: 8px;
  width: 22px;   /* было 28 */
  height: 22px;  /* было 28 */
  transform: translateY(-50%);
  border-radius: 50%;
  background: #f0b316; /* жёлтый бегунок */
  box-shadow: 0 4px 16px rgba(240,179,22,.45);
  transition: left .22s cubic-bezier(.22,.61,.36,1), width .22s, background .2s;
}

.bal-switch .curr-toggle input:checked + .curr-slider {
  left: 46px; /* 76 - 22 - 8 */
}

/* Сумма справа — минимум 60px, дальше растёт автоматически */
.bal-switch .curr-amount {
  font: 600 26px/1 "Onest", system-ui, -apple-system, Segoe UI, Roboto, Arial;
  letter-spacing: .2px;
  color: #fff;
  white-space: nowrap;
  display: inline-block;
  text-align: right;
  font-variant-numeric: tabular-nums; /* одинаковая ширина цифр */
  width: auto;           /* <— рост по содержимому */
  min-width: 60px;       /* <— минимум 60px, как просил */
  box-sizing: content-box;
}

/* Спрятать старую кнопку пополнения, если где-то осталась */
.plus-btn, .balance-plus, [data-role="deposit-plus"] {
  display: none !important;
}

/* ----- компактный режим (мобильный) ----- */
.bal-switch.compact {
  gap: 8px;
  padding: 8px 0px;
  border-radius: 999px;
}

.bal-switch.compact .curr-icon {
  width: 22px;
  height: 22px;
}

.bal-switch.compact .curr-toggle {
  width: 64px;
  height: 30px;
  border-radius: 999px;
}

.bal-switch.compact .curr-toggle .curr-slider {
  left: 6px;
  width: 20px;
  height: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.bal-switch.compact .curr-toggle input:checked + .curr-slider {
  left: 38px; /* 64 - 20 - 6 */
}

.bal-switch.compact .curr-amount {
  font-size: 16px;
  width: auto;
  min-width: 60px;
}

/* На узких экранах авто-компакт */
@media (max-width: 480px) {
  .bal-switch { gap: 8px; padding: 8px 10px; }
  .bal-switch .curr-icon { width: 22px; height: 22px; }
  .bal-switch .curr-toggle { width: 64px; height: 30px; }
  .bal-switch .curr-toggle .curr-slider { left: 6px; width: 20px; height: 20px; }
  .bal-switch .curr-toggle input:checked + .curr-slider { left: 38px; }
  .bal-switch .curr-amount { font-size: 16px; width: auto; min-width: 60px; }
}

/* fallback-якорь */
@media (max-width: 480px) {
  .balance-anchor-fallback { top: 8px; right: 8px; }
}

/* Плюсик пополнения показываем только при USD */
.bal-switch .curr-plus{
  display:none;
  width:22px;
  height:22px;
  cursor:pointer;
  user-select:none;
}
.bal-switch .curr-plus img,
.bal-switch .curr-plus svg{
  width:100%;
  height:100%;
  display:block;
}
.bal-switch.is-usd .curr-plus{ display:inline-flex; }

/* Небольшой отступ, чтобы не лип к сумме */
.bal-switch .curr-plus{ margin-left:6px; }

.curr-plus {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.curr-plus img {
  width: 100%;
  height: 100%;
}

/* === TOP BAR: язык слева, баланс справа, без переносов === */
.top-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:nowrap;           /* важно: не переносить язык на новую строку */
}

/* Слот баланса — прижать вправо */
.top-bar #balance-slot{
  flex:1 1 auto;
  display:flex;
  justify-content:flex-end;
  min-width:0;                /* чтобы внутрянка могла ужиматься */
}

/* Пилюля баланса — не раздвигает шапку */
#balance-slot .bal-switch{
  flex:0 1 auto;
  max-width:100%;
  white-space:nowrap;
}

/* Сумма: не дергает лейаут, ужимается с многоточием */
#balance-slot .bal-switch .curr-amount{
  min-width:60px;
  max-width:min(40vw, 160px);
  overflow:hidden;
  text-overflow:ellipsis;
  margin-right: 20px;
}

/* Плюсик — компактный */
#balance-slot .bal-switch .curr-plus{
  width:22px; height:22px;
  display:none; align-items:center; justify-content:center;
  margin-left:0px;
}
#balance-slot .bal-switch .curr-plus img{ width:100%; height:100%; }

#balance-slot .bal-switch .curr-amount {
  font-size: 0.9rem;
}