.ks-wallet-modal-overlay,
.ks-wallet-account-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.ks-wallet-modal-overlay[data-open="true"],
.ks-wallet-account-overlay[data-open="true"] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ks-wallet-modal,
.ks-wallet-account {
  width: min(520px, 100%);
  max-height: calc(100dvh - 40px);
  border: 1px solid #343a3f;
  border-radius: 18px;
  background: #171717;
  color: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  opacity: 0.98;
  transform: translateY(10px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
}

.ks-wallet-modal-overlay[data-open="true"] .ks-wallet-modal,
.ks-wallet-account-overlay[data-open="true"] .ks-wallet-account {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ks-wallet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 10px;
}

.ks-wallet-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.ks-wallet-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #242424;
  color: #c5ced9;
  cursor: pointer;
  font-size: 20px;
}

.ks-wallet-list,
.ks-wallet-account-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 18px 18px;
}

.ks-wallet-list {
  max-height: min(660px, calc(100dvh - 132px));
  overflow-y: auto;
  padding-right: 12px;
}

.ks-wallet-option,
.ks-wallet-account-action {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #222;
  color: #fff;
  cursor: pointer;
  padding: 13px 14px;
  text-align: left;
}

.ks-wallet-option {
  position: relative;
}

.ks-wallet-option:hover,
.ks-wallet-account-action:hover {
  border-color: #31cb9e;
  background: #26332f;
}

.ks-wallet-option[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

.ks-wallet-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: transparent;
  color: transparent;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  flex: 0 0 42px;
}

.ks-wallet-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ks-wallet-icon-empty {
  background: #2a2a2a;
}

.ks-wallet-option b,
.ks-wallet-account-action b {
  display: block;
  font-size: 15px;
}

.ks-wallet-option .ks-wallet-copy > span,
.ks-wallet-account-action span,
.ks-wallet-address-full {
  color: #98a3b3;
  font-size: 12px;
}

.ks-wallet-copy {
  min-width: 0;
  flex: 1;
}

.ks-wallet-copy > span:empty {
  display: none;
}

.ks-wallet-badges {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  margin-left: auto;
}

.ks-wallet-badges em {
  border: 1px solid rgba(49, 203, 158, 0.35);
  border-radius: 999px;
  background: rgba(49, 203, 158, 0.11);
  color: #31cb9e;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  padding: 4px 6px;
}

#btnConnectWallet {
  min-height: 42px;
  min-width: 92px;
  padding-left: 16px !important;
  padding-right: 16px !important;
}

.ks-wallet-address-full {
  overflow-wrap: anywhere;
  border: 1px solid #30363d;
  border-radius: 12px;
  background: #101010;
  padding: 12px;
}

.ks-wallet-error,
.ks-wallet-toast {
  color: #ffb545;
  font-size: 12px;
  line-height: 1.4;
}

.ks-walletconnect-setup {
  display: grid;
  gap: 8px;
  border: 1px solid #3a3a3a;
  border-radius: 12px;
  background: #111;
  color: #c5ced9;
  padding: 12px;
}

.ks-walletconnect-setup b {
  color: #fff;
  font-size: 13px;
}

.ks-walletconnect-setup span {
  color: #98a3b3;
}

.ks-walletconnect-setup div {
  display: flex;
  gap: 8px;
}

.ks-walletconnect-setup input {
  min-width: 0;
  flex: 1;
  border: 1px solid #343a3f;
  border-radius: 10px;
  background: #090909;
  color: #fff;
  outline: none;
  padding: 9px 10px;
}

.ks-walletconnect-setup button {
  border: 0;
  border-radius: 10px;
  background: #31cb9e;
  color: #07130f;
  cursor: pointer;
  font-weight: 800;
  padding: 9px 12px;
}

.ks-wallet-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10001;
  max-width: 360px;
  border: 1px solid #4d3b1f;
  border-radius: 12px;
  background: #1d1710;
  padding: 12px 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.36);
}

@media (max-width: 520px) {
  .ks-wallet-modal-overlay,
  .ks-wallet-account-overlay {
    align-items: flex-end;
    padding: 10px;
  }

  .ks-wallet-modal,
  .ks-wallet-account {
    border-radius: 18px 18px 10px 10px;
  }

  .ks-wallet-badges {
    display: none;
  }
}
