/* Token top-up: isolated from the generation form and existing payment screens. */
.studio-topup-launch,
.cinema-ready .studio-topup-launch {
  display: inline-flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid #8af0de;
  border-radius: 10px;
  background: linear-gradient(120deg, #80ead7, #4ed4c2);
  color: #082d28;
  box-shadow: 0 4px 18px #29bba71c;
  font: 650 13px/1.35 'Segoe UI', Arial, sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .16s ease, box-shadow .16s ease;
}
.studio-topup-launch:hover,
.cinema-ready .studio-topup-launch:hover {
  border-color: #aff7e9;
  background: #9af0df;
  color: #082d28;
  box-shadow: 0 4px 22px #29bba72b;
}
.studio-topup-dialog,
.cinema-ready .studio-topup-dialog {
  --topup-accent: #79e6d2;
  --topup-text: var(--text, #e8edf1);
  --topup-muted: var(--muted, #b3bec8);
  --topup-line: var(--stroke, #35414a);
  --topup-panel: var(--panel, #171f28);
  --topup-surface: var(--surface, #111922);
  box-sizing: border-box;
  width: min(720px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--topup-line);
  border-radius: 20px;
  background: var(--topup-panel);
  color: var(--topup-text);
  box-shadow: 0 24px 90px #0006;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  font: 14px/1.55 'Segoe UI', Arial, sans-serif;
}
[data-cinema-theme=daylight] .studio-topup-dialog { --topup-accent: #006c5f; }
.studio-topup-dialog::backdrop { background: #07111bc7; backdrop-filter: blur(5px); }
.studio-topup-dialog *, .studio-topup-dialog *::before, .studio-topup-dialog *::after { box-sizing: border-box; }
.studio-topup-dialog [hidden] { display: none !important; }
.studio-topup-dialog p { margin: 0; }
.studio-topup-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 25px 26px 21px;
  border-bottom: 1px solid var(--topup-line);
  background: var(--topup-panel);
}
.studio-topup-header > div { min-width: 0; }
.studio-topup-header h2 { margin: 0; font-size: clamp(23px, 4vw, 30px); line-height: 1.2; letter-spacing: -.7px; }
.studio-topup-header p { margin-top: 7px; color: var(--topup-muted); font-size: 13px; }
.studio-topup-dialog .studio-topup-close {
  display: inline-grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--topup-line);
  border-radius: 50%;
  background: var(--topup-surface);
  color: var(--topup-text);
  font: inherit;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}
.studio-topup-body { display: grid; gap: 20px; padding: 24px 26px 26px; }
.studio-topup-intro { color: var(--topup-muted); font-size: 14px; line-height: 1.65; }
.studio-topup-intro strong { color: var(--topup-text); font-weight: 600; }
.studio-topup-banks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.studio-topup-bank {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--topup-line);
  border-top: 3px solid var(--topup-accent);
  border-radius: 13px;
  background: var(--topup-surface);
}
.studio-topup-bank[data-bank=psb] { border-top-color: #e8925d; }
.studio-topup-bank[data-bank=alfa] { border-top-color: #ed7377; }
.studio-topup-bank-name { display: block; margin: 0 0 14px; color: var(--topup-text); font-size: 16px; font-weight: 650; }
.studio-topup-dialog .studio-topup-phone { display: block; margin: 0 0 14px; color: var(--topup-text); font-size: clamp(19px, 3vw, 23px); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.35px; white-space: nowrap; text-decoration: none; }
.studio-topup-dialog .studio-topup-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--topup-line);
  border-radius: 8px;
  background: var(--topup-panel);
  color: var(--topup-accent);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}
.studio-topup-bank > .studio-topup-copy { width: 100%; }
.studio-topup-dialog .studio-topup-copy:hover, .studio-topup-dialog .studio-topup-close:hover { border-color: var(--topup-accent); }
.studio-topup-qr { margin-top: 16px; border-top: 1px solid var(--topup-line); padding-top: 12px; }
.studio-topup-dialog .studio-topup-qr > summary { padding: 3px 0; color: var(--topup-muted); font-size: 12px; cursor: pointer; }
.studio-topup-dialog .studio-topup-qr[open] > summary { color: var(--topup-accent); }
.studio-topup-qr-image { display: block; width: min(160px, 100%); height: auto; aspect-ratio: 1; margin: 12px auto 8px; padding: 8px; border-radius: 9px; background: #fff; object-fit: contain; }
.studio-topup-qr p { color: var(--topup-muted); font-size: 11px; line-height: 1.5; }
.studio-topup-note { padding: 17px 18px; border: 1px solid var(--topup-line); border-left: 3px solid var(--topup-accent); border-radius: 10px; background: var(--topup-surface); }
.studio-topup-note > strong { display: block; margin-bottom: 5px; font-size: 14px; }
.studio-topup-note p { color: var(--topup-muted); font-size: 13px; }
.studio-topup-email-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.studio-topup-dialog .studio-topup-email { flex: 1 1 180px; min-width: 0; margin: 0; padding: 10px 12px; border: 1px solid var(--topup-line); border-radius: 7px; background: var(--topup-panel); color: var(--topup-text); font: 600 14px/1.5 'Segoe UI', Arial, sans-serif; overflow-wrap: anywhere; user-select: all; }
.studio-topup-email-row .studio-topup-copy { flex: 0 0 auto; }
.studio-topup-status { min-height: 20px; color: var(--topup-accent); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.studio-topup-links { display: flex; align-items: center; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; border-top: 1px solid var(--topup-line); padding-top: 16px; }
.studio-topup-dialog .studio-topup-link { color: var(--topup-muted); font-size: 12px; line-height: 1.6; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.studio-topup-dialog .studio-topup-link:hover { color: var(--topup-accent); }
.studio-topup-launch:focus-visible, .studio-topup-dialog :is(button, a, summary, input):focus-visible { outline: 3px solid #40c8b6; outline-offset: 3px; }
.studio-topup-dialog button:disabled { opacity: .55; cursor: default; }
@media (max-width: 620px) {
  .studio-topup-dialog, .cinema-ready .studio-topup-dialog { width: calc(100vw - 24px); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 16px; }
  .studio-topup-header { gap: 12px; padding: 20px 18px 17px; }
  .studio-topup-body { gap: 17px; padding: 18px; }
  .studio-topup-banks { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .studio-topup-bank { padding: 17px; }
  .studio-topup-bank-name { margin-bottom: 9px; }
  .studio-topup-dialog .studio-topup-phone { font-size: 23px; }
  .studio-topup-note { padding: 14px; }
  .studio-topup-email-row { gap: 8px; }
  .studio-topup-email-row .studio-topup-copy { flex: 1 1 auto; }
  .studio-topup-links { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .studio-topup-launch, .studio-topup-dialog, .studio-topup-dialog * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .studio-topup-dialog::backdrop { backdrop-filter: none; }
}

.studio-topup-page { margin: 0; padding: 24px 0; background: #111922; }
.studio-topup-page .studio-topup-dialog { max-height: none; }
.studio-topup-bank-selected { outline: 2px solid var(--topup-accent); outline-offset: 3px; }
.studio-topup-usdt { display: grid; gap: 12px; }
.studio-topup-dialog .studio-topup-address { width: 100%; resize: none; padding: 12px; border: 1px solid var(--topup-line); border-radius: 9px; background: var(--topup-panel); color: var(--topup-text); font: 14px/1.6 monospace; overflow-wrap: anywhere; }
.studio-topup-dialog input[readonly] { opacity: 1; color: var(--topup-text); }
.studio-topup-request { display: grid; gap: 14px; }
.studio-topup-request fieldset { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 18px; border: 1px solid var(--topup-line); border-radius: 13px; }
.studio-topup-request legend { padding: 0 8px; font-size: 19px; font-weight: 650; }
.studio-topup-request input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--topup-line); border-radius: 9px; background: var(--topup-surface); color: var(--topup-text); font: inherit; }
.studio-topup-submit { min-height: 48px; padding: 12px 18px; border: 1px solid var(--topup-accent); border-radius: 10px; background: var(--topup-accent); color: #082d28; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
.studio-topup-history { display: grid; gap: 12px; }
.studio-topup-history h3 { margin: 0; font-size: 18px; }
.studio-topup-request-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 0; border-bottom: 1px solid var(--topup-line); overflow-wrap: anywhere; }
.studio-topup-request-row time,.studio-topup-request-row p { grid-column: 1/-1; color: var(--topup-muted); font-size: 12px; }
.studio-topup-bank-options { padding-top: 18px; border-top: 1px solid var(--topup-line); }
.studio-topup-bank-options > summary { cursor: pointer; color: var(--topup-muted); }
.studio-topup-bank-options[open] { display: grid; gap: 16px; }
.studio-invitation-link { overflow-wrap: anywhere; width: 100%; min-height: 48px; padding: 12px; border: 1px solid var(--topup-line); border-radius: 9px; background: var(--topup-surface); color: var(--topup-text); font: inherit; }
.studio-invitation-stats { display: flex; flex-wrap: wrap; gap: 12px; color: var(--topup-muted); }
.studio-invitation-launch { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 15px; border: 1px solid var(--stroke, #48535e); border-radius: 10px; background: transparent; color: var(--text, #e8edf1); font: inherit; font-size: 13px; cursor: pointer; }
.cinema-top header > .studio-topup-launch { flex: 0 0 auto; min-height: 42px; padding: 10px 18px; }
header.has-token-topup { flex-wrap: wrap; gap: 16px; }
header.has-token-topup > .studio-topup-launch { flex: 0 0 auto; }
.studio-topup-floating { position: fixed; z-index: 900; right: 18px; bottom: 18px; }
@media (max-width: 640px) {
  .cinema-top header > .studio-topup-launch { order: 4; flex: 1 0 100%; }
  header.has-token-topup > .studio-topup-launch { flex-basis: 100%; }
}
