/* Кабинет в стиле /app: серый фон, белые скруглённые карточки; на широком экране профиль слева, остальное справа */
.acct-body { --a-bg: #f5f5f7; --a-card: #fff; --a-fill: rgba(120, 120, 128, .12); --a-sep: rgba(60, 60, 67, .14); --a-l2: rgba(60, 60, 67, .62); --a-l3: rgba(60, 60, 67, .3); --a-ease: cubic-bezier(.32, .72, 0, 1); background: var(--a-bg); }
html.theme-dark .acct-body { --a-bg: #000; --a-card: #1c1c1e; --a-fill: rgba(118, 118, 128, .24); --a-sep: rgba(84, 84, 88, .6); --a-l2: rgba(235, 235, 245, .6); --a-l3: rgba(235, 235, 245, .3); }
html:has(.acct-body) { background: #f5f5f7; }
html.theme-dark:has(.acct-body) { background: #000; }

/* шапка — та же, что в каталоге */
.ab-bar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--a-bg) 80%, transparent); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); border-bottom: .5px solid var(--a-sep); }
.ab-in { max-width: 1240px; margin: 0 auto; height: 64px; padding: 0 40px; display: flex; align-items: center; gap: 22px; }
.ab-brand { display: flex; align-items: center; gap: 8px; flex: none; }
.ab-brand .wm { font-size: 30px; }
.ab-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 19px; background: var(--a-fill); }
.ab-tabs a { height: 32px; padding: 0 16px; border-radius: 16px; display: grid; place-items: center; font-size: 15px; font-weight: 500; color: var(--a-l2); transition: color .2s, background .2s; }
.ab-tabs a:hover { color: var(--text); background: color-mix(in srgb, var(--a-card) 60%, transparent); }
.ab-sp { flex: 1; }
.ab-round.theme-toggle { width: 38px; height: 38px; border-radius: 19px; background: var(--a-fill); color: var(--a-l2); }
.ab-round.theme-toggle:hover { color: var(--text); background: rgba(120, 120, 128, .2); }
.ab-pill { flex: none; height: 38px; padding: 0 16px; border-radius: 19px; display: grid; place-items: center; font-size: 15px; font-weight: 600; color: var(--blue); background: rgba(0, 113, 227, .12); }
@media (max-width: 720px) {
  .ab-in { padding: 0 16px; gap: 12px; }
  .ab-tabs a:not(:first-child) { display: none; }
}

