/* KLite marketplace credit wallet, purchase, and owner controls. */
.credit-wallet-card {
  grid-column: 1 / -1;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(8, 215, 255, 0.28);
  border-radius: 10px;
  background:
    linear-gradient(110deg, rgba(8, 215, 255, 0.075), rgba(4, 12, 19, 0.96) 42%, rgba(255, 122, 26, 0.06)),
    url('/assets/obsidian-fractures.svg') center / cover;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035), 0 18px 40px rgba(0, 0, 0, 0.3);
}

.credit-wallet-heading,
.credit-admin-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.credit-wallet-heading > div:first-child {
  max-width: 760px;
}

.credit-wallet-heading h3,
.credit-admin-heading h3 {
  margin: 3px 0 0;
  color: #edf6f9;
}

.credit-wallet-heading p:not(.eyebrow) {
  margin: 8px 0 0;
  color: #9cabb5;
}

.credit-balance-block {
  min-width: 210px;
  padding: 14px 18px;
  text-align: right;
  border: 1px solid rgba(8, 215, 255, 0.34);
  border-radius: 8px;
  background: rgba(8, 215, 255, 0.07);
}

.credit-balance-block span {
  display: block;
  color: #8ea5b2;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.credit-balance-block strong {
  display: block;
  margin-top: 4px;
  color: #8cecff;
  font-size: 1.35rem;
}

.credit-pack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.credit-pack-card {
  position: relative;
  min-width: 0;
  min-height: 196px;
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(132, 178, 201, 0.23);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(8, 21, 31, 0.96), rgba(2, 7, 12, 0.99));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.credit-pack-card::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 1px;
  background: linear-gradient(90deg, #08d7ff, transparent, #ff7a1a);
  opacity: 0.48;
}

.credit-pack-card:hover {
  border-color: rgba(8, 215, 255, 0.48);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.035);
}

.credit-pack-featured {
  border-color: rgba(255, 122, 26, 0.48);
  box-shadow: 0 0 26px rgba(255, 122, 26, 0.09), inset 0 1px rgba(255, 255, 255, 0.025);
}

.credit-pack-heading {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.credit-pack-heading strong {
  display: block;
  color: #f2f7f9;
  font-size: 1.35rem;
  line-height: 1.15;
}

.credit-pack-heading span,
.credit-pack-card small {
  color: #91a7b3;
  font-size: 0.72rem;
}

.credit-pack-card > b {
  color: #8cecff;
  font-size: 1rem;
}

.credit-topup-button {
  width: 100%;
  margin-top: auto;
  justify-content: center;
}

.credit-topup-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

#credit-status {
  min-height: 1.3em;
  margin: 14px 0 0;
  color: #8ea7b5;
}

#credit-status.is-error {
  color: #ff8f69;
}

.credit-transaction-wrap {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(132, 178, 201, 0.16);
}

.credit-transaction-wrap h4 {
  margin: 0 0 10px;
}

.credit-transaction-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.credit-transaction {
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(132, 178, 201, 0.14);
  border-radius: 6px;
  background: rgba(2, 8, 13, 0.72);
}

.credit-transaction > div {
  min-width: 0;
}

.credit-transaction strong,
.credit-transaction small {
  display: block;
}

.credit-transaction strong {
  overflow-wrap: anywhere;
}

.credit-transaction small,
.credit-empty {
  margin-top: 3px;
  color: #8198a5;
  font-size: 0.7rem;
}

.credit-positive {
  color: #65e47b;
}

.credit-negative {
  color: #ff9a62;
}

.plugin-credit-actions {
  margin-top: 16px;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid rgba(132, 178, 201, 0.16);
}

.plugin-credit-actions > strong {
  color: #8cecff;
}

.credit-admin-panel {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid rgba(132, 178, 201, 0.23);
  border-radius: 9px;
  background:
    linear-gradient(145deg, rgba(6, 17, 26, 0.92), rgba(2, 7, 12, 0.97)),
    url('/assets/obsidian-fractures.svg') center / cover;
}

.credit-price-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.65fr) auto auto;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
}

.credit-price-form label:not(.credit-active-field) span,
.credit-price-form input {
  display: block;
  width: 100%;
}

.credit-price-form label > span {
  margin-bottom: 6px;
  color: #94aab6;
  font-size: 0.72rem;
}

.credit-active-field {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.credit-admin-columns {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 16px;
  margin-top: 18px;
}

#credit-admin-prices,
#credit-admin-transactions {
  display: grid;
  gap: 8px;
}

.credit-admin-row {
  width: 100%;
  padding: 11px 12px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  color: #e7eff3;
  border: 1px solid rgba(132, 178, 201, 0.15);
  border-radius: 6px;
  background: rgba(2, 8, 13, 0.72);
}

button.credit-admin-row {
  cursor: pointer;
}

.credit-admin-row span {
  color: #8fa6b3;
  font-size: 0.72rem;
}

@media (max-width: 1180px) {
  .credit-pack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .credit-admin-columns {
    grid-template-columns: 1fr;
  }

  .credit-price-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .credit-wallet-card {
    padding: 18px;
  }

  .credit-wallet-heading,
  .credit-admin-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .credit-balance-block {
    min-width: 0;
    text-align: left;
  }

  .credit-pack-grid,
  .credit-price-form {
    grid-template-columns: 1fr;
  }

  .plugin-credit-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .credit-transaction {
    align-items: flex-start;
  }
}
