/* Balance pill + modal (Leelo redesign)
   Keep scoped to .lx-* to avoid legacy breakage.
*/

.lx-balancePill{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(75, 88, 124, 0.14);
  background: rgba(255, 255, 255, 0.92);
  font-family: inherit;
  color: #000;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}

.lx-balancePill:hover{
  background: #fff;
  border-color: rgba(75, 88, 124, 0.20);
}

.lx-balancePill:active{
  transform: translateY(1px);
}

.lx-balancePill__icon{
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lx-balancePill__icon svg{ display:block; }

.lx-balancePill__amount{
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.lx-balancePill__value{
  white-space: nowrap;
}

.lx-balancePill__currency{
  white-space: nowrap;
  font-weight: 400;
  line-height: 1;
}

.lx-balancePill__icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(23, 171, 19, 0.12);
  border: 1px solid rgba(23, 171, 19, 0.22);
  color: #17ab13;
  line-height: 1;
}

.lx-balancePill:hover .lx-balancePill__icon{
  background: rgba(23, 171, 19, 0.16);
  border-color: rgba(23, 171, 19, 0.30);
}

.lx-balancePill:active .lx-balancePill__icon{
  transform: translateY(1px);
}

/* Modal */
.lx-balanceModal[hidden]{ display:none !important; }

.lx-balanceModal{
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.lx-balanceModal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(9, 18, 34, 0.55);
  backdrop-filter: blur(4px);
}

.lx-balanceModal__dialog{
  position: relative;
  margin: 70px auto 24px;
  width: min(560px, calc(100% - 24px));
  border-radius: 18px;
  border: 1px solid rgba(75, 88, 124, 0.14);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 60px rgba(31, 42, 68, 0.25);
  overflow: hidden;
  font-size: 16px;
}

@media (max-width: 560px){
  .lx-balanceModal__dialog{
    margin: 18px auto 18px;
    width: calc(100% - 18px);
  }
}

.lx-balanceModal__head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(75, 88, 124, 0.12);
}

.lx-balanceModal__title{
  font-size: 18px;
  font-weight: 600;
  color: var(--lx-ink);
  letter-spacing: -0.01em;
}

.lx-balanceModal__close{
  border: 1px solid rgba(75, 88, 124, 0.16);
  background: rgba(244, 246, 251, 0.9);
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: rgba(31, 42, 68, 0.55);
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.lx-balanceModal__close:hover{
  background: rgba(244, 246, 251, 1);
  border-color: rgba(75, 88, 124, 0.22);
  color: rgba(31, 42, 68, 0.72);
}

.lx-balanceModal__body{ padding: 18px; }

.lx-balanceModal__balance{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(75, 88, 124, 0.12);
  background: rgba(244, 246, 251, 0.75);
}

.lx-balanceModal__balanceLabel{
  font-size: 14px;
  color: rgba(31, 42, 68, 0.70);
  font-weight: 500;
}

.lx-balanceModal__balanceValue{
  font-size: 18px;
  font-weight: 600;
  color: var(--lx-ink);
}

.lx-balanceModal__form{ margin-top: 14px; }

.lx-balanceModal__field{ margin-top: 6px; }

.lx-balanceModal__label{
  font-size: 14px;
  font-weight: 500;
  color: rgba(31, 42, 68, 0.74);
  margin: 0 0 8px;
}

.lx-balanceModal__row{
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}

.lx-balanceModal__input{
  flex: 1 1 260px;
  min-width: 0;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(75, 88, 124, 0.16);
  background: rgba(244, 246, 251, 0.88);
  padding: 0 14px;
  font-size: 16px;
  font-weight: 450;
  color: rgba(31, 42, 68, 0.92);
  outline: 0;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.lx-balanceModal__input::placeholder{ color: rgba(31, 42, 68, 0.40); }

.lx-balanceModal__input:focus{
  background: #fff;
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.lx-balanceModal__submit{
  flex: 0 0 auto;
  height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 600 !important;
  font-size: 16px;
  white-space: nowrap;
}

/* Modal button: disable heavy theme glow layers (they visually overlap the input) */
.lx-balanceModal .lx-btn--brand{
  box-shadow: none !important;
  filter: none !important;
}

.lx-balanceModal .lx-btn--brand::before,
.lx-balanceModal .lx-btn--brand::after{
  content: none !important;
}

.lx-balanceModal .lx-btn--brand:hover,
.lx-balanceModal .lx-btn--brand:active{
  transform: none !important;
}

.lx-balanceModal__submit:disabled{
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
  filter: grayscale(0.1);
}

.lx-balanceModal__error{
  min-height: 16px;
  margin-top: 8px;
  font-size: 14px;
  color: rgba(220, 38, 38, 0.92);
  font-weight: 500;
}

/* When row becomes tight, button naturally drops below due to wrap.
   Keep a small breakpoint to force 100% button on small screens. */
@media (max-width: 520px){
  .lx-balanceModal__submit{ width: 100%; }
}

.lx-balanceModal__chips{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.lx-balanceChip{
  border: 1px solid rgba(75, 88, 124, 0.14);
  background: rgba(244, 246, 251, 0.78);
  color: rgba(31, 42, 68, 0.88);
  border-radius: 16px;
  height: 44px;
  padding: 0 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .08s ease;
}

/* Billing page (Balance) — used on /billing inside .lx-me */
.lx-me .lx-billingBody{
  padding: 0 0 18px;
}

.lx-me .lx-balanceHero{
  display:flex;
  gap: 18px;
  align-items:flex-start;
  justify-content: space-between;
  padding: 18px 20px;
  border-top: 1px solid var(--lx-border);
  border-bottom: 1px solid var(--lx-border);
}

.lx-me .lx-balanceHero__left{ min-width: 0; }

.lx-me .lx-balanceHero__label{
  font-size: 13px;
  color: rgba(15,23,42,.65);
  margin-bottom: 6px;
}

.lx-me .lx-balanceHero__value{
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.lx-me .lx-balanceHero__hint{
  margin-top: 8px;
  color: rgba(15,23,42,.65);
  font-size: 14px;
  max-width: 680px;
}

.lx-me .lx-balanceHero__actions{ flex: 0 0 auto; }

@media (max-width: 720px){
  .lx-me .lx-balanceHero{ flex-direction: column; align-items: stretch; }
  .lx-me .lx-balanceHero__actions .lx-btn{ width: 100%; }
}

.lx-me .lx-billingHistory{
  padding: 16px 20px 6px;
}

.lx-me .lx-billingHistory__title{
  font-size: 16px;
  font-weight: 650;
  margin-bottom: 10px;
}

.lx-me .lx-billingTableWrap{
  border: 1px solid var(--lx-border);
  border-radius: 14px;
  background: rgba(255,255,255,.7);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.lx-me .lx-billingTable{
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 14px;
}

.lx-me .lx-billingTable th,
.lx-me .lx-billingTable td{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15,23,42,.08);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.lx-me .lx-billingTable thead th{
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(15,23,42,.60);
  background: rgba(15,23,42,.02);
}

.lx-me .lx-billingTable tbody tr:last-child td{ border-bottom: 0; }

.lx-me .lx-amount{ font-weight: 650; }

.lx-me .lx-mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: rgba(15,23,42,.70);
}

.lx-me .lx-muted{ color: rgba(15,23,42,.55); }

.lx-me .lx-status{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  background: rgba(15,23,42,.06);
  color: rgba(15,23,42,.70);
}

.lx-me .lx-status.is-success{ background: rgba(34,197,94,.12); color: rgba(21,128,61,.95); }
.lx-me .lx-status.is-pending{ background: rgba(37,99,235,.10); color: rgba(29,78,216,.95); }
.lx-me .lx-status.is-failed{ background: rgba(239,68,68,.12); color: rgba(153,27,27,.95); }

.lx-balanceChip:hover{
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.10);
  color: rgba(29, 78, 216, 1);
}

.lx-balanceChip:active{ transform: translateY(1px); }

.lx-balanceModal__note{
  margin-top: 10px;
  font-size: 14px;
  color: rgba(31, 42, 68, 0.65);
}

.lx-balanceModal__links{
  margin-top: 10px;
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
}

.lx-balanceModal__links a{
  font-size: 14px;
  font-weight: 600;
  color: rgba(29, 78, 216, 1);
  text-decoration: none;
}

.lx-balanceModal__links a:hover{ text-decoration: underline; }

/* Billing page layout */
.lx-billingGrid{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 14px;
}

@media (max-width: 980px){
  .lx-billingGrid{ grid-template-columns: 1fr; }
}

.lx-billingCard{ padding: 16px; border-radius: 18px; }

.lx-billingBalanceLabel{ font-size: 13px; color: rgba(31, 42, 68, 0.70); font-weight: 800; }
.lx-billingBalanceValue{ margin-top: 6px; font-size: 32px; font-weight: 950; color: var(--lx-ink); }
.lx-billingDivider{ margin: 14px 0; opacity: .2; }