/* общее */
.acct [hidden] { display: none !important; }
.acct button.btn { border: 0; font-family: inherit; cursor: pointer; }
.acct { max-width: 1240px; margin: 0 auto; padding: 32px 40px 80px; min-height: calc(100vh - 160px); }
.acct h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.08; letter-spacing: -.035em; max-width: none; }
.acct .lead { font-size: 18px; }
.acct-loading { display: grid; place-items: center; padding: 120px 0; }
.acct-spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--a-fill); border-top-color: var(--blue); animation: acct-spin .8s linear infinite; }
@keyframes acct-spin { to { rotate: 360deg; } }
.acct-fine { margin-top: 12px; font-size: 14px; color: var(--a-l2); text-wrap: pretty; }
.acct-textbtn { margin-top: 14px; background: none; border: 0; padding: 0; font: inherit; font-size: 15px; color: var(--blue); cursor: pointer; }
.acct-textbtn:hover { text-decoration: underline; text-underline-offset: 3px; }
.acct-textbtn.danger { color: #ff3b30; }
.acct-a { color: var(--blue); }

/* вход и ожидание — карточка по центру */
.acct-card { max-width: 640px; margin: 24px auto 0; padding: 36px 40px 40px; border-radius: 28px; background: var(--a-card); }
.acct-mascot { width: 88px; height: auto; margin: 0 0 16px -6px; }
.acct-providers { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; max-width: 360px; }
.prov { height: 54px; border-radius: 27px; gap: 10px; }
.prov.tg { background: #2aabee; }
.prov.tg:hover { background: #229ed9; }
.prov.max, html.theme-dark .prov.max { background: linear-gradient(120deg, #18a7ff, #6b4cff 60%, #a83cff); }
.prov.max:hover { filter: brightness(1.06); }
.max-mark { border-radius: 6px; flex: none; }
.prov[disabled] { opacity: .6; pointer-events: none; }
.acct-note, .acct-err, .acct-warn, .acct-toast { margin-top: 18px; padding: 14px 16px; border-radius: 16px; font-size: 15px; line-height: 1.45; }
.acct-note { background: rgba(0, 113, 227, .1); color: var(--text); }
.acct-err { background: rgba(255, 59, 48, .1); color: #d70015; }
html.theme-dark .acct-err { color: #ff6961; }
.acct-warn { margin-top: 28px; background: var(--a-fill); color: var(--a-l2); }
.acct-toast { margin: 0 0 14px; background: rgba(52, 199, 89, .14); color: var(--text); display: flex; align-items: center; gap: 12px; }
.acct-toast .acct-apka { --apka-size: 44px; }
.acct-main > .acct-err { margin: 0 0 14px; }
.acct-steps { margin-top: 22px; counter-reset: s; display: grid; gap: 10px; }
.acct-steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; font-size: 17px; }
.acct-steps li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 14px; display: grid; place-items: center; background: rgba(0, 113, 227, .12); color: var(--blue); font: 700 15px/1 var(--display); }
.acct-wait { display: flex; gap: 40px; align-items: flex-start; justify-content: space-between; margin-top: 28px; flex-wrap: wrap; }
.acct-wait-main { flex: 1; min-width: 240px; }
.acct-code { font: 600 17px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .06em; color: var(--text); user-select: all; white-space: nowrap; }
.acct-qr { text-align: center; }
.acct-qr img { width: 176px; height: 176px; border-radius: 16px; background: #fff; padding: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); image-rendering: pixelated; }
.acct-qr figcaption { margin-top: 8px; font-size: 13px; color: var(--a-l2); max-width: 176px; }

/* кабинет */
.acct-grid { display: grid; gap: 16px; }
.acct-side, .acct-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.acct-box { border-radius: 26px; background: var(--a-card); padding: 20px 22px; }
.acct-bh { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.acct-bh h2 { font: 700 21px/1.2 var(--display); letter-spacing: -.022em; }
.acct-bh .link { font-size: 15px; }
.acct-head { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "ava . apka" "who who who"; align-items: center; row-gap: 13px; }
.acct-head .acct-ava { grid-area: ava; }
.acct-head .acct-apka-wave { grid-area: apka; }
.acct-head .acct-who { grid-area: who; }
.acct-ava { width: 64px; height: 64px; border-radius: 32px; flex: none; display: grid; place-items: center; background: linear-gradient(140deg, #5ac8fa, #0071e3); color: #fff; font: 700 26px/1 var(--display); box-shadow: 0 0 0 3px var(--a-card), 0 0 0 4.5px rgba(0, 113, 227, .35); }
.acct-ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.acct-who { flex: 1; min-width: 0; }
.acct-name { display: flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 6px; margin-left: -6px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .2s; }
.acct-name:hover, .acct-name[aria-expanded="true"] { background: var(--a-fill); }
.acct-name svg { flex: none; color: var(--a-l3); transition: color .2s; }
.acct-name:hover svg, .acct-name[aria-expanded="true"] svg { color: var(--blue); }
.acct-who h1 { font-size: 24px; line-height: 1.15; letter-spacing: -.03em; min-width: 0; overflow-wrap: break-word; hyphens: auto; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acct-who p { margin-top: 2px; font-size: 14px; color: var(--a-l2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-out { width: 100%; margin-top: 16px; height: 42px; border-radius: 14px; border: 0; background: var(--a-fill); color: #ff3b30; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .2s; }
.acct-out:hover { background: rgba(255, 59, 48, .12); }

/* В покое виден первый кадр полосы. Остальные пролистываются только в ответ на событие. */
.acct-apka { --apka-size: 56px; display: block; flex: none; width: var(--apka-size); height: var(--apka-size); overflow: hidden; }
.acct-apka img { width: calc(var(--apka-size) * 20); max-width: none; height: 100%; }
.acct-apka-wave { --apka-size: 52px; border: 0; border-radius: 8px; padding: 0; background: transparent; cursor: pointer; }
.acct-apka-wave:disabled { opacity: 1; cursor: default; }

.acct-nick { margin-top: 16px; padding-top: 16px; border-top: .5px solid var(--a-sep); animation: nick-in .35s var(--a-ease); }
@keyframes nick-in { from { opacity: 0; translate: 0 -6px; } }
.acct-nick .acct-textbtn { margin-top: 10px; font-size: 14px; }
.acct-nick label { display: block; font-size: 13px; font-weight: 600; color: var(--a-l2); margin-bottom: 8px; }
.acct-nick-row { display: flex; gap: 8px; }
.acct-nick input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border-radius: 12px; border: 0; background: var(--a-fill); color: var(--text); font: inherit; font-size: 16px; }
.acct-nick input:focus { outline: 3px solid rgba(0, 113, 227, .35); outline-offset: 0; background: var(--a-card); box-shadow: inset 0 0 0 1px var(--blue); }
.acct-nick .btn-sm { height: 42px; border-radius: 21px; padding: 0 16px; }
.acct-nick .acct-fine { margin-top: 8px; font-size: 13px; }

.acct-list li { position: relative; }
.acct-list li + li::before { content: ""; position: absolute; top: 0; left: 58px; right: 0; height: .5px; background: var(--a-sep); }
.acct-msgr { margin-top: 14px; padding-top: 4px; border-top: .5px solid var(--a-sep); }
.acct-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; min-height: 68px; }
.acct-icons { display: flex; flex: none; }
.acct-icons img, .acct-icons span { width: 44px; height: 44px; border-radius: 22.37%; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .1); background: #fff; object-fit: cover; }
.acct-icons span { display: grid; place-items: center; font-weight: 700; color: var(--a-l2); background: var(--a-fill); }
.acct-icons > * + * { margin-left: -14px; box-shadow: 0 0 0 2px var(--a-card); }
.acct-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acct-t b { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .2s; }
.acct-t small { font-size: 13px; color: var(--a-l2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-badge { flex: none; white-space: nowrap; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 12px; background: var(--a-fill); color: var(--a-l2); }
.acct-badge.g { background: rgba(52, 199, 89, .14); color: #248a3d; }
.acct-badge.o { background: rgba(255, 149, 0, .14); color: #c93400; }
html.theme-dark .acct-badge.g { background: rgba(48, 209, 88, .16); color: #30d158; }
html.theme-dark .acct-badge.o { color: #ff9f0a; }
.acct-dev { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--a-fill); color: var(--a-l2); }
.acct-dev.tg { background: #2aabee; color: #fff; }
.acct-row .acct-textbtn { margin: 0; flex: none; }
.acct-here, .acct-linked { flex: none; font-size: 13px; color: #248a3d; font-weight: 600; }
html.theme-dark .acct-here, html.theme-dark .acct-linked { color: #30d158; }

/* покупки — отдельные карточки, как на /app/purchases */
.acct-box [data-purchases] { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 8px; }
.acct-box [data-purchases] li::before { content: none; }
.acct-box [data-purchases] .acct-row { padding: 12px 14px; border-radius: 18px; background: var(--a-bg); transition: transform .3s var(--a-ease), box-shadow .3s var(--a-ease); }
html.theme-dark .acct-box [data-purchases] .acct-row { background: rgba(118, 118, 128, .14); }
.acct-box [data-purchases] .acct-row::after { content: ""; flex: none; width: 8px; height: 8px; margin: 0 4px 0 2px; border-right: 2px solid var(--a-l3); border-top: 2px solid var(--a-l3); rotate: 45deg; transition: translate .3s var(--a-ease); }
.acct-box [data-purchases] .acct-row:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -18px rgba(0, 0, 0, .3); }
.acct-box [data-purchases] .acct-row:hover::after { translate: 3px 0; }
.acct-box [data-purchases] .acct-icons > * + * { box-shadow: 0 0 0 2px var(--a-bg); }
.acct-empty { padding: 14px 0 4px; color: var(--a-l2); }
.acct-empty-apka { display: flex; align-items: center; gap: 12px; }
.acct-empty-apka .acct-apka { --apka-size: 64px; }

.acct-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0 2px; cursor: pointer; font-size: 16px; }
.acct-switch small { display: block; font-size: 13px; color: var(--a-l2); }
.acct-switch input { appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; border-radius: 16px; background: var(--a-fill); position: relative; cursor: pointer; transition: background .25s; }
.acct-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: translate .25s var(--a-ease); }
.acct-switch input:checked { background: #34c759; }
.acct-switch input:checked::after { translate: 20px 0; }
.acct-helpbox .acct-help { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.acct-help .acct-apka { --apka-size: 52px; }
.acct-help .acct-fine { margin-top: 0; }
.acct-support { margin-top: 14px; width: 100%; }

/* подвал */
.acct-body .footer { background: transparent; border-top: .5px solid var(--a-sep); }
.acct-body .footer .wrap { max-width: 1240px; padding-left: 40px; padding-right: 40px; }
@media (max-width: 720px) { .acct-body .footer .wrap { padding-left: 16px; padding-right: 16px; } }

/* широкий экран: профиль слева закреплён, справа покупки, устройства, уведомления */
@media (min-width: 1000px) {
  .acct-grid { grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
  .acct-side { position: sticky; top: 88px; }
  .acct-main .acct-box { padding: 22px 26px; }
}
@media (max-width: 999px) {
  .acct-grid { display: flex; flex-direction: column; }
  .acct-side { display: contents; }
  .acct-profile { order: 1; }
  .acct-main { order: 2; }
  .acct-helpbox { order: 3; }
}

@media (max-width: 720px) {
  .acct { padding: 20px 16px 64px; }
  .acct-card { padding: 28px 22px 30px; margin-top: 8px; }
  .acct-providers { max-width: none; }
  .acct-qr { display: none; }
  .acct-wait .btn { width: 100%; }
  .acct-head .acct-ava { width: 52px; height: 52px; }
  .acct-head .acct-apka-wave { --apka-size: 44px; }
  .acct-box [data-purchases] .acct-row::after { content: none; }
  .acct-box [data-purchases] .acct-row { padding: 10px 12px; gap: 12px; }
  .ab-pill { display: none; }
}
@media (pointer: coarse) { .acct-qr { display: none; } }
