.page-profile {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 10%, rgba(31, 150, 162, .13), transparent 30rem),
    radial-gradient(circle at 90% 20%, rgba(220, 176, 74, .12), transparent 28rem),
    #f5f8fa;
}

.profile-container { padding-block: 42px 70px; }

.profile-hero,
.profile-overview,
.profile-cost-card,
.ledger-heading,
.credit-stats { display: flex; align-items: center; }

.profile-hero {
  justify-content: space-between;
  gap: 24px;
  padding: 30px;
  border: 1px solid rgba(12, 63, 80, .12);
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(135deg, #071f2c 0%, #0b4050 60%, #126775 100%);
  box-shadow: 0 22px 60px rgba(7, 31, 44, .18);
}

.profile-hero h1,
.profile-cost-card h2,
.profile-ledger-card h2 { margin: 7px 0; }
.profile-hero p { margin: 0; color: rgba(255, 255, 255, .78); }
.profile-kicker { color: #d8ad4e; font-weight: 800; font-size: .86rem; }

.profile-charge-button,
.logout-btn,
#refreshWalletBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.profile-charge-button {
  padding: 14px 20px;
  color: #10242c;
  text-decoration: none;
  background: linear-gradient(135deg, #f1d37e, #d6a83e);
  box-shadow: 0 10px 25px rgba(214, 168, 62, .28);
  white-space: nowrap;
}

.profile-notice {
  margin: 18px 0;
  padding: 12px 16px;
  border: 1px solid rgba(12, 63, 80, .12);
  border-radius: 14px;
  background: #fff;
  color: #47616c;
}
.profile-notice.is-error { color: #a02929; border-color: rgba(160, 41, 41, .22); }
.profile-notice.is-ready { display: none; }

.profile-overview { align-items: stretch; gap: 18px; }
.profile-overview > article,
.profile-cost-card,
.profile-ledger-card {
  border: 1px solid rgba(12, 63, 80, .11);
  border-radius: 24px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 15px 40px rgba(15, 63, 76, .08);
}
.profile-overview > article { flex: 1; padding: 24px; }

.profile-identity-card { display: flex; gap: 18px; align-items: flex-start; }
.profile-card-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(135deg, #0f8390, #0b4050);
}
.profile-info { width: 100%; }
.page-profile .profile-info {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #526974;
}
.profile-info .stat { padding: 9px 0; color: #526974; border-bottom: 1px solid #edf2f4; }
.profile-info .stat:last-child { border: 0; }
.page-profile .profile-info .stat { color: #526974 !important; }
.page-profile .profile-info strong { color: #102f3a !important; }

.profile-credit-card {
  color: #fff;
  background: linear-gradient(145deg, #092b38, #0d5965) !important;
  overflow: hidden;
  position: relative;
}
.profile-credit-card::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  inset: auto -65px -85px auto;
  background: rgba(216, 173, 78, .14);
}
.credit-card-head { display: flex; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.credit-card-head > span { font-weight: 800; }
#aiSubscriptionBadge { padding: 5px 10px; border-radius: 999px; color: #112b33; background: #dfbd64; font-size: .76rem; }
.credit-balance { display: block; margin-top: 14px; color: #fff1bd; font-size: clamp(2.4rem, 7vw, 4.2rem); line-height: 1; }
.profile-credit-card > small { color: rgba(255, 255, 255, .7); }
.credit-stats { gap: 10px; margin-top: 20px; }
.credit-stats span { flex: 1; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .08); font-size: .82rem; }
.credit-stats b { display: block; margin-top: 4px; color: #fff; font-size: 1.05rem; }
#aiSubscriptionExpiry { margin: 14px 0 0; color: rgba(255, 255, 255, .72); font-size: .84rem; position: relative; z-index: 1; }

.profile-cost-card {
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  padding: 24px;
  color: #173d49;
}
.page-profile .profile-cost-card h2,
.page-profile .profile-ledger-card h2 { color: #103945 !important; }
.profile-cost-card p { margin: 0; color: #637984; }
.operation-costs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 520px; }
.operation-costs span { padding: 9px 12px; border-radius: 12px; color: #0d5560; background: #edf7f7; font-weight: 800; white-space: nowrap; }
.operation-costs b { color: #bd8420; }

.profile-ledger-card { margin-top: 18px; padding: 24px; }
.ledger-heading { justify-content: space-between; gap: 16px; margin-bottom: 14px; }
#refreshWalletBtn { padding: 10px 14px; color: #0d5965; background: #eaf4f5; }
.ledger-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 15px 4px;
  border-top: 1px solid #edf1f3;
}
.ledger-row:first-child { border-top: 0; }
.ledger-operation strong { display: block; color: #173d49; }
.ledger-operation small,
.ledger-balance small { display: block; color: #7a8d95; }
.ledger-amount { min-width: 76px; text-align: center; padding: 7px 10px; border-radius: 10px; font-weight: 900; direction: ltr; }
.ledger-row.is-plus .ledger-amount { color: #167346; background: #e9f8f0; }
.ledger-row.is-minus .ledger-amount { color: #b33b3b; background: #fff0f0; }
.ledger-balance { min-width: 92px; text-align: left; }
.ledger-balance b { color: #183e49; direction: ltr; display: block; }
.ledger-empty { padding: 28px 8px; text-align: center; color: #768990; }

.logout-btn { margin-top: 20px; padding: 12px 18px; color: #9d2d2d; background: #fff; border: 1px solid rgba(157, 45, 45, .16); }

@media (max-width: 760px) {
  .profile-container { padding-block: 22px 50px; }
  .profile-hero,
  .profile-cost-card { align-items: stretch; flex-direction: column; }
  .profile-hero { padding: 22px; border-radius: 22px; }
  .profile-charge-button { width: 100%; }
  .profile-overview { flex-direction: column; }
  .profile-overview > article,
  .profile-cost-card,
  .profile-ledger-card { padding: 19px; border-radius: 20px; }
  .operation-costs { justify-content: flex-start; }
  .ledger-row { grid-template-columns: 1fr auto; gap: 9px; }
  .ledger-balance { grid-column: 1 / -1; display: flex; justify-content: space-between; text-align: right; }
}
