/* The authenticated workspace and its sign-in screen share the same control surfaces. */
#profilePage {
  --page:#f5f2f8; --surface:#ffffff; --soft:#efeaf5; --ink:#201527; --muted:#63566e;
  --line:#d7cddd; --action:#6524bc; --on-action:#fff; --link:#6721ab;
  --accent:#8d36ff; --error:#b72a40; --warn:#8e4019;
  width:min(1232px, calc(100% - 64px)); padding:clamp(28px,4vw,60px) 0 64px; color:var(--ink);
}
[data-theme="dark"] #profilePage {
  --page:#130d19; --surface:#211728; --soft:#30223b; --ink:#fbf2ff; --muted:#c6afcf;
  --line:#49364f; --action:#d8adff; --on-action:#22112b; --link:#d9b1ff; --accent:#c883ff; --error:#ffaaba; --warn:#ffb18d;
}
body.profile-mode { background:#f5f2f8 }
[data-theme="dark"] body.profile-mode { background:#130d19 }
#profilePage:not(.hidden) { display:block }
.cab-symbols { position:absolute; pointer-events:none; overflow:hidden }
.cab-icon { flex:none; width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; vertical-align:middle }
#profilePage button:has(.cab-icon) { display:inline-flex; align-items:center; justify-content:center; gap:8px }
#profilePage button:disabled { cursor:not-allowed }
#profilePage input:hover:not(:disabled), #profilePage select:hover:not(:disabled) { border-color:var(--muted) }
#profilePage input:focus-visible, #profilePage select:focus-visible { outline-offset:1px }
#profilePage :is(h1,h2,h3,p) { margin:0 }
#profilePage :is(input,textarea,select,button) { font-family:inherit }
#profilePage button { min-height:40px }
#profilePage :is(button,input,select,a,summary):focus-visible { outline:3px solid var(--link); outline-offset:3px }
#profilePage .hidden { display:none !important }
#profilePage .auth-panel:not(.hidden) {
  max-width:980px; margin:clamp(0px,3vw,40px) auto; padding:0; border-radius:26px;
  display:grid; grid-template-columns:1fr 1.07fr; overflow:hidden; box-shadow:0 24px 70px #3e17591b;
}
.cab-auth-art, #profilePage .cab-plan-hero {
  isolation:isolate; position:relative; overflow:hidden; color:#fff4ff;
  background:radial-gradient(ellipse at 114% 130%,#ff542b 0%,#d81c69 21%,transparent 49%),radial-gradient(ellipse at 67% -48%,#8d36ff 0,transparent 63%),linear-gradient(112deg,#170f1c 4%,#392058 68%,#6d1858);
}
.cab-auth-art::before, #profilePage .cab-plan-hero::before {
  content:""; position:absolute; z-index:-1; inset:0;
  background-image:linear-gradient(#f4baff13 1px, transparent 1px),linear-gradient(90deg,#f4baff13 1px, transparent 1px);
  background-size:32px 32px; mask-image:linear-gradient(100deg,transparent 12%,#000 85%);
}
.cab-auth-art { min-height:530px; padding:clamp(32px,5vw,66px) }
#profilePage .cab-auth-art h1 { font-size:clamp(3rem,5.9vw,5.5rem); letter-spacing:-.075em; line-height:.97; color:inherit }
#profilePage .cab-auth-art p { margin-top:1.35rem; max-width:22ch; font-size:1.1rem; line-height:1.5; color:#efd4ee }
.cab-circuit { width:160px; height:165px; position:absolute; right:9%; bottom:13%; pointer-events:none; display:block }
.cab-circuit i { display:grid; place-items:center; position:absolute; inset:12% 9% 12%;
  transform:rotate(-30deg) skew(23deg,3deg) scaleY(.79); border:1.5px solid #ef9bffb5; border-radius:20%;
  box-shadow:0 0 20px #f64cd02b,inset 0 0 18px #fabeff30; background:linear-gradient(130deg,#fccdff2e,#e922d033);
}
.cab-circuit i:first-child { translate:0 34%; opacity:.38 }
.cab-circuit i:nth-child(2) { translate:0 17%; opacity:.74 }
.cab-circuit i:last-child { background:linear-gradient(130deg,#fceaff72,#ed50bf55); border-color:#ffd5fc; box-shadow:0 0 30px #ff28bd5e }
.cab-circuit svg, .cab-circuit .icon { width:47%; height:47%; color:#fff0fd; stroke-width:1.4 }
.cab-auth-form { min-width:0; padding:clamp(28px,4vw,54px) }
#profilePage .cab-auth-form h2 { font-size:clamp(1.75rem,3vw,2.4rem); letter-spacing:-.055em; margin-bottom:22px }
#profilePage .auth-form { gap:14px }
#profilePage .auth-tabs { border:1px solid var(--line); background:var(--soft); border-radius:11px; padding:4px; gap:4px }
#profilePage .auth-tabs button { border-radius:8px; min-height:36px }
#profilePage .auth-tabs .active { color:var(--ink); background:var(--surface) }
#profilePage input, #profilePage select { background-color:var(--surface); color:var(--ink); border-color:var(--line) }
#profilePage .auth-divider { display:flex; align-items:center; gap:12px; color:var(--muted); font-size:.875rem }
#profilePage .auth-divider::after, #profilePage .auth-divider::before { content:""; flex:1; height:1px; background:var(--line) }
#profilePage .profile-dashboard:not(.hidden) { display:grid; grid-template-columns:212px minmax(0,1fr); align-items:start; gap:clamp(24px,3.8vw,60px); margin:0 }
.cab-sidebar { position:sticky; top:90px; min-width:0 }
.cab-identity { display:flex; align-items:center; gap:11px; border-bottom:1px solid var(--line); padding:0 0 24px }
.cab-avatar { width:45px; height:45px; flex:none; border-radius:15px; display:grid; place-items:center; background:#2e183b; color:#f3a5ff }
.cab-identity strong,.cab-identity small { display:block }
.cab-identity strong { font-size:1.03rem; font-weight:690; line-height:1.2 }
.cab-identity small { color:var(--muted); font-size:.85rem; margin-top:4px }
#profilePage .profile-tabs { display:grid; gap:5px; background:none; padding:18px 0; border:0 }
#profilePage .profile-tabs button, #profilePage #logoutButton {
  display:flex; justify-content:flex-start; align-items:center; text-align:left; gap:11px; padding:11px 14px;
  border:0; border-radius:10px; background:transparent; color:var(--muted); box-shadow:none; font-size:.96rem; font-weight:580;
}
#profilePage .profile-tabs button.active { background:#ecdbff; color:#511682 }
#profilePage .profile-tabs button[aria-pressed="true"] { font-weight:710; box-shadow:inset 3px 0 currentColor }
[data-theme="dark"] #profilePage .profile-tabs button.active { background:#3c2350; color:#efbdff }
#profilePage .profile-tabs svg, #profilePage #logoutButton svg { flex:none; width:19px; height:19px }
#profilePage .profile-tabs button:not(.active):hover, #profilePage #logoutButton:hover { background:var(--soft); color:var(--ink) }
#profilePage #logoutButton { margin-top:6px; border-top:1px solid var(--line); border-radius:0; width:100%; padding-top:18px }
.cab-workspace { min-width:0 }
.cab-page-header { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-bottom:24px }
.cab-page-header small { display:block; color:var(--muted); font-size:.92rem; margin-bottom:6px; font-weight:550 }
#profilePage .cab-page-header h1 { font-size:clamp(2rem,4.4vw,3.6rem); letter-spacing:-.067em; line-height:1.02 }
#profilePage .profile-overview { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-bottom:18px }
#profilePage .profile-overview .metric-tile { min-width:0; padding:15px 16px; border-radius:13px; border:1px solid var(--line); background:var(--surface); align-content:start; gap:4px }
#profilePage .metric-tile strong { font-size:clamp(1.06rem,1.8vw,1.5rem); letter-spacing:-.04em }
#profilePage .profile-overview small { line-height:1.35; color:var(--muted); font-size:.8rem }
#profilePage .balance-summary-row { gap:6px }
#profilePage .balance-topup-button { padding:2px 6px; min-height:26px; background:var(--soft); color:var(--link); font-size:.78rem }
#profilePage .balance-topup-button svg { width:13px; height:13px }
#profilePage .telegram-link-panel:not(.hidden):not(.telegram-linked) { margin-bottom:14px }
#profilePage .cab-plan { overflow:hidden; padding:0; border-radius:20px; background:var(--surface) }
#profilePage .cab-plan-hero {
  display:grid; grid-template-columns:1fr; justify-items:start; align-content:center; gap:5px; min-height:155px;
  padding:20px clamp(23px,3.1vw,38px); padding-right:min(30%,220px); margin:0;
}
#profilePage .cab-plan-hero::after { position:absolute; top:14px; right:16px; color:#f9d1ff; font-size:18px }
#profilePage .cab-plan .cab-plan-hero::after {
  content:""; width:9px; height:9px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor;
  transform:rotate(45deg); right:22px; top:22px;
}
#profilePage .cab-plan[open] .cab-plan-hero::after { transform:rotate(225deg); top:26px }
#profilePage .cab-plan-hero:focus-visible { outline:3px solid #ffd5fd; outline-offset:-5px }
.cab-plan-caption { font-size:.85rem; color:#f0cce9; font-weight:580 }
.cab-plan-name { font-size:clamp(1.8rem,3.4vw,2.9rem); letter-spacing:-.06em; line-height:1.03 }
#profilePage .cab-plan-hero .status-pill { margin:4px 0 0; border:1px solid #e3bafa6b; border-radius:30px; padding:3px 10px; background:#2c193b; color:#f5ddff; font-size:.82rem }
#profilePage .cab-plan-hero .status-pill.warn,#profilePage .cab-plan-hero .status-pill.err { background:#4c2036; color:#ffd6bc }
.cab-plan-hero .cab-circuit { width:105px; height:105px; right:12%; bottom:23% }
#profilePage .cab-plan .purchase-body { padding:20px clamp(18px,2.8vw,34px); gap:18px }
.cab-plan-terms { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,112px),1fr)); margin:0; gap:12px 10px }
.cab-plan-terms dt { color:var(--muted); font-size:.83rem; margin-bottom:3px }
.cab-plan-terms dd { color:var(--ink); margin:0; font-size:1.03rem; font-weight:640; line-height:1.35 }
#profilePage .cab-billing-meta { margin-top:-7px; color:var(--muted) }
#profilePage .cab-billing-meta:not(:has(span)) { display:none }
#profilePage .cab-billing-meta span { background:transparent; padding:0 }
#profilePage .cab-billing-meta .meta-warn { color:var(--warn) }
#profilePage .cab-dialog {
  width:min(440px,calc(100% - 32px)); max-height:calc(100svh - 32px); padding:clamp(22px,4vw,36px);
  color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:20px; box-shadow:0 24px 80px #18092385
}
#profilePage .cab-dialog::backdrop { background:#130a1bd4; backdrop-filter:blur(3px) }
.cab-dialog form { display:grid; gap:14px }
.cab-dialog h2 { font-size:clamp(1.55rem,4vw,2rem); letter-spacing:-.045em }
.cab-dialog p { color:var(--muted); line-height:1.6 }
.cab-dialog-icon { display:grid; place-items:center; width:44px; height:44px; border-radius:14px; background:var(--soft); color:var(--link) }
.cab-dialog-icon .cab-icon { width:21px; height:21px }
.cab-dialog-actions { margin-top:8px; display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px }
#profilePage .cab-dialog-actions button { min-height:44px }
#profilePage .secondary, #profilePage .telegram-auth-button { background:var(--soft); color:var(--ink) }
#profilePage .key-box .vpn-link { justify-content:space-between; padding-inline:15px; min-height:44px }
#profilePage .cab-disclosure>summary:hover { color:var(--ink) }
#profilePage .purchase-tools { padding:16px; background:var(--page); border-radius:12px }
#profilePage .purchase-tools .subscription-form { align-items:end; grid-template-columns:minmax(0,1fr) auto }
#profilePage .purchase-tools .action-row { gap:8px }
#profilePage .purchase-tools .danger-soft { color:var(--error); background:transparent; border:1px solid var(--line) }
#profilePage .delete-confirm { align-items:start; border:1px solid var(--line); background:var(--surface) }
#profilePage .delete-confirm>div:first-child { display:grid; gap:4px }
#profilePage .delete-confirm>div:first-child span { color:var(--muted); font-size:.92rem }
#profilePage .history-row:last-child,#profilePage .device-row:last-child { border-bottom:0 }
#profilePage .device-subscription-heading>div, #profilePage .history-row>div:first-child { display:grid; gap:4px }
@media(hover:hover) {
  #profilePage .secondary:hover,#profilePage .telegram-auth-button:hover,#profilePage .vpn-link:hover {
    background:color-mix(in srgb,var(--soft) 87%,var(--ink));
  }
  #profilePage :is(.copy-action,#authSubmit):hover { background:color-mix(in srgb,var(--action) 82%,var(--link)) }
  #profilePage .danger-soft:hover { background:color-mix(in srgb,var(--surface) 91%,var(--error)) }
}
#profilePage .purchase-meta { font-size:.86rem; gap:6px; color:var(--muted) }
#profilePage .purchase-meta span { background:var(--soft); border-radius:5px; padding:3px 8px }
#profilePage .key-box { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px 12px }
#profilePage .key-box>strong { grid-column:1/-1 }
#profilePage .key-actions { gap:6px }
#profilePage .key-actions .inline-action { color:var(--muted); background:transparent; font-size:.85rem }
#profilePage .vpn-link { background:var(--soft); border:1px solid var(--line); min-width:0 }
#profilePage .vpn-link-mask { display:inline-flex; align-items:center; gap:7px; font-size:.86rem }
#profilePage .vpn-link-mask .cab-icon { width:16px; height:16px; color:var(--link) }
#profilePage .vpn-link-host { font-size:.8rem; color:var(--muted) }
#profilePage .cab-disclosure { border-top:1px solid var(--line); padding-top:12px }
#profilePage .cab-disclosure>summary { display:flex; justify-content:flex-start; align-items:center; gap:9px; color:var(--muted); padding:9px 0; margin:0; font-size:.93rem; cursor:pointer }
#profilePage .cab-disclosure>summary::after { content:""; width:7px; height:7px; margin-left:auto; margin-right:4px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg) }
#profilePage .cab-disclosure[open]>summary::after { transform:rotate(225deg) }
#profilePage .cab-disclosure[open]>summary { color:var(--ink); margin-bottom:12px }
#profilePage .dashboard-card, #profilePage .trial-panel { border-radius:16px }
#profilePage .trial-panel h3, #profilePage .dashboard-card h3 { font-size:clamp(1.15rem,2.1vw,1.55rem); letter-spacing:-.035em }
#profilePage .device-row,.cab-workspace .history-row { gap:12px }
#profilePage .metric-tile small { line-height:1.4 }
@media(max-width:930px) {
  #profilePage { width:calc(100% - 40px) }
  #profilePage .profile-dashboard:not(.hidden) { grid-template-columns:170px minmax(0,1fr); gap:22px }
  #profilePage .key-box { grid-template-columns:1fr }
}
@media(max-width:730px) {
  #profilePage { width:calc(100% - 32px); padding-top:24px }
  #profilePage .auth-panel:not(.hidden), #profilePage .profile-dashboard:not(.hidden) { grid-template-columns:minmax(0,1fr); gap:0 }
  .cab-auth-art { min-height:175px; padding:26px; padding-right:115px }
  #profilePage .cab-auth-art h1 { font-size:2.5rem }
  #profilePage .cab-auth-art h1 br { display:none }
  #profilePage .cab-auth-art h1 br::after { content:" " }
  .cab-auth-art .cab-circuit { width:75px; height:75px; right:9%; bottom:26% }
  .cab-auth-form { padding:25px }
  .cab-sidebar { position:static; display:grid; grid-template-columns:1fr auto; align-items:center; margin-bottom:22px }
  .cab-identity { border:0; padding:0 }
  #profilePage #logoutButton { order:1; margin:0; padding:8px; font-size:.85rem; border:0 }
  #profilePage .profile-tabs { order:2; grid-column:1/-1; display:flex; flex-wrap:nowrap; overflow-x:auto; padding:12px 0 6px; gap:4px }
  #profilePage .profile-tabs button { flex:none; min-height:40px; padding:8px 10px; gap:6px; font-size:.88rem }
  #profilePage .profile-tabs button[aria-pressed="true"] { box-shadow:inset 0 -2px currentColor }
  #profilePage .profile-tabs svg { width:16px; height:16px }
  .cab-page-header { margin-bottom:16px }
  .cab-workspace { display:flex; flex-direction:column }
  .cab-workspace .profile-overview { order:2; margin-top:14px }
  .cab-workspace .telegram-link-panel { order:1; margin-top:14px }
  #profilePage .profile-overview { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:12px }
  #profilePage .profile-overview .account-summary-tile { grid-column:1/-1; display:flex; flex-wrap:wrap; align-items:center; gap:5px 10px; padding-block:8px }
  #profilePage .account-summary-tile strong { font-size:.94rem }
  .cab-plan-hero .cab-circuit { width:74px; height:74px; right:10%; bottom:27% }
  #profilePage .cab-plan-hero { min-height:127px }
  .cab-plan-terms { grid-template-columns:1fr 1fr; gap:12px }
  #profilePage .key-actions .copy-action { width:100% }
  #profilePage .purchase-tools .subscription-form { grid-template-columns:1fr }
  #profilePage .purchase-tools :is(button,input,select) { min-height:44px }
}
@media(prefers-reduced-motion:no-preference) {
  #profilePage .cab-plan-hero .cab-circuit { transition:transform .4s ease }
  #profilePage .cab-plan-hero:hover .cab-circuit { transform:translateY(-4px) }
}
