/* Shared card flow header and the balance surface used on Home and Friends. */
.stan-currency-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.stan-transfer-max {
  min-width: 40px;
  min-height: 40px;
  padding-inline: 4px;
  border-radius: 9999px;
}
.stan-transfer-max:focus-visible {
  outline: 2px solid var(--stan-accent-text, #7be8a6);
  outline-offset: 2px;
}
@media (max-width: 350px) {
  .stan-currency-tools { gap: 4px; }
  .stan-transfer-max { min-width: 34px; }
}
:root body .cw .cw-purchase-limit { margin-block-start: 12px; }

:root body dialog.cw.cw-dialog.cw-issue-page {
  box-sizing: border-box;
  inset: 0;
  width: min(100%, 460px);
  max-width: 460px;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  padding: max(16px, env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px)) 20px max(24px, env(safe-area-inset-bottom), var(--tg-content-safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #0b2c23, #061912 72%);
  color: var(--stan-text, #eaf7ef);
  overscroll-behavior: contain;
}
:root body dialog.cw.cw-dialog.cw-issue-page > .cw-page-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 0;
  margin: 0 0 20px;
  border: 0;
  background: transparent;
}
:root body dialog.cw.cw-dialog.cw-issue-page > .cw-page-heading > h2 {
  margin: 0;
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
}
:root body .cw-issue-page .cw-page-back {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--stan-border, #1e3a30);
  border-radius: 9999px;
  background: var(--stan-surface, #0b1f18);
  color: var(--stan-text, #eaf7ef);
}
:root body .cw-issue-page .cw-page-back > .cw-button-label { display: none; }
:root body .cw-issue-page .cw-page-back > svg { width: 20px; height: 20px; }
:root body .cw-issue-page .cw-choice-card {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 0;
}
:root body .cw-issue-page .cw-issue-face {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-height: 0;
  aspect-ratio: 1.586;
}
:root body .cw-issue-page .cw-body > .cw-issue-face { margin-block-end: 20px; }
@media (max-width: 360px) {
  :root body dialog.cw.cw-dialog.cw-issue-page { padding-inline: 16px; }
  :root body dialog.cw.cw-dialog.cw-issue-page > .cw-page-heading > h2 { font-size: 22px; }
}

:root body .stan-balance.stan-balance-lustre {
  isolation: isolate;
  background:
    radial-gradient(ellipse 66% 115% at 96% 0%, rgb(123 232 166 / 8%), rgb(61 220 132 / 2%) 53%, transparent 76%),
    linear-gradient(148deg, #14392e 0%, #0c271f 53%, #071e18 100%);
}
:root body .stan-balance-lustre::after {
  content: "";
  position: absolute;
  inset: -55% auto -55% 0;
  z-index: -1;
  width: 58%;
  pointer-events: none;
  opacity: 0;
  /* The highlight uses one continuous opacity curve. The layer edges stay off the card. */
  background: linear-gradient(90deg,
      rgb(176 242 207 / 0.0000) 0%,
      rgb(176 242 207 / 0.0002) 4%,
      rgb(176 242 207 / 0.0010) 8%,
      rgb(176 242 207 / 0.0029) 12%,
      rgb(176 242 207 / 0.0066) 16%,
      rgb(176 242 207 / 0.0133) 20%,
      rgb(176 242 207 / 0.0241) 24%,
      rgb(176 242 207 / 0.0405) 28%,
      rgb(176 242 207 / 0.0632) 32%,
      rgb(176 242 207 / 0.0915) 36%,
      rgb(176 242 207 / 0.1221) 40%,
      rgb(176 242 207 / 0.1495) 44%,
      rgb(176 242 207 / 0.1671) 48%,
      rgb(176 242 207 / 0.1698) 52%,
      rgb(176 242 207 / 0.1565) 56%,
      rgb(176 242 207 / 0.1305) 60%,
      rgb(176 242 207 / 0.0984) 64%,
      rgb(176 242 207 / 0.0669) 68%,
      rgb(176 242 207 / 0.0411) 72%,
      rgb(176 242 207 / 0.0227) 76%,
      rgb(176 242 207 / 0.0112) 80%,
      rgb(176 242 207 / 0.0049) 84%,
      rgb(176 242 207 / 0.0018) 88%,
      rgb(176 242 207 / 0.0005) 92%,
      rgb(176 242 207 / 0.0001) 96%,
      rgb(176 242 207 / 0.0000) 100%
  );
  transform: translate3d(-150%, 0, 0) skewX(-17deg);
}
@media (prefers-reduced-motion: no-preference) {
  :root body .stan-balance-lustre::after {
    animation: stan-balance-sheen 6.4s linear infinite;
    will-change: transform;
  }
}
@keyframes stan-balance-sheen {
  0% { opacity: 1; transform: translate3d(-150%, 0, 0) skewX(-17deg); }
  37% { opacity: 1; transform: translate3d(230%, 0, 0) skewX(-17deg); }
  37.1%, 100% { opacity: 0; transform: translate3d(230%, 0, 0) skewX(-17deg); }
}
