.portal-account { width: min(960px,100%); margin: 0 auto; padding-bottom: 16px; }
.portal-account-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.portal-account-grid > section { display: grid; min-width: 0; }
.portal-account-loading { padding: 24px 18px; border: 1px solid var(--apple-line); border-radius: 18px; background: #fff; color: #86868b; font-size: 13px; }
.portal-account-grid .portal-empty { min-height: 180px; padding: 24px 18px; border: 1px solid var(--apple-line); border-radius: 18px; background: #fff; }
.portal-account-form { margin: 0; }
.portal-settings-group { margin: 0; overflow: hidden; background: #fff; box-shadow: 0 5px 18px #24304104; }
.portal-settings-group > .portal-account-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; margin: 0; padding: 10px 20px; border: 0; background: transparent; }
.portal-settings-group > .portal-account-heading h2 { margin: 0; color: #242630; font-size: 16px; line-height: 1.35; font-weight: 650; }
.portal-recharge-card { display: flex; flex-direction: column; }
.portal-balance-main { flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; min-height: 100px; margin: 0 18px; padding: 20px; border-radius: 14px; background: linear-gradient(115deg,#edf2fb,#f6f8fc); }
.portal-balance-amount { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; min-width: 0; color: #202937; font-size: clamp(32px,3.6vw,48px); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.portal-balance-amount strong { min-width: 0; font: inherit; font-weight: 600; overflow-wrap: anywhere; }
.portal-balance-amount small { color: #606b7b; font-size: 13px; font-weight: 500; letter-spacing: 0; }
.portal-balance-main .user-create { border: 0; border-radius: 9px; background: #243145; color: white; padding: 9px 16px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.portal-balance-main .user-create:hover { background: #354766; }
.portal-price-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 20px; }
.portal-price-row { display: grid; gap: 4px; color: #626873; font-size: 12px; }
.portal-price-row + .portal-price-row { border-left: 1px solid #e3e5e9; padding-left: 20px; }
.portal-price-row strong { color: #272d38; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.portal-price-row small { display: inline-block; margin-left: 5px; font-size: 11px; color: #666b75; font-weight: 400; }
.portal-profile-group { overflow: hidden; }
.portal-settings-group .portal-profile-row { display: grid; grid-template-columns: 64px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 47px; margin: 0 18px; padding: 6px 0; border-top: 1px solid #edf0f4; font-size: 13px; color: #555b66; }

.portal-profile-value { min-width: 0; padding-left: 10px; color: #34373d; overflow-wrap: anywhere; }
.portal-profile-value:last-child { grid-column: 2 / -1; }
.portal-profile-row input { grid-column: 2 / -1; width: 100%; min-width: 0; height: 38px; min-height: 38px; padding: 8px 10px; border: 1px solid #dfe2e8; border-radius: 10px; background: #f7f8fa; color: #34373d; font: inherit; font-weight: 400; outline: none; }
.portal-profile-row input:focus { border-color: #84b9f5; box-shadow: 0 0 0 3px #007aff0c; background: #fff; }
.portal-profile-row .portal-text-button { white-space: nowrap; padding: 8px 0 8px 5px; }
.portal-ai-provider { width: min(48%,136px); }
.portal-ai-provider .apple-control-wrap, .portal-ai-provider select { width: 100%; }
.portal-ai-provider .apple-control-trigger { min-height: 34px; }
.portal-key-group .portal-field { grid-template-columns: 64px minmax(0,1fr); align-items: center; gap: 12px; margin: 0; padding: 14px 18px; border-top: 1px solid #edf0f4; font-weight: 400; }
.portal-key-status { display: inline-flex; align-items: center; gap: 6px; color: #626873; font-size: 12px; }
.portal-key-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #a5a8ad; }
.portal-key-status[data-saved="true"]::before { background: #259a62; }
.portal-account-form > .portal-form-error { margin: 12px 18px; }
.portal-account-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid #edf0f4; }
.portal-profile-code { display: grid; grid-template-columns: minmax(0,1fr) 110px; align-items: end; gap: 8px; margin-bottom: 14px; }
.portal-profile-code .portal-field { margin: 0; }
.portal-profile-code > button { min-height: 42px; padding: 0 8px; border: 0; border-radius: 10px; background: #edf3ff; color: #007aff; font: inherit; font-size: 12px; cursor: pointer; }
.portal-account .portal-save { width: auto; min-width: 64px; padding: 0 16px; margin: 0; min-height: 34px; cursor: pointer; border: 0; border-radius: 9px; background: #edf3fa; color: #145c9f; box-shadow: none; font-size: 13px; font-weight: 600; }
.portal-account .portal-save:hover:not(:disabled) { background: #dfebf8; }
.portal-account .portal-logout { display: block; width: auto; min-height: 40px; margin: 0; padding: 0; cursor: pointer; border: 0; border-radius: 10px; background: transparent; color: #ff3b30; font-size: 13px; font-weight: 500; }
.portal-payment-network { display: flex; justify-content: space-between; padding: 8px 0 18px; border-bottom: 1px solid #edf0f4; font-size: 13px; color: #858d9b; }
.portal-payment-network strong { color: #424955; font-weight: 500; }

.portal-checkout { text-align: center; }
.portal-checkout-head { display: grid; justify-items: center; gap: 5px; color: #8b929e; font-size: 11px; }
.portal-checkout-head strong { color: #34373d; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.portal-checkout-qr { width: 168px; height: 168px; margin: 10px auto; border: 1px solid #edf0f4; border-radius: 14px; background: white; overflow: hidden; display: grid; place-items: center; }
.portal-checkout-qr svg { display: block; width: 100%; height: 100%; shape-rendering: crispEdges; }
.portal-checkout-terminal { font-size: 20px; color: #8a94a3; }
.portal-checkout-label { font-size: 11px; color: #8b929e; }
.portal-checkout-amount { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 7px; margin-top: 5px; }
.portal-checkout-amount > strong { min-width: 0; font-size: 30px; font-weight: 600; letter-spacing: -.03em; color: #272d38; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.portal-checkout-amount > span { font-size: 11px; color: #8a94a3; }
.portal-checkout-hint { margin: 5px 0 12px; color: #8e97a5; font-size: 11px; }
.portal-checkout-payment { padding: 0 14px; text-align: left; border-radius: 14px; background: #f5f6f8; }
.portal-checkout-address { padding: 11px 0 10px; }
.portal-checkout-address > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: #858d9b; font-size: 11px; }
.portal-checkout-address textarea { display: block; width: 100%; min-width: 0; height: 35px; padding: 0; resize: none; border: 0; outline: none; background: none; color: #535e70; font: 12px/1.5 "SFMono-Regular",Consolas,monospace; overflow-wrap: anywhere; }
.portal-checkout-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 11px 0; font-size: 11px; color: #8a94a3; }
.portal-checkout-payment .portal-checkout-meta { border-top: 1px solid #e6e9ee; }
.portal-checkout-meta strong { font-weight: 500; color: #536174; }
.portal-checkout-meta code { min-width: 0; font-size: 10px; overflow-wrap: anywhere; color: #8a94a3; }
.portal-checkout-detection { margin: 8px 0; color: #8a94a3; font-size: 11px; }
.portal-checkout-detection:empty { display: none; }
.portal-checkout-details { margin: 0 0 10px; text-align: left; font-size: 11px; color: #8b929e; }
.portal-checkout-details summary { width: fit-content; margin: auto; padding: 3px 8px; cursor: pointer; }
.portal-checkout-details[open] summary { margin-bottom: 4px; }
.portal-checkout-details .portal-checkout-meta { border-top: 1px solid #edf0f4; }

@media (max-width:900px) {
.portal-account-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width:520px) {
.portal-balance-main { margin-inline: 15px; padding: 16px; }
.portal-settings-group .portal-profile-row { grid-template-columns: 64px minmax(0,1fr) auto; gap: 8px; margin-inline: 15px; padding: 7px 0; }
.portal-settings-group > .portal-account-heading { padding-inline: 15px; }
.portal-key-group .portal-field { grid-template-columns: 64px minmax(0,1fr); gap: 8px; padding: 14px 15px; }
}
