.topTokenButton {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  min-height: 46px;
  padding: 6px 10px;
  color: #25314a;
  border: 1px solid rgba(137, 148, 170, .24);
  border-radius: 15px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 19px rgba(30, 40, 65, .06);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.topTokenIcon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #fff;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffbc4e, #f36b4d);
  font-size: 12px;
}

.topTokenText {
  display: grid;
  justify-items: start;
  line-height: 1.05;
}

.topTokenText small {
  color: #6a7488;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.topTokenText b {
  margin-top: 3px;
  font-size: 14px;
}

.topTokenButton.isEmpty .topTokenIcon {
  background: linear-gradient(135deg, #a7afbd, #7f899a);
}

.topActions {
  flex-wrap: nowrap !important;
  min-width: 0;
}

body.selfstudyTokenModalOpen {
  overflow: hidden;
}

.selfstudyTokenModal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  isolation: isolate;
  display: grid;
  padding: 20px;
  place-items: center;
  pointer-events: auto;
}

/* The modal uses the native hidden attribute. Keep it hidden even though the
   visible state uses display:grid above; otherwise the close button only
   changes the attribute while the overlay remains rendered. */
.selfstudyTokenModal[hidden] {
  display: none !important;
}

.selfstudyTokenBackdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(19, 26, 43, .6);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.selfstudyTokenCard {
  position: relative;
  z-index: 2;
  width: min(440px, 100%);
  padding: 31px;
  text-align: center;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 34px 90px rgba(12, 21, 41, .3);
  pointer-events: auto;
}

.selfstudyTokenClose {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #657086;
  border: 1px solid #e0e5ed;
  border-radius: 50%;
  background: #f8fafc;
  font-size: 22px;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.selfstudyTokenVisual {
  position: relative;
  display: grid;
  width: 112px;
  height: 112px;
  margin: 4px auto 20px;
  place-items: center;
  color: #fff;
  border-radius: 34px;
  background: linear-gradient(145deg, #ffbf58, #ef654d);
  box-shadow: 0 20px 42px rgba(236, 98, 66, .28);
  transform: rotate(-5deg);
}

.selfstudyTokenVisual span { font-size: 42px; }
.selfstudyTokenVisual b {
  position: absolute;
  right: -10px;
  bottom: -9px;
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  color: #c35231;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #fff1db;
}

.selfstudyTokenKicker {
  margin: 0 0 8px;
  color: #e86448;
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 1.5px;
}

.selfstudyTokenCard h2 {
  margin: 0;
  color: #172136;
  font-size: 31px;
}

.selfstudyTokenCard > p:not(.selfstudyTokenKicker) {
  margin: 11px 0 17px;
  color: #68738a;
  line-height: 1.6;
}

.selfstudyTokenReset {
  padding: 11px 13px;
  color: #806748;
  border-radius: 13px;
  background: #fff7e8;
  font-size: 11px;
}

.selfstudyTokenUpgrade {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  margin-top: 18px;
  padding: 0 18px;
  color: #fff;
  text-decoration: none;
  border-radius: 15px;
  background: linear-gradient(135deg, #355ff4, #752be2);
  box-shadow: 0 14px 30px rgba(77, 73, 226, .25);
  font-size: 13px;
  font-weight: 900;
}

@media (max-width: 1450px) {
  .topTokenText small { display: none; }
  .topTokenButton { min-height: 40px; padding: 5px 8px; }
  .topTokenIcon { width: 27px; height: 27px; }
}

@media (max-width: 1180px) {
  .topTokenText { display: none; }
  .topTokenButton { border-radius: 50%; }
}
