/* Payment sheet copied from the translator; safe-area names mapped to Studio. */
#studio-payment-root{--top:var(--tg-top,0px);--bot:var(--tg-bottom,0px);--l:var(--tg-left,0px);--r:var(--tg-right,0px)}
#studio-payment-root{color:#111;font:400 16px Inter,Arial,sans-serif;letter-spacing:normal}
#studio-payment-root button{text-transform:none;letter-spacing:normal}
#pay{position:fixed;inset:0;background:rgba(0,0,0,.35);display:none;align-items:flex-end;z-index:30}
#pay.on{display:flex}
#pay [hidden],#payframe [hidden]{display:none!important}
#pay .sheet{width:100%;max-height:85%;overflow:auto;background:#fff;border-radius:22px 22px 0 0;padding:20px calc(var(--r) + 20px) calc(var(--bot) + 12px) calc(var(--l) + 20px);outline:0}
#pay .sheet>div{max-width:420px;margin:0 auto}
#pay h3{margin:0 0 4px;font-size:19px;font-weight:500}
#pay .hd{display:flex;align-items:center;justify-content:space-between;gap:12px}
#pay .hd h3{flex:1;min-width:0}
#pay .sub{color:#888;font-size:14px;margin-bottom:10px}
#pay button{-webkit-appearance:none;appearance:none;font:inherit;color:inherit;cursor:pointer}
#pay button:disabled{cursor:default}
#pay button:focus-visible,#payframe button:focus-visible{outline:2px solid #4f46e5;outline-offset:2px}
#pay .pm{display:flex;align-items:center;gap:10px;width:100%;min-height:58px;padding:10px 12px;border:1px solid #e5e5e5;border-radius:14px;margin-top:8px;background:#fff;text-align:start}
#pay .pm[aria-checked=true]{border-color:#111;box-shadow:0 0 0 1px #111}
#pay .pm:disabled{opacity:.55}
#pay .icon{width:22px;height:22px;flex:none;color:#555}
#pay .pm .amount{font-size:14px;font-weight:500;flex:none;max-width:42%;overflow-wrap:anywhere;text-align:end}
#pay .pm .amount small{font-size:11px;font-weight:400;line-height:1.3}
#pay .pm .tx{min-width:0;flex:1}
#pay #pmeth>div{width:100%;min-width:0}
#pay .pm b{display:block;font-weight:500;font-size:16px}
#pay .pm small{display:block;color:#777;font-size:13px;margin-top:2px;overflow-wrap:anywhere}
#pay .curw{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;margin:6px 0 0;margin-inline-start:44px}
#pay .cur{display:flex;border:1px solid #ddd;border-radius:16px;overflow:hidden;flex:none}
#pay .cur button{border:0;background:#fff;min-width:56px;min-height:44px;padding:6px 14px;font-size:15px;color:#555}
#pay .cur button[aria-checked=true]{background:#111;color:#fff}
#pay .cur button:disabled{opacity:.55}

#pay #payaction{margin-top:16px}
#pay #payaction button{display:block;width:100%;min-height:48px;padding:12px 16px;border:0;border-radius:24px;background:#111;color:#fff;font-size:16px}
#pay #payaction button:disabled{opacity:.5}
#pay [aria-busy=true]{cursor:progress}
#pay .conf{border:1px solid #e5e5e5;border-radius:14px;background:#fafafa;padding:12px;margin:0 0 10px}
#pay .conf p{margin:0 0 8px;font-size:15px;line-height:1.4;overflow-wrap:anywhere}
#pay .conf p.sm{color:#777;font-size:13px}
#pay .conf button.go{display:block;width:100%;border:0;background:#111;color:#fff;border-radius:22px;padding:10px 16px;min-height:44px;font-size:15px;white-space:normal}
#pay .conf button.back{display:block;width:100%;border:0;background:none;color:#555;min-height:44px;padding:8px;font-size:15px;white-space:normal}
#pay .conf:focus{outline:0}
#pay #paystat{min-height:20px;margin-top:8px;color:#666;font-size:14px}
#pay #paystat.err{color:#b3261e}
#payframe{position:fixed;inset:0;background:#fff;display:none;flex-direction:column;z-index:40;padding-bottom:var(--bot)}
#payframe.on{display:flex}
#payframe .bar{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:6px 10px;padding:calc(var(--top) + 6px) calc(var(--r) + 12px) 6px calc(var(--l) + 12px)}
#payframe .bar button{display:inline-flex;align-items:center;gap:6px;border:0;background:none;font:inherit;font-size:15px;color:#444;cursor:pointer;min-height:44px;padding:6px 8px;text-align:start;max-width:100%}
#payframe .bar button i{font-style:normal;font-size:22px;line-height:1}
html[dir=rtl] #payframe .bar button i{transform:scaleX(-1)}
#payframe iframe{flex:1;border:0;width:100%}
#payframe .pfg{position:absolute;width:1px;height:1px;opacity:0;outline:0}
#sbp{flex:1;display:none;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:20px;text-align:center;overflow:auto}
#sbp.on{display:flex}
#sbp .amt{font-size:30px;font-weight:500}
#sbp img{width:200px;height:200px;max-width:100%;image-rendering:pixelated}
#sbp .go{border:0;background:#111;color:#fff;border-radius:22px;padding:14px 26px;min-height:44px;font:inherit;font-size:17px;cursor:pointer;max-width:100%;white-space:normal}
#sbp small{color:#777;font-size:13px}

