.portal-account { --settings-inset: 16px; width: min(1080px,100%); margin-inline: auto; padding-bottom: 12px; container-type: inline-size; }
.portal-settings-nav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); width: min(224px,100%); margin: 0 auto 12px; }
.portal-account-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 12px; }
.portal-account-grid > section { min-width: 0; }
#settings-notifications { width: min(100%,530px); margin-inline: auto; }
.portal-account-grid .portal-empty { min-height: 88px; padding: 16px var(--settings-inset); border: 1px solid var(--apple-line); border-radius: 14px; background: #fff; }
.portal-account-form { margin: 0; }
.portal-settings-group { margin: 0; overflow: hidden; border-radius: 14px; background: #fff; box-shadow: 0 2px 9px #24304107; }
.portal-settings-group > .portal-account-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 49px; margin: 0; padding: 7px var(--settings-inset); 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-settings-group .portal-text-button { min-height: 30px; padding: 4px 8px; border-radius: 7px; color: #1261ad; font-size: 12px; white-space: nowrap; }
.portal-settings-group .portal-text-button:hover { background: #f0f5fb; }
.portal-settings-group :is([data-add-profile], [data-create-agent]) { background: #edf3fa; font-weight: 600; }
.portal-settings-group :is([data-add-profile], [data-create-agent]):hover { background: #dfebf8; }
.portal-recharge-card { display: flex; flex-direction: column; }
.portal-balance-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 2px var(--settings-inset) 12px; }
.portal-balance-amount { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; min-width: 0; color: #202937; font-size: clamp(28px,3.1vw,36px); line-height: 1.15; letter-spacing: -.035em; 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: 8px; background: #086cce; color: #fff; min-height: 34px; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.portal-balance-main .user-create:hover { background: #075bad; }
.portal-settings-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0 var(--settings-inset) 12px; padding: 9px 0; border-radius: 9px; background: #f5f7fa; }
.portal-settings-stats > div { min-width: 0; padding-inline: 12px; }
.portal-settings-stats > div + div { border-left: 1px solid #e1e5eb; }
.portal-settings-stats dt, .portal-settings-stats small { color: #5c6574; font-size: 12px; }
.portal-settings-stats dd { margin: 3px 0 0; color: #272d38; font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.portal-settings-stats strong { font-weight: 650; }
.portal-settings-stats small { display: inline-block; margin-left: 4px; font-size: 11px; }
.portal-settings-group .portal-profile-row { display: grid; grid-template-columns: 56px minmax(0,1fr) auto; align-items: center; gap: 8px; min-height: 40px; margin: 0 var(--settings-inset); padding: 4px 0; border-top: 1px solid #edf0f4; font-size: 13px; color: #555b66; }
.portal-settings-group .portal-profile-row > label { display: block; min-height: 0; margin: 0; padding: 0; border: 0; font: inherit; }

.portal-profile-value { min-width: 0; color: #34373d; overflow-wrap: anywhere; }
.portal-profile-value:last-child { grid-column: 2 / -1; }
.portal-profile-row input { width: 100%; min-width: 0; height: 33px; min-height: 33px; padding: 5px 8px; border: 1px solid #dfe2e8; border-radius: 8px; 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 { grid-column: 3; justify-self: end; }
.portal-ai-provider { color: #555b66; font-size: 13px; }
.portal-key-group .portal-field { grid-template-columns: 64px minmax(0,1fr); align-items: center; gap: 10px; margin: 0 var(--settings-inset); padding: 8px 0; 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: 8px var(--settings-inset); }
.portal-account-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px var(--settings-inset); border-top: 1px solid #edf0f4; }
.portal-profile-footer { justify-content: flex-end; padding-block: 3px; }
.portal-settings-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.portal-settings-actions .portal-settings-remove { color: #c4332b; }
.portal-settings-actions .portal-settings-remove:hover { background: #fff1f0; }
.portal-settings-empty { margin: 0 var(--settings-inset); padding: 10px 0 13px; color: #626873; border-top: 1px solid #edf0f4; font-size: 13px; }
.portal-notification-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; list-style: none; cursor: pointer; min-height: 40px; padding: 8px 0; margin: 0 var(--settings-inset); border-top: 1px solid #edf0f4; }
.portal-notification-details > summary::-webkit-details-marker { display: none; }
.portal-notification-details > summary [data-telegram-edit] { padding: 6px 8px; border-radius: 7px; color: #1261ad; background: #edf3fa; font-size: 12px; font-weight: 600; }
.portal-notification-details > summary:hover [data-telegram-edit] { background: #dfebf8; }
.portal-notification-details .portal-account-footer { justify-content: flex-end; }
.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; }
.user-modal-dialog:has(.portal-payment-create) { width: min(420px,100%); overflow: hidden; border: 1px solid rgba(255,255,255,.78); border-radius: 24px; background: #f7f8fb; box-shadow: 0 24px 70px rgba(20,28,46,.28); }
.user-modal-dialog:has(.portal-payment-create) > header.portal-dialog-close-only { height: 62px; min-height: 62px; gap: 0; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 0 14px; border-bottom: 1px solid #e5e8ee; background: rgba(255,255,255,.88); }
.user-modal-dialog:has(.portal-payment-create) > header.portal-dialog-close-only h2 { grid-column: 2; margin: 0; text-align: center; font-size: 17px; }
.user-modal-dialog:has(.portal-payment-create) > header.portal-dialog-close-only .portal-dialog-close { grid-column: 3; justify-self: end; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #6e737c; background: #eceef2; }
.user-modal-dialog:has(.portal-payment-create) > header.portal-dialog-close-only .portal-dialog-close svg { width: 20px; height: 20px; }
.user-modal-dialog:has(.portal-payment-create) form { max-height: calc(100dvh - 100px); overflow-y: auto; padding: 26px; }
.portal-payment-create > label { display: block; margin: 0 0 9px; color: #626b79; font-size: 12px; font-weight: 650; }
.portal-payment-amount { height: 54px; display: flex; align-items: center; overflow: hidden; border: 1px solid #e5e8ee; border-radius: 14px; background: #fff; }
.portal-payment-amount input { min-width: 0; height: 100%; flex: 1; padding: 0 15px; border: 0; outline: 0; background: transparent; font-size: 18px; font-weight: 650; }
.portal-payment-amount:focus-within { border-color: #84b9f5; }
.portal-payment-amount strong { padding-right: 15px; color: #272d38; font-size: 13px; }
.portal-payment-create > p:not(.portal-form-error) { margin: 9px 2px 18px; color: #626b79; font-size: 12px; }
.user-modal-dialog:has(.portal-payment-create) .portal-form-error { width: 100%; margin: 10px 0 0; }
.portal-recharge-submit { width: 100%; height: 42px; margin-top: 4px; border: 0; border-radius: 12px; background: linear-gradient(135deg,#087eff,#0876f3); color: #fff; font-size: 13px; font-weight: 750; box-shadow: 0 9px 20px rgba(8,126,255,.22); }
.portal-recharge-submit:hover:not(:disabled) { background: #076bd7; }
.portal-recharge-submit:disabled { opacity: .65; }
.portal-checkout { display: grid; justify-items: stretch; gap: 14px; }
.portal-checkout[hidden] { display: none; }
.portal-checkout-head { display: flex; align-items: center; gap: 8px; color: #626b79; font-size: 12px; }
.portal-checkout-head strong { color: #272d38; font-size: 13px; }
.portal-checkout-head time { margin-left: auto; color: #087eff; font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 750; }
.portal-checkout-pulse { width: 9px; height: 9px; border-radius: 50%; background: #087eff; box-shadow: 0 0 0 5px rgba(8,126,255,.11); animation: deposit-pulse 1.5s ease-in-out infinite; }
.portal-checkout-pulse.is-paid { background: #22b66d; box-shadow: 0 0 0 5px rgba(34,182,109,.12); animation: none; }
.portal-checkout-pulse:is(.is-expired,.is-cancelled) { background: #d82c23; box-shadow: 0 0 0 5px rgba(255,59,48,.1); animation: none; }
@keyframes deposit-pulse { 50% { box-shadow: 0 0 0 8px rgba(8,126,255,0); } }
.portal-checkout-qr { width: 190px; height: 190px; display: grid; place-items: center; justify-self: center; padding: 0; overflow: hidden; border: 1px solid #e5e8ee; border-radius: 20px; background: #fff; box-shadow: 0 9px 24px rgba(31,42,61,.07); transition: filter .2s ease,opacity .2s ease; }
.portal-checkout-qr svg { width: 100%; height: 100%; }
.portal-checkout-payment,.portal-checkout-address { padding: 13px 14px; border: 1px solid #e5e8ee; border-radius: 14px; background: #fff; }
.portal-checkout-payment > span,.portal-checkout-address span { color: #626b79; font-size: 11px; }
.portal-checkout-payment > div,.portal-checkout-address > div:last-child { min-width: 0; display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.portal-checkout-payment strong { flex: 1; color: #272d38; font-size: 22px; letter-spacing: -.35px; }
.portal-checkout-payment button,.portal-checkout-address button { height: 32px; padding: 0 11px; border: 0; border-radius: 9px; color: #087eff; background: #eaf3ff; font-size: 12px; font-weight: 750; }
.portal-checkout-address > div:first-child { display: flex; align-items: center; justify-content: space-between; }
.portal-checkout-address small { padding: 3px 7px; border-radius: 999px; color: #087eff; background: #eaf3ff; font-size: 10px; font-weight: 700; }
.portal-checkout-address textarea { height: 20px; min-width: 0; padding: 0; border: 0; background: none; resize: none; flex: 1; overflow: hidden; color: #272d38; text-overflow: ellipsis; white-space: nowrap; font-family: inherit; font-size: 12px; }
.portal-checkout-note { margin: 0; text-align: center; font-size: 12px; }
.portal-checkout-note[data-payment-hint] { display: grid; gap: 4px; padding: 11px 12px; border: 1px solid #ffd296; border-radius: 12px; background: #fff3e2; color: #924c06; }
.portal-checkout-note strong { font-size: 14px; font-weight: 750; }
.portal-checkout-alert { color: #a83a2e; }
.portal-checkout-cancel { height: 42px; border: 0; border-radius: 12px; color: #d82c23; background: rgba(255,59,48,.08); font-weight: 700; }
.portal-checkout-cancel:hover { background: rgba(255,59,48,.13); }
.portal-checkout-qr svg { display: block; shape-rendering: crispEdges; }
.portal-checkout-payment strong { min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.portal-checkout-payment button,.portal-checkout-address button { flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) {
.portal-checkout-pulse { animation: none; }
}
.portal-checkout-state { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 7px; border-radius: 6px; background: #edf0f4; color: #505968; font-size: 11px; font-weight: 650; white-space: nowrap; }
.portal-checkout-state.is-pending { background: #fff0dc; color: #884b05; }
.portal-checkout-state.is-completed { background: #e5f5ea; color: #216747; }
.portal-recharge-history .portal-table-area { min-height: 0; max-height: min(54dvh, 420px); }
.portal-recharge-history .portal-table { min-width: 0; }
.portal-recharge-history .portal-table th, .portal-recharge-history .portal-table td { padding: 7px 6px; }
.portal-recharge-history .portal-table th:first-child { width: 42%; }
.portal-recharge-history .portal-table th:nth-child(2) { width: 16%; }
.portal-recharge-history .portal-table th:last-child { width: 29%; text-align: left; }
.portal-recharge-history .portal-table td:last-child { font-size: 11px; text-align: left; overflow-wrap: anywhere; }
.portal-recharge-history td strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.portal-recharge-history td > code { display: block; font-size: 12px; white-space: normal; word-break: break-all; }
.portal-recharge-history td small { display: block; margin-top: 3px; color: #5c6574; font-size: 10px; }
.portal-recharge-history .portal-pagination { padding-inline: 6px; }

@media (max-width:740px) {
.portal-account-grid { grid-template-columns: minmax(0,1fr); }
}
@container (max-width:680px) {
.portal-account-grid { grid-template-columns: minmax(0,1fr); }
#settings-notifications { width: 100%; }
}
@media (max-width:520px) {
.portal-account { --settings-inset: 12px; }
.portal-settings-nav button { min-height: 38px; }
.portal-settings-stats > div { padding-inline: 9px; }
}
@media (max-width:600px) {
.portal-modal:has(.portal-payment-create) { align-items: flex-end; padding: 0; }
.user-modal-dialog:has(.portal-payment-create) { width: 100%; border-radius: 24px 24px 0 0; }
.user-modal-dialog:has(.portal-payment-create) form { padding-bottom: max(26px, env(safe-area-inset-bottom)); }
.portal-recharge-history .portal-table th, .portal-recharge-history .portal-table td { padding-inline: 4px; }
.portal-recharge-history .portal-table th:first-child { width: 30%; }
.portal-recharge-history .portal-table th:nth-child(2) { width: 20%; }
.portal-recharge-history .portal-table th:last-child { width: 29%; }
.portal-recharge-history .portal-checkout-state { padding-inline: 5px; }
}
