header { display: flex; align-items: center; gap: 10px; }
.lib-badge { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: #f1edff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }

main { grid-template-columns: minmax(0, 1fr); align-content: start; place-items: start center; padding-top: 12px; }
.gate-icon { display: block; width: 64px; height: 64px; border-radius: 16px; margin: 0 0 16px; box-shadow: 0 12px 28px rgba(80, 90, 255, .25); }
.resume-card { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 14px 16px; border-radius: 16px; background: #f1edff; border: 1px solid rgba(111, 76, 255, .25); }
.resume-card .app-icon { width: 44px; height: 44px; flex: none; }
.resume-card div { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; color: var(--muted); }
.resume-card b { display: block; color: var(--ink); font-size: 15px; }
.resume-card .btn { flex: none; padding: 11px 16px; font-size: 14px; }
@media (max-width: 520px) { .resume-card { flex-wrap: wrap; } .resume-card .btn { width: 100%; } }
.pc-link { margin: 14px 0 0; padding: 16px 18px; border-radius: 18px; background: #fff8e8; border: 1px solid #ffe3a8; color: #6b4500; font-size: 14.5px; line-height: 1.45; }
.pc-link > b { display: block; font-size: 17px; color: #4a3000; }
.pc-link p { margin: 8px 0 0; }
.pc-link .steps { margin: 12px 0; }
.pc-link .steps li { color: #4a3000; }
.pc-link-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.pc-link-actions .btn { padding: 11px 18px; font-size: 14.5px; }
.app-row.locked { opacity: .55; }
.pc-ack { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0 0; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--soft); color: var(--ink); font-size: 14.5px; line-height: 1.4; cursor: pointer; }
.pc-ack input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: #4b2fd6; }
.card.wide { min-width: 0; max-width: 100%; justify-self: center; }

.apps-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; }
.apps-head > div:first-child { min-width: 0; }
.apps-head h1 { margin: 6px 0 0; }
.head-side { flex: none; display: flex; align-items: stretch; gap: 8px; }
.account-id { appearance: none; font: inherit; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 2px; padding: 10px 14px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); transition: border-color .15s; }
.account-id.hidden { display: none; }
.account-id b { font-size: 18px; font-variant-numeric: tabular-nums; }
.account-id:hover, .account-id:focus-visible { border-color: rgba(111, 76, 255, .45); outline: none; }
.account-id.copied .balance-label { color: var(--accent); font-weight: 700; }
.balance { flex: none; text-align: right; padding: 10px 14px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); }
.balance-label { display: block; font-size: 12px; color: var(--muted); }
.balance b { font-size: 18px; }
button.balance { appearance: none; font: inherit; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; transition: border-color .15s, box-shadow .15s; }
button.balance:hover, button.balance:focus-visible { border-color: rgba(111, 76, 255, .45); box-shadow: 0 8px 20px rgba(111, 76, 255, .14); outline: none; }
.balance-add { font-size: 12px; font-weight: 700; color: var(--accent); }
.balance-add::before { content: '+ '; }
.topup-balance { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 18px; padding: 14px 16px; border-radius: 16px; background: var(--soft); border: 1px solid var(--line); }
.topup-balance span { color: var(--muted); font-size: 14px; }
.topup-balance b { font-size: 22px; }
.topup-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 8px 0 12px; }
.topup-options button { appearance: none; font: inherit; font-weight: 700; padding: 12px 0; border-radius: 14px; cursor: pointer; color: var(--ink); background: #fff; border: 1px solid var(--line); }
.topup-options button.is-active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 20px rgba(111, 76, 255, .28); }
#topupCustom { width: 100%; margin-bottom: 12px; font-size: 16px; }
.topup-total { display: flex; align-items: baseline; justify-content: space-between; padding: 4px 2px; }
.topup-total span { color: var(--muted); }
.topup-total b { font-size: 20px; }
.topup-promo { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.topup-promo-row { display: flex; gap: 8px; margin-top: 8px; }
.topup-promo-row .input { flex: 1; min-width: 0; font-size: 16px; text-transform: uppercase; }
.topup-promo-row .btn { flex: none; padding: 12px 16px; }

.apps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 18px; }
.app-row { min-width: 0; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px; border: 1px solid var(--line); background: #fff; }
.app-icon { flex: none; width: 52px; height: 52px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); object-fit: cover; }
.app-meta { flex: 1; min-width: 0; }
.app-meta b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 16px; line-height: 1.25; }
.app-meta span { display: block; font-size: 13px; color: var(--muted); }
.app-row .btn { flex: none; padding: 10px 18px; font-size: 15px; }
@media (max-width: 520px) {
    #appsView { padding: 24px 14px 20px; }
    .apps-head h1 { font-size: 23px; }
    .balance, .account-id { padding: 8px 12px; }
    .balance b, .account-id b { font-size: 16px; }
    .app-row { gap: 10px; padding: 10px; border-radius: 16px; }
    .app-icon { width: 44px; height: 44px; border-radius: 12px; }
    .app-meta b { font-size: 15px; }
    .app-meta span { font-size: 12px; }
    .app-row .btn { padding: 9px 13px; font-size: 14px; }
}
.app-progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 6px; }
.app-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-3)); transition: width .3s; }