#paysheet,#sbp{overscroll-behavior:contain;touch-action:pan-y}
#pay .conf button.back{box-shadow:none;border-radius:0;height:auto}

/* Only the new common amount/email fields. Existing method geometry is copied. */
#studio-payment-root #pay .topup-entry{display:flex;flex-direction:column;gap:18px;margin:0}
#studio-payment-root #pay .topup-field{display:flex;flex-direction:column;gap:9px;min-width:0;font:400 var(--text-size)/1.5 Inter,Arial,sans-serif;color:var(--dim)}
#studio-payment-root #pay .topup-field input{box-sizing:border-box;width:100%;min-width:0;min-height:48px;padding:13px 15px;border:0;border-radius:13px;background:var(--paper);box-shadow:var(--inset);color:var(--ink);font:400 18px/1.5 Inter,Arial,sans-serif}
#studio-payment-root #pay .topup-field input:focus,#studio-payment-root #pay .topup-field input:focus-visible{outline:none}
#studio-payment-root #pay .topup-email{margin:0 0 18px}
#studio-payment-root #pay .pm .amount{max-width:none;min-width:0}
#studio-payment-root #pay .pm .amount :is(span,small){white-space:normal;overflow-wrap:anywhere}

/* The selected method owns its amount. The common payment action stays below all methods. */
#studio-payment-root #pay .topup-expanded{padding:16px 0 5px}
#studio-payment-root #pay .topup-entry{gap:12px}
#studio-payment-root #pay .topup-amount-field input{font-size:16px;min-height:54px;transition:box-shadow .18s ease}
#studio-payment-root #pay .topup-amount-field input::placeholder{color:var(--faint);opacity:1;font-size:14px}
#studio-payment-root #pay .topup-amount-field input[aria-invalid=true]{box-shadow:var(--inset),inset 0 0 0 1px #b3261e}

#studio-payment-root #pay .topup-amount-field{position:relative}
#studio-payment-root #pay .topup-amount-field .topup-caption{position:absolute;inset-inline-start:15px;top:6px;font-size:11px;line-height:1.4;color:var(--faint);pointer-events:none;display:none}
#studio-payment-root #pay .topup-amount-field input:not(:placeholder-shown){padding-top:23px;padding-bottom:7px}
#studio-payment-root #pay .topup-amount-field input:not(:placeholder-shown)+.topup-caption{display:block}

#studio-payment-root #pay .topup-entry .cur button{min-height:44px;padding:10px}

/* In keyboard mode only the methods scroll; the common Pay footer stays visible. */
#studio-payment-root #pay.on{top:var(--pay-visible-top,0px);bottom:auto;height:var(--pay-visible-height,100%)}
#studio-payment-root #pay.with-keyboard .sheet{max-height:calc(var(--pay-visible-height) - 8px);overflow:hidden;display:flex;flex-direction:column;padding-bottom:12px}
#studio-payment-root #pay.with-keyboard .sheet>div{display:flex;flex-direction:column;min-height:0;max-height:inherit;width:100%}
#studio-payment-root #pay.with-keyboard #paylist{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;scroll-padding:8px}
#studio-payment-root #pay.with-keyboard #payaction{flex:none;padding-top:12px}
#studio-payment-root #pay.with-keyboard #paystat{flex:none;min-height:0;margin-top:6px}
#studio-payment-root #pay.with-keyboard #paystat:empty{display:none}