.notice { margin: 16px 0 0; padding: 13px 16px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; background: #fff8e8; border: 1px solid #ffe3a8; color: #8a5a00; }
.notice b { color: #6b4500; }
.notice.soft { background: var(--soft); border-color: var(--line); color: var(--muted); font-size: 13.5px; }
.notice.soft b { color: var(--ink); }

.lib-tabs { margin: 18px 0 4px; }
.own-form { margin-top: 16px; }
.own-form .input { font-size: 16px; }
.own-title { margin: 14px 0 6px; font-size: 21px; letter-spacing: -.02em; }
.code-input { text-align: center; font: 700 28px/1 ui-monospace, "SF Mono", Consolas, monospace !important; letter-spacing: .3em; }
.own-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-top: 16px; padding: 10px 14px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); font-size: 14.5px; }
.own-head span { min-width: 0; overflow-wrap: anywhere; }
.own-head .link-btn { padding: 4px 0; }
.own-search { margin-top: 14px; font-size: 16px; }
.own-cats { display: flex; gap: 8px; margin: 12px -2px 0; padding: 2px 2px 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.own-cats::-webkit-scrollbar { display: none; }
.own-cat { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.own-cat span { font-size: 12px; font-weight: 700; color: var(--accent); background: #f1edff; border-radius: 999px; padding: 1px 7px; }
.own-cat.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.own-cat.active span { background: rgba(255, 255, 255, .22); color: #fff; }
.app-icon.letter.cat-banks { color: #fff; background: linear-gradient(135deg, #22c55e, #0f9f6e); }
.app-icon.letter.cat-messengers { color: #fff; background: linear-gradient(135deg, #38bdf8, #2563eb); }
.app-icon.letter.cat-vpn { color: #fff; background: linear-gradient(135deg, #475569, #0f172a); }
.app-icon.letter.cat-ai { color: #fff; background: linear-gradient(135deg, #a855f7, #6366f1); }
.app-icon.letter.cat-media { color: #fff; background: linear-gradient(135deg, #fb7185, #e11d48); }
.app-icon.letter.cat-shopping { color: #fff; background: linear-gradient(135deg, #fbbf24, #f97316); }
.app-icon.letter.cat-gov { color: #fff; background: linear-gradient(135deg, #60a5fa, #1d4ed8); }
.app-icon.letter.cat-games { color: #fff; background: linear-gradient(135deg, #34d399, #7c3aed); }
.app-meta .real-name { color: var(--accent); font-weight: 650; font-style: normal; }
.app-icon.letter { display: grid; place-items: center; font-size: 22px; font-weight: 800; color: var(--accent); background: linear-gradient(135deg, #f3efff, #ecf7ff); }
.own-group { display: flex; align-items: center; gap: 8px; margin: 20px 0 0; font-size: 17px; letter-spacing: -.01em; }
.own-group span, .own-more summary span { font-size: 13px; font-weight: 700; color: var(--accent); background: #f1edff; border-radius: 999px; padding: 2px 9px; }
.own-empty { margin: 10px 0 0; }
.notice.own-scan { margin: 12px 0 4px; background: #eef5ff; border-color: #cfe0ff; color: #23466e; font-size: 13.5px; }
.login-progress { margin-top: 12px; }
.login-progress .app-progress { height: 6px; margin-top: 0; }
.login-progress .hint { margin: 8px 0 0; }
.own-more { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.own-more summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 650; font-size: 16px; color: var(--ink); list-style: none; }
.own-more summary::-webkit-details-marker { display: none; }
.own-more summary::after { content: '▾'; margin-left: auto; color: var(--muted); transition: transform .15s; }
.own-more[open] summary::after { transform: rotate(180deg); }
.own-more .hint { margin: 8px 0 0; }
.lib-faq { margin-top: 26px; padding: 16px 18px 6px; border-radius: 18px; background: var(--soft); border: 1px solid var(--line); }
.lib-faq h3 { margin: 0 0 6px; font-size: 16px; letter-spacing: -.01em; }
.lib-faq details { border-top: 1px solid var(--line); }
.lib-faq details:first-of-type { border-top: 0; }
.lib-faq summary { display: flex; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; font-weight: 650; font-size: 15px; color: var(--ink); list-style: none; }
.lib-faq summary::-webkit-details-marker { display: none; }
.lib-faq summary::before { content: '+'; flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 700; color: var(--accent); background: #f1edff; }
.lib-faq details[open] summary::before { content: '−'; }
.lib-faq details p { margin: 0 0 12px 32px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.lib-faq > .hint { margin: 6px 0 10px; }
.gate-ways { margin: 14px 0 0; padding: 0 0 0 20px; display: grid; gap: 8px; text-align: left; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.gate-ways b { color: var(--ink); }
.hint.small { font-size: 13px; }
.hint.center { text-align: center; }

.modal-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; padding: 12px; background: rgba(20, 16, 48, .45); }
.modal-card { position: relative; width: min(480px, 100%); max-height: calc(100vh - 24px); overflow-y: auto; padding: 26px 22px 22px; border-radius: 24px; background: #fff; box-shadow: 0 30px 80px rgba(20, 16, 60, .35); }
@media (min-width: 640px) { .modal-overlay { align-items: center; } }
.modal-close { position: absolute; top: 10px; right: 12px; appearance: none; border: 0; background: transparent; font-size: 28px; line-height: 1; color: var(--muted); cursor: pointer; padding: 6px; }
.modal-card h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.02em; }
.modal-card p { margin: 0 0 12px; color: var(--muted); line-height: 1.45; }

.steps { margin: 14px 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: step; }
.steps li { position: relative; padding: 0 0 0 36px; line-height: 1.45; color: var(--ink); counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.steps small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

.secret { display: flex; justify-content: center; margin: 14px 0; padding: 14px; border-radius: 18px; background: linear-gradient(135deg, #f3efff, #ecf7ff); border: 1.5px dashed rgba(111, 76, 255, .38); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.secret canvas { display: block; max-width: 100%; pointer-events: none; }
.big-code { display: flex; justify-content: center; margin: 14px 0; font: 700 40px/1 ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: .18em; padding: 18px 12px; border-radius: 18px; color: #0d7d5d; background: #e9faf3; border: 1.5px solid #bdeedb; }
.dl { margin: 12px 0; padding: 12px 14px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); }
.dl-text { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.dl-bar { height: 8px; margin-top: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.dl-bar span { display: block; height: 100%; width: 2%; border-radius: inherit; background: linear-gradient(90deg, #6d4aff, #22b8ff); transition: width .6s ease; }
.dl-hint { margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.dl-cancel { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.dl-cancel p { margin: 0 0 6px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.app-meta .hidden-reason { color: #b26a00; font-weight: 600; font-style: normal; }
.own-hidden-note { margin: 10px 0 0; }
.confirm-box { margin-top: 14px; padding: 14px; border-radius: 14px; background: #fff8ec; border: 1px solid #f6d7a7; }
.confirm-box p { margin: 0 0 12px; line-height: 1.45; }
.confirm-box p small { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }
.confirm-box .modal-actions { margin-top: 0; }
.timer { text-align: center; font-size: 14px; color: var(--muted); }
.timer b { color: var(--ink); }
.waiting { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 12px 0; padding: 12px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); font-weight: 600; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line-strong); border-top-color: var(--accent); animation: lib-spin .8s linear infinite; }
@keyframes lib-spin { to { transform: rotate(360deg); } }
.modal-actions { display: grid; gap: 10px; margin-top: 14px; }
.link-btn { appearance: none; border: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 8px; text-align: center; }

.own-more-btn { display: flex; margin: 10px auto 4px; }
body .legal-footer { color: var(--muted); }
body .legal-footer button { color: var(--accent); }
.notice.ok { background: #e9f9ef; border: 1.5px solid #34c46a; color: #14532d; font-size: 15.5px; box-shadow: 0 6px 18px rgba(52, 196, 106, .18); }
.notice.ok b { display: block; margin-bottom: 4px; color: #0f7a35; font-size: 17px; }
