/* =====================================================================
   Feature-specific styles: feed, posts, stories, profile, premium, shorts,
   messenger, calls, network, wallet, landing
   ===================================================================== */

/* ---------- Composer ---------- */
.composer { padding: 12px 16px; }
.composer-row { display: flex; gap: 10px; align-items: center; }
.composer-trigger { flex: 1; height: 42px; border-radius: var(--r-full); background: var(--c-surface-3); color: var(--c-text-2); text-align: left; padding: 0 16px; font-size: .97rem; transition: background var(--t-fast); }
.composer-trigger:hover { background: var(--c-border); }
.composer-actions { display: flex; gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--c-border); }
.composer-action { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; border-radius: var(--r-sm); color: var(--c-text-2); font-weight: 600; font-size: .9rem; }
.composer-action:hover { background: var(--c-surface-3); }
.composer-action .ico { width: 21px; height: 21px; }
.ca-photo .ico { color: #16A34A; } .ca-video .ico { color: #E11D48; } .ca-short .ico { color: #7C3AED; } .ca-poll .ico { color: #F59E0B; }
@media (max-width: 480px) { .composer-action span { display: none; } }

.composer-modal .composer-text { width: 100%; border: 0; resize: none; min-height: 120px; font-size: 1.1rem; background: transparent; line-height: 1.5; padding: 4px 0; }
.composer-modal .composer-text:focus { box-shadow: none; }
.composer-modal .composer-text.big { font-size: 1.45rem; font-weight: 600; }
.composer-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--c-border); border-radius: var(--r); padding: 6px 8px 6px 14px; margin-top: 12px; }
.composer-tools .tools { display: flex; gap: 2px; flex-wrap: wrap; }
.composer-tools .icon-btn { background: transparent; width: 38px; height: 38px; }
.composer-tools .icon-btn:hover { background: var(--c-surface-3); }
.audience-btn { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: var(--r-xs); background: var(--c-surface-3); font-size: .8rem; font-weight: 650; color: var(--c-text); }
.audience-btn .ico { width: 14px; height: 14px; }
.media-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 12px; }
.media-preview { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--c-surface-3); }
.media-preview img, .media-preview video { width: 100%; height: 100%; object-fit: cover; }
.media-preview .remove { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(15, 23, 42, .7); color: #fff; display: grid; place-items: center; }
.media-preview .progress { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .4); overflow: hidden; }
.media-preview .progress > i { display: block; height: 100%; width: 0; background: #fff; transition: width var(--t-fast); }
.bg-picker { display: flex; gap: 8px; margin-top: 10px; }
.bg-picker button { width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; }
.bg-picker button.active { border-color: var(--c-text); }
.poll-builder .poll-opt { display: flex; gap: 8px; margin-bottom: 8px; }
.premium-toggle { border-radius: var(--r); padding: 12px; margin-top: 12px; background: var(--g-premium-soft); border: 1px solid color-mix(in srgb, var(--c-premium) 25%, transparent); }

/* ---------- Text backgrounds ---------- */
.bg-sunset { background: linear-gradient(135deg, #F97316, #EC4899); }
.bg-ocean { background: linear-gradient(135deg, #0EA5E9, #6366F1); }
.bg-forest { background: linear-gradient(135deg, #10B981, #0D9488); }
.bg-night { background: linear-gradient(135deg, #1E293B, #4C1D95); }
.bg-berry { background: linear-gradient(135deg, #DB2777, #7C3AED); }
.bg-sun { background: linear-gradient(135deg, #F59E0B, #EF4444); }

/* ---------- Post card ---------- */
.post { overflow: hidden; }
.post + .post, .feed > * + * { margin-top: 16px; }
.post-context { display: flex; align-items: center; gap: 8px; padding: 10px 16px 0; font-size: .84rem; color: var(--c-text-2); font-weight: 600; }
.post-context .ico { width: 16px; height: 16px; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 6px; }
.post-head .meta { flex: 1; min-width: 0; }
.post-author { font-weight: 700; color: var(--c-text); }
.post-author:hover { text-decoration: underline; }
.post-sub { display: flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--c-text-2); flex-wrap: wrap; }
.post-sub a { color: inherit; }
.post-sub .ico { width: 13px; height: 13px; }
.post-body { padding: 4px 16px 10px; font-size: .98rem; word-wrap: break-word; overflow-wrap: anywhere; }
.post-body.is-collapsed { max-height: 9.5em; overflow: hidden; position: relative; }
.post-body.is-collapsed::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.5em; background: linear-gradient(transparent, var(--c-surface)); }
.see-more { font-weight: 650; color: var(--c-text-2); padding: 0 16px 8px; display: block; }
.post-body a.mention, .post-body a.hashtag { font-weight: 600; }
.post-text-bg { margin: 4px 0 10px; min-height: 260px; display: grid; place-items: center; padding: 30px; color: #fff; font-size: 1.6rem; font-weight: 700; text-align: center; line-height: 1.3; }
.post-location { color: var(--c-text-2); font-size: .85rem; padding: 0 16px 8px; display: flex; align-items: center; gap: 4px; }

.media-grid { display: grid; gap: 3px; background: var(--c-surface-3); cursor: pointer; }
.media-grid .mg-item { position: relative; overflow: hidden; background: var(--c-surface-3); }
.media-grid img, .media-grid video { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.media-grid .mg-item:hover img { transform: scale(1.02); }
.media-grid.n1 .mg-item { max-height: 640px; } .media-grid.n1 img { height: auto; max-height: 640px; object-fit: contain; background: #000; }
.media-grid.n2 { grid-template-columns: 1fr 1fr; } .media-grid.n2 .mg-item { aspect-ratio: 4/5; }
.media-grid.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 4/3; } .media-grid.n3 .mg-item:first-child { grid-row: span 2; }
.media-grid.n4 { grid-template-columns: 1fr 1fr; } .media-grid.n4 .mg-item { aspect-ratio: 1; }
.media-grid.n5 { grid-template-columns: repeat(6, 1fr); } .media-grid.n5 .mg-item { grid-column: span 2; aspect-ratio: 1; } .media-grid.n5 .mg-item:nth-child(-n+2) { grid-column: span 3; aspect-ratio: 4/3; }
.mg-more { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); color: #fff; font-size: 1.8rem; font-weight: 800; display: grid; place-items: center; }
.video-wrap { position: relative; background: #000; }
.video-wrap video { width: 100%; max-height: 680px; background: #000; }
.video-wrap .play-badge { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.video-wrap .play-badge span { width: 64px; height: 64px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; backdrop-filter: blur(4px); }
.video-duration { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .7); color: #fff; font-size: .75rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; }

/* locked premium media */
.locked { position: relative; overflow: hidden; background: #1E1B4B; }
.locked img.blur-img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.1); transform: scale(1.06); }
.locked-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; color: #fff; padding: 20px; background: linear-gradient(180deg, rgba(30, 27, 75, .25), rgba(30, 27, 75, .65)); }
.locked-overlay .lock-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .16); backdrop-filter: blur(6px); }
.locked-overlay strong { font-size: 1.05rem; }
.locked-overlay span { font-size: .88rem; opacity: .9; }
.locked.ratio { aspect-ratio: 4/5; max-height: 620px; width: 100%; }

.link-card { display: flex; flex-direction: column; margin: 0 16px 12px; border: 1px solid var(--c-border); border-radius: var(--r); overflow: hidden; color: var(--c-text); }
.link-card:hover { text-decoration: none; background: var(--c-surface-2); }
.link-card img { width: 100%; aspect-ratio: 1.91/1; object-fit: cover; background: var(--c-surface-3); }
.link-card .lc-body { padding: 10px 12px; }
.link-card .lc-site { font-size: .75rem; text-transform: uppercase; color: var(--c-text-2); letter-spacing: .03em; }
.link-card .lc-title { font-weight: 700; margin-top: 2px; }
.link-card .lc-desc { font-size: .85rem; color: var(--c-text-2); }
.embed-frame { position: relative; aspect-ratio: 16/9; background: #000; margin: 0 16px 12px; border-radius: var(--r); overflow: hidden; }
.embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.shared-post { margin: 0 16px 12px; border: 1px solid var(--c-border); border-radius: var(--r); overflow: hidden; }
.shared-post .post-head { padding-top: 10px; }

.poll { padding: 0 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.poll-option { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--c-border-strong); border-radius: var(--r-sm); font-weight: 600; overflow: hidden; text-align: left; width: 100%; }
.poll-option:hover { border-color: var(--c-primary); }
.poll-option .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c-primary-50); z-index: 0; transition: width .5s var(--ease); }
.poll-option > span { position: relative; z-index: 1; }
.poll-option.voted { border-color: var(--c-primary); }
.poll-meta { font-size: .82rem; color: var(--c-text-2); }

.post-stats { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; font-size: .86rem; color: var(--c-text-2); }
.post-stats button { color: var(--c-text-2); }
.post-stats button:hover { text-decoration: underline; }
.reaction-icons { display: inline-flex; align-items: center; gap: 6px; }
.reaction-icons .r { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; border: 2px solid var(--c-surface); margin-left: -6px; }
.reaction-icons .r:first-child { margin-left: 0; }
.r-like { background: var(--c-like); color: #fff; } .r-love { background: var(--c-love); color: #fff; }
.post-actions { display: flex; gap: 2px; margin: 0 12px; padding: 4px 0; border-top: 1px solid var(--c-border); }
.post-action { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; height: 40px; border-radius: var(--r-sm); color: var(--c-text-2); font-weight: 650; font-size: .9rem; position: relative; }
.post-action:hover { background: var(--c-surface-3); }
.post-action .ico { width: 20px; height: 20px; }
.post-action.liked { color: var(--c-like); }
.post-action.liked .ico { fill: currentColor; }
.post-action.loved { color: var(--c-love); }
.post-action.saved .ico, .icon-btn.saved .ico { fill: currentColor; }
.post-action.reposted { color: var(--c-success); }
.reaction-picker { position: absolute; bottom: calc(100% + 6px); left: 0; display: flex; gap: 4px; padding: 6px 8px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-full); box-shadow: var(--sh-3); z-index: 20; animation: pop var(--t) var(--ease); }
.reaction-picker button { font-size: 26px; width: 40px; height: 40px; border-radius: 50%; transition: transform var(--t-fast) var(--ease); }
.reaction-picker button:hover { transform: scale(1.3) translateY(-4px); }
@media (max-width: 480px) { .post-action span { display: none; } }
.post-sponsored-tag { font-size: .75rem; font-weight: 700; color: var(--c-text-2); }

/* ---------- Comments ---------- */
.comments { padding: 4px 16px 14px; border-top: 1px solid var(--c-border); }
.comment { display: flex; gap: 8px; margin-top: 10px; }
.comment-bubble { background: var(--c-surface-3); border-radius: 16px; padding: 8px 12px; display: inline-block; max-width: 100%; word-wrap: break-word; overflow-wrap: anywhere; }
.comment-bubble .author { font-weight: 700; font-size: .86rem; color: var(--c-text); }
.comment-bubble .text { font-size: .93rem; }
.comment-meta { display: flex; gap: 12px; padding: 3px 12px; font-size: .78rem; color: var(--c-text-2); font-weight: 650; }
.comment-meta button { color: inherit; font-weight: 700; }
.comment-meta button.liked { color: var(--c-primary); }
.replies { margin-left: 40px; }
.comment-form { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; }
.comment-input { flex: 1; position: relative; }
.comment-input textarea { width: 100%; min-height: 38px; max-height: 140px; padding: 9px 44px 9px 14px; border-radius: 20px; border: 1px solid transparent; background: var(--c-surface-3); resize: none; font-size: .93rem; line-height: 1.4; }
.comment-input textarea:focus { background: var(--c-surface); border-color: var(--c-primary); box-shadow: var(--ring); }
.comment-input .send { position: absolute; right: 4px; bottom: 4px; width: 32px; height: 30px; border-radius: 15px; color: var(--c-primary); display: grid; place-items: center; }
.comment-input .send:hover { background: var(--c-primary-50); }

/* ---------- Stories ---------- */
.stories-tray { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; scroll-snap-type: x mandatory; }
.stories-tray::-webkit-scrollbar { display: none; }
.story-tile { position: relative; flex: none; width: 112px; height: 190px; border-radius: var(--r-lg); overflow: hidden; background: var(--c-surface-3); box-shadow: var(--sh-1); scroll-snap-align: start; color: #fff; cursor: pointer; }
.story-tile img.bg { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.story-tile:hover img.bg { transform: scale(1.05); }
.story-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, transparent 30%, transparent 60%, rgba(0, 0, 0, .6) 100%); }
.story-tile .st-avatar { position: absolute; top: 10px; left: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--c-primary); object-fit: cover; }
.story-tile.seen .st-avatar { border-color: rgba(255, 255, 255, .6); }
.story-tile .st-name { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 2; font-size: .82rem; font-weight: 700; line-height: 1.2; text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.story-tile .st-text { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; font-weight: 700; font-size: .9rem; }
.story-tile.create { background: var(--c-surface); color: var(--c-text); }
.story-tile.create::after { display: none; }
.story-tile.create img.bg { height: 70%; }
.story-tile.create .plus { position: absolute; left: 50%; top: 70%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; background: var(--c-primary); color: #fff; display: grid; place-items: center; border: 4px solid var(--c-surface); z-index: 2; }
.story-tile.create .st-name { color: var(--c-text); text-shadow: none; text-align: center; }

.story-viewer { position: fixed; inset: 0; z-index: 450; background: #0B0F19; display: flex; align-items: center; justify-content: center; }
.sv-stage { position: relative; width: min(420px, 100vw); height: min(100vh, 760px); background: #000; border-radius: var(--r-lg); overflow: hidden; }
@media (max-width: 520px) { .sv-stage { height: 100vh; border-radius: 0; } }
.sv-stage img, .sv-stage video { width: 100%; height: 100%; object-fit: contain; }
.sv-text { position: absolute; inset: 0; display: grid; place-items: center; padding: 36px; text-align: center; color: #fff; font-size: 1.6rem; font-weight: 700; }
.sv-bars { position: absolute; top: calc(10px + var(--safe-t)); left: 10px; right: 10px; display: flex; gap: 4px; z-index: 3; }
.sv-bars i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.sv-bars i b { display: block; height: 100%; width: 0; background: #fff; }
.sv-head { position: absolute; top: calc(22px + var(--safe-t)); left: 12px; right: 12px; display: flex; align-items: center; gap: 10px; z-index: 3; color: #fff; }
.sv-head .name { font-weight: 700; font-size: .92rem; }
.sv-head .time { font-size: .8rem; opacity: .8; }
.sv-head button { color: #fff; }
.sv-nav { position: absolute; top: 0; bottom: 80px; width: 35%; z-index: 2; }
.sv-nav.prev { left: 0; } .sv-nav.next { right: 0; }
.sv-foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 12px calc(14px + var(--safe-b)); z-index: 3; display: flex; gap: 8px; align-items: center; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.sv-foot input { flex: 1; height: 42px; border-radius: 21px; border: 1px solid rgba(255, 255, 255, .5); background: transparent; color: #fff; padding: 0 16px; }
.sv-foot input::placeholder { color: rgba(255, 255, 255, .8); }
.sv-foot .react { font-size: 24px; }
.sv-link { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 3; background: #fff; color: #111; font-weight: 700; padding: 8px 16px; border-radius: var(--r-full); display: inline-flex; gap: 6px; align-items: center; }
.sv-close-desktop { position: absolute; top: 20px; right: 24px; color: #fff; z-index: 5; }

/* ---------- Right rail widgets ---------- */
.widget { padding: 14px 16px; }
.widget h3 { font-size: .98rem; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.widget h3 a { font-size: .82rem; font-weight: 600; }
.trend { display: block; padding: 8px 0; color: var(--c-text); }
.trend:hover { text-decoration: none; }
.trend .tag { font-weight: 700; }
.trend .count { display: block; font-size: .8rem; color: var(--c-text-2); }
.contact-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r-sm); color: var(--c-text); font-weight: 600; font-size: .92rem; }
.contact-row:hover { background: var(--c-surface-3); text-decoration: none; }

/* ---------- Profile ---------- */
.profile-hero { overflow: hidden; }
.profile-cover { position: relative; height: 340px; background: var(--g-brand); }
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-cover .edit-cover { position: absolute; right: 16px; bottom: 16px; }
.profile-main { position: relative; display: flex; align-items: flex-end; gap: 20px; padding: 0 24px 16px; margin-top: -70px; flex-wrap: wrap; }
.profile-avatar { position: relative; flex: none; }
.profile-avatar .avatar { width: 168px; height: 168px; border: 5px solid var(--c-surface); box-shadow: var(--sh-2); }
.profile-avatar .edit-avatar { position: absolute; right: 8px; bottom: 8px; width: 38px; height: 38px; border-radius: 50%; background: var(--c-surface-3); display: grid; place-items: center; border: 2px solid var(--c-surface); }
.profile-id { flex: 1; min-width: 220px; padding-bottom: 6px; }
.profile-id h1 { font-size: 1.85rem; margin: 0 0 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.profile-id .handle { color: var(--c-text-2); font-weight: 500; }
.profile-counts { display: flex; gap: 16px; margin-top: 6px; font-size: .93rem; color: var(--c-text-2); flex-wrap: wrap; }
.profile-counts b { color: var(--c-text); }
.profile-counts a { color: inherit; } .profile-counts a:hover b { text-decoration: underline; }
.profile-buttons { display: flex; gap: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.profile-bio { padding: 0 24px 12px; max-width: 760px; }
.profile-tabs { padding: 0 16px; }
.about-list { list-style: none; padding: 0; margin: 0; }
.about-list li { display: flex; gap: 12px; align-items: center; padding: 9px 0; color: var(--c-text); }
.about-list .ico { color: var(--c-text-2); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: var(--r); overflow: hidden; }
.photo-grid a, .photo-grid .pg-item { position: relative; aspect-ratio: 1; background: var(--c-surface-3); overflow: hidden; display: block; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid .pg-badge { position: absolute; top: 6px; right: 6px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.photo-grid .pg-views { position: absolute; left: 8px; bottom: 6px; color: #fff; font-size: .8rem; font-weight: 700; display: flex; gap: 4px; align-items: center; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.shorts-grid { grid-template-columns: repeat(4, 1fr); } .shorts-grid a { aspect-ratio: 9/16; }
@media (max-width: 900px) {
  .profile-cover { height: 200px; }
  .profile-main { margin-top: -56px; padding: 0 14px 12px; gap: 12px; flex-direction: column; align-items: center; text-align: center; }
  .profile-avatar .avatar { width: 132px; height: 132px; }
  .profile-id h1 { justify-content: center; font-size: 1.5rem; }
  .profile-counts { justify-content: center; }
  .profile-buttons { justify-content: center; width: 100%; }
  .profile-buttons .btn { flex: 1; }
  .profile-bio { padding: 0 16px 12px; text-align: center; margin: 0 auto; }
  .shorts-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Premium / Personal Profile ---------- */
.premium-hero { position: relative; overflow: hidden; border: 0; color: #fff; background: #1E1B4B; }
.premium-hero .ph-cover { height: 220px; position: relative; }
.premium-hero .ph-cover img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.premium-hero .ph-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(124, 58, 237, .25), #1E1B4B 95%); }
.premium-hero .ph-body { position: relative; padding: 0 24px 24px; margin-top: -84px; display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; }
.premium-hero .avatar { width: 128px; height: 128px; border: 4px solid #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.premium-hero h1 { color: #fff; margin: 0; font-size: 1.7rem; }
.premium-hero .muted { color: rgba(255, 255, 255, .75); }
.premium-label { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-full); background: rgba(255, 255, 255, .14); font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.premium-stats { display: flex; gap: 22px; margin-top: 8px; }
.premium-stats b { display: block; font-size: 1.2rem; }
.premium-stats span { font-size: .82rem; color: rgba(255, 255, 255, .75); }
.plans { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.plan { position: relative; border: 1.5px solid var(--c-border-strong); border-radius: var(--r-lg); padding: 16px; background: var(--c-surface); display: flex; flex-direction: column; gap: 6px; transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast); }
.plan:hover { border-color: var(--c-premium); transform: translateY(-2px); box-shadow: var(--sh-2); }
.plan .plan-dur { font-weight: 700; color: var(--c-text-2); font-size: .88rem; }
.plan .plan-price { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.plan .plan-per { font-size: .8rem; color: var(--c-text-2); }
.plan.best { border-color: var(--c-premium); background: var(--g-premium-soft); }
.plan.best::before { content: "Best value"; position: absolute; top: -10px; right: 12px; background: var(--g-premium); color: #fff; font-size: .7rem; font-weight: 800; padding: 3px 9px; border-radius: var(--r-full); }
.premium-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.premium-grid .pg-cell { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: #2E1065; cursor: pointer; }
.premium-grid .pg-cell img { width: 100%; height: 100%; object-fit: cover; }
.premium-grid .pg-cell .pg-lock { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(46, 16, 101, .25); }
.premium-grid .pg-cell .pg-price { position: absolute; left: 6px; bottom: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .75rem; font-weight: 800; padding: 2px 7px; border-radius: var(--r-full); }
.premium-grid .pg-cell .pg-type { position: absolute; top: 6px; right: 6px; color: #fff; }
.package-card { display: flex; flex-direction: column; overflow: hidden; }
.package-card .pk-cover { aspect-ratio: 16/9; background: var(--g-premium); position: relative; }
.package-card .pk-cover img { width: 100%; height: 100%; object-fit: cover; }
.package-card .pk-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.premium-zone { background: var(--g-premium-soft); border-color: color-mix(in srgb, var(--c-premium) 22%, var(--c-border)); }
.text-premium { color: var(--c-premium); }

/* ---------- Shorts ---------- */
.shorts-page { position: fixed; inset: 0; z-index: 40; background: #000; }
.shorts-feed { height: 100%; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.shorts-feed::-webkit-scrollbar { display: none; }
.short { position: relative; height: 100vh; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; }
.short video { height: 100%; width: 100%; max-width: 56.25vh; object-fit: cover; background: #000; }
@media (max-width: 600px) { .short video { max-width: 100%; } }
.short-info { position: absolute; left: 0; right: 76px; bottom: 0; padding: 16px 16px calc(24px + var(--safe-b)); color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); }
@media (min-width: 601px) { .short-info { left: calc(50% - 28.125vh); right: calc(50% - 28.125vh + 76px); } }
.short-info .who { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.short-info .who a { color: #fff; }
.short-info .caption { margin-top: 8px; font-size: .93rem; line-height: 1.4; }
.short-info .caption a { color: #fff; font-weight: 700; }
.short-rail { position: absolute; right: 10px; bottom: calc(90px + var(--safe-b)); display: flex; flex-direction: column; gap: 18px; align-items: center; color: #fff; }
@media (min-width: 601px) { .short-rail { right: calc(50% - 28.125vh - 72px); } }
.short-rail button, .short-rail a { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff; font-size: .78rem; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.short-rail .rb { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .14); backdrop-filter: blur(6px); }
.short-rail .rb .ico { width: 26px; height: 26px; }
.short-rail .liked .rb { color: #F43F5E; } .short-rail .liked .ico { fill: currentColor; }
.shorts-top { position: absolute; top: calc(12px + var(--safe-t)); left: 12px; right: 12px; z-index: 5; display: flex; justify-content: space-between; align-items: center; color: #fff; }
.shorts-top a, .shorts-top button { color: #fff; }
.short-mute { position: absolute; top: calc(60px + var(--safe-t)); right: 14px; color: #fff; background: rgba(0, 0, 0, .4); border-radius: 50%; width: 38px; height: 38px; display: grid; place-items: center; z-index: 4; }
.short-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .2); }
.short-progress i { display: block; height: 100%; width: 0; background: #fff; }

/* ---------- Messenger ---------- */
.messenger { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - var(--topbar-h) - 40px); min-height: 480px; overflow: hidden; }
.msg-list { border-right: 1px solid var(--c-border); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.msg-list-head { padding: 14px 14px 8px; }
.msg-list-head h2 { margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; }
.msg-convs { flex: 1; overflow-y: auto; padding: 4px 8px 8px; }
.conv { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r); color: var(--c-text); }
.conv:hover { background: var(--c-surface-3); text-decoration: none; }
.conv.active { background: var(--c-primary-50); }
.conv .meta { flex: 1; min-width: 0; }
.conv .name { font-weight: 650; display: flex; justify-content: space-between; gap: 8px; }
.conv .name time { font-size: .76rem; color: var(--c-text-3); font-weight: 500; flex: none; }
.conv .last { display: block; font-size: .86rem; color: var(--c-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.unread .name, .conv.unread .last { font-weight: 800; color: var(--c-text); }
.conv .unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-primary); flex: none; }
.chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--c-border); }
.chat-head .meta { flex: 1; min-width: 0; }
.chat-head .status { font-size: .8rem; color: var(--c-text-2); }
.chat-head .status.online { color: var(--c-success); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 2px; background: var(--c-bg); }
.msg { display: flex; gap: 8px; max-width: 78%; align-items: flex-end; margin-top: 2px; }
.msg.me { margin-left: auto; flex-direction: row-reverse; }
.msg .bubble { position: relative; padding: 8px 12px; border-radius: 18px; background: var(--c-surface); border: 1px solid var(--c-border); word-wrap: break-word; overflow-wrap: anywhere; font-size: .95rem; line-height: 1.4; }
.msg.me .bubble { background: var(--c-primary); color: #fff; border-color: transparent; }
.msg.me .bubble a { color: #fff; text-decoration: underline; }
.msg .bubble.media { padding: 3px; overflow: hidden; }
.msg .bubble.media img, .msg .bubble.media video { border-radius: 15px; max-height: 320px; width: auto; max-width: 100%; }
.msg .bubble.deleted { font-style: italic; color: var(--c-text-3); background: transparent; }
.msg .reply-ref { font-size: .8rem; opacity: .85; border-left: 3px solid currentColor; padding-left: 8px; margin-bottom: 4px; }
.msg .msg-time { font-size: .7rem; color: var(--c-text-3); padding: 0 4px 4px; white-space: nowrap; }
.msg .msg-actions { opacity: 0; display: flex; gap: 2px; align-self: center; transition: opacity var(--t-fast); }
.msg:hover .msg-actions { opacity: 1; }
.msg .msg-actions button { width: 28px; height: 28px; border-radius: 50%; color: var(--c-text-2); display: grid; place-items: center; }
.msg .msg-actions button:hover { background: var(--c-surface-3); }
.msg-reaction { position: absolute; bottom: -10px; right: 8px; background: var(--c-surface); border-radius: 10px; padding: 0 4px; font-size: .8rem; box-shadow: var(--sh-1); }
.msg-day { text-align: center; font-size: .76rem; color: var(--c-text-3); font-weight: 700; margin: 14px 0 6px; }
.msg-system { text-align: center; font-size: .8rem; color: var(--c-text-2); margin: 8px 0; }
.msg-receipt { text-align: right; font-size: .72rem; color: var(--c-text-3); padding-right: 6px; }
.typing { display: inline-flex; gap: 3px; padding: 10px 12px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 18px; width: fit-content; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-text-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-foot { border-top: 1px solid var(--c-border); padding: 10px 12px calc(10px + var(--safe-b)); }
.chat-reply-bar { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--c-text-2); padding: 0 4px 8px; }
.chat-input-row { display: flex; align-items: flex-end; gap: 6px; }
.chat-input-row textarea { flex: 1; min-height: 40px; max-height: 140px; padding: 10px 14px; border-radius: 20px; border: 1px solid transparent; background: var(--c-surface-3); resize: none; line-height: 1.35; }
.chat-input-row textarea:focus { background: var(--c-surface); border-color: var(--c-primary); box-shadow: var(--ring); }
.chat-input-row .icon-btn { background: transparent; color: var(--c-primary); }
.chat-input-row .icon-btn:hover { background: var(--c-primary-50); }
.voice-rec { display: flex; align-items: center; gap: 10px; flex: 1; height: 40px; padding: 0 14px; border-radius: 20px; background: var(--c-error-50); color: var(--c-error); font-weight: 700; }
.voice-rec .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-error); animation: blink 1s infinite; }
.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--c-text-2); padding: 20px; }
audio { width: 240px; max-width: 100%; height: 40px; }
@media (max-width: 900px) {
  .messenger { grid-template-columns: minmax(0, 1fr); height: calc(100vh - var(--topbar-h) - var(--bottombar-h) - var(--safe-b) - 24px); border-radius: var(--r); }
  .messenger.has-chat .msg-list { display: none; }
  .messenger:not(.has-chat) .chat { display: none; }
  .msg { max-width: 88%; }
  body.chat-open .bottombar { display: none; }
  body.chat-open .messenger { position: fixed; inset: var(--topbar-h) 0 0 0; height: auto; border-radius: 0; z-index: 30; border: 0; }
}

/* ---------- Call UI ---------- */
.call-screen { position: fixed; inset: 0; z-index: 500; background: #0B1220; color: #fff; display: flex; flex-direction: column; }
.call-videos { position: relative; flex: 1; overflow: hidden; display: grid; }
.call-videos.grid-2 { grid-template-columns: 1fr 1fr; } .call-videos.grid-3, .call-videos.grid-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.call-videos video.remote { width: 100%; height: 100%; object-fit: cover; background: #000; }
.call-videos video.local { position: absolute; right: 16px; top: calc(16px + var(--safe-t)); width: 132px; height: 186px; object-fit: cover; border-radius: var(--r); border: 2px solid rgba(255, 255, 255, .3); background: #111; z-index: 2; transform: scaleX(-1); box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.call-peer { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 20px; }
.call-peer .avatar { width: 128px; height: 128px; box-shadow: 0 0 0 8px rgba(255, 255, 255, .06), 0 0 0 18px rgba(255, 255, 255, .03); }
.call-peer.ringing .avatar { animation: ring 1.6s infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(59, 139, 255, .6); } 70% { box-shadow: 0 0 0 26px rgba(59, 139, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(59, 139, 255, 0); } }
.call-peer h2 { color: #fff; margin: 0; }
.call-peer p { margin: 0; color: rgba(255, 255, 255, .7); }
.call-controls { display: flex; justify-content: center; gap: 16px; padding: 20px 16px calc(28px + var(--safe-b)); background: linear-gradient(transparent, rgba(0, 0, 0, .5)); flex-wrap: wrap; }
.call-btn { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .14); color: #fff; transition: background var(--t-fast), transform var(--t-fast); }
.call-btn:hover { background: rgba(255, 255, 255, .24); }
.call-btn.off { background: #fff; color: #0B1220; }
.call-btn.end { background: #DC2626; } .call-btn.end:hover { background: #B91C1C; }
.call-btn.accept { background: #16A34A; } .call-btn.accept:hover { background: #15803D; }
.call-btn .ico { width: 26px; height: 26px; }
.call-timer { font-variant-numeric: tabular-nums; }
.incoming-call { position: fixed; z-index: 480; top: calc(14px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(420px, calc(100vw - 24px)); padding: 14px; display: flex; align-items: center; gap: 12px; animation: rise var(--t) var(--ease); }

/* ---------- Notifications ---------- */
.notif { display: flex; gap: 12px; padding: 10px 12px; border-radius: var(--r); color: var(--c-text); align-items: flex-start; position: relative; }
.notif:hover { background: var(--c-surface-3); text-decoration: none; }
.notif.unread { background: var(--c-primary-50); }
.notif.unread::after { content: ""; position: absolute; right: 12px; top: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--c-primary); transform: translateY(-50%); }
.notif .n-avatar { position: relative; flex: none; }
.notif .n-type { position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 2px solid var(--c-surface); background: var(--c-primary); }
.notif .n-type .ico { width: 13px; height: 13px; }
.n-type.t-like { background: var(--c-like); } .n-type.t-love { background: var(--c-love); } .n-type.t-comment { background: #16A34A; } .n-type.t-follow, .n-type.t-friend { background: #0EA5E9; }
.n-type.t-money { background: var(--c-premium); } .n-type.t-warn { background: var(--c-warning); } .n-type.t-call { background: #16A34A; }
.notif .n-text { flex: 1; min-width: 0; font-size: .93rem; padding-right: 18px; }
.notif .n-time { display: block; font-size: .78rem; color: var(--c-primary); font-weight: 650; margin-top: 2px; }
.notif-dropdown { width: 380px; max-height: 70vh; overflow-y: auto; padding: 8px; }

/* ---------- Network tree ---------- */
.level-bars { display: flex; flex-direction: column; gap: 8px; }
.level-row { display: grid; grid-template-columns: 70px 1fr 110px 110px; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); color: var(--c-text); }
.level-row:hover { background: var(--c-surface-3); text-decoration: none; }
.level-row .lv { font-weight: 800; }
@media (max-width: 560px) { .level-row { grid-template-columns: 52px 1fr 80px; } .level-row .lv-comm { display: none; } }
.tree { list-style: none; margin: 0; padding: 0; }
.tree ul { list-style: none; margin: 0 0 0 22px; padding: 0 0 0 14px; border-left: 2px solid var(--c-border); }
.tree-node { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm); }
.tree-node:hover { background: var(--c-surface-3); }
.tree-node .toggle { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--c-surface-3); color: var(--c-text-2); flex: none; }
.tree-node .toggle.leaf { visibility: hidden; }
.ref-link-box { display: flex; gap: 8px; align-items: center; padding: 10px; border-radius: var(--r); background: var(--c-surface-3); }
.ref-link-box code { flex: 1; background: transparent; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.qr-box { width: 180px; height: 180px; padding: 10px; background: #fff; border-radius: var(--r); }
.qr-box canvas, .qr-box svg { width: 100%; height: 100%; }

/* ---------- Wallet ---------- */
.wallet-hero { padding: 22px; border: 0; color: #fff; background: radial-gradient(600px 300px at 0% 0%, #3B9BFF 0%, transparent 60%), linear-gradient(135deg, #0F3D91, #1877F2); }
.wallet-hero .label { color: rgba(255, 255, 255, .8); font-weight: 600; font-size: .9rem; }
.wallet-hero .amount { font-size: 2.3rem; font-weight: 800; letter-spacing: -.02em; }
.wallet-split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.wallet-split div { background: rgba(255, 255, 255, .12); border-radius: var(--r); padding: 10px 12px; }
.wallet-split span { display: block; font-size: .78rem; color: rgba(255, 255, 255, .8); }
.wallet-split b { font-size: 1.1rem; }
@media (max-width: 560px) { .wallet-split { grid-template-columns: 1fr; } }
.amount-pos { color: var(--c-success); font-weight: 700; } .amount-neg { color: var(--c-error); font-weight: 700; }
.status-pill { text-transform: capitalize; }

/* ---------- Landing ---------- */
.landing-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; padding: 56px 0 40px; }
.landing-hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); letter-spacing: -.03em; line-height: 1.08; margin-bottom: 18px; }
.landing-hero h1 .grad { background: var(--g-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.landing-hero p.lead { font-size: 1.15rem; color: var(--c-text-2); max-width: 520px; }
.hero-art { position: relative; aspect-ratio: 1; max-width: 520px; justify-self: center; width: 100%; }
.hero-card { position: absolute; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-xl); box-shadow: var(--sh-3); padding: 14px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { padding: 22px; }
.feature .f-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--c-primary-50); color: var(--c-primary); margin-bottom: 12px; }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--c-text-2); font-size: .93rem; margin: 0; }
.creator-band { padding: 36px; border: 0; background: var(--g-premium); color: #fff; display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; }
.creator-band h2 { color: #fff; font-size: 1.8rem; }
.creator-band p { color: rgba(255, 255, 255, .88); }
.site-footer { border-top: 1px solid var(--c-border); padding: 28px var(--gutter); margin-top: 40px; color: var(--c-text-2); font-size: .88rem; }
.site-footer .inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--c-text-2); margin-right: 14px; }
@media (max-width: 900px) {
  .landing-hero { grid-template-columns: 1fr; padding-top: 24px; gap: 24px; }
  .hero-art { max-width: 380px; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .creator-band { grid-template-columns: 1fr; padding: 24px; }
}
@media (max-width: 520px) { .feature-grid { grid-template-columns: 1fr; } }

/* ---------- Groups / Pages header ---------- */
.entity-hero .profile-cover { height: 260px; }
.entity-hero .entity-main { padding: 16px 24px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.entity-hero .entity-main h1 { margin: 0; font-size: 1.6rem; }
.entity-avatar { width: 88px; height: 88px; border-radius: 22px; object-fit: cover; border: 4px solid var(--c-surface); margin-top: -50px; box-shadow: var(--sh-2); background: var(--c-surface-3); }
@media (max-width: 900px) { .entity-hero .profile-cover { height: 170px; } .entity-hero .entity-main { padding: 12px 14px; } }

/* ---------- Search page ---------- */
.search-result-section + .search-result-section { margin-top: 20px; }
.hashtag-pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r); background: var(--c-surface); border: 1px solid var(--c-border); color: var(--c-text); font-weight: 700; }
.hashtag-pill:hover { border-color: var(--c-primary); text-decoration: none; }

/* ---------- Checkout ---------- */
.checkout-summary .line { display: flex; justify-content: space-between; padding: 8px 0; }
.checkout-summary .line.total { border-top: 1px dashed var(--c-border-strong); margin-top: 6px; padding-top: 12px; font-weight: 800; font-size: 1.1rem; }

/* ---------- Two-column page layouts (profile, groups, settings) collapse on small screens ---------- */
@media (max-width: 1100px) {
  [data-profile-layout] { grid-template-columns: minmax(0, 1fr) !important; }
  [data-profile-layout] > aside { display: none; }
}
@media (max-width: 900px) {
  [data-settings-layout] { grid-template-columns: minmax(0, 1fr) !important; }
  [data-settings-layout] [data-settings-nav] { display: none; }
  [data-settings-layout] > nav:not([data-settings-nav]) + [data-settings-main] { display: none; }
  [data-settings-layout] > nav { position: static !important; }
  /* Professional Dashboard: sidebar becomes a scrollable tab strip */
  [data-pro-layout] { grid-template-columns: minmax(0, 1fr) !important; gap: 12px; }
  [data-pro-layout] > nav { position: static !important; display: flex; gap: 4px; overflow-x: auto; padding: 6px !important; scrollbar-width: none; }
  [data-pro-layout] > nav::-webkit-scrollbar { display: none; }
  [data-pro-layout] > nav > div:first-child, [data-pro-layout] > nav .menu-sep, [data-pro-layout] > nav .nav-ico { display: none; }
  [data-pro-layout] > nav .nav-item { flex: none; white-space: nowrap; padding: 8px 12px; min-height: 38px; font-size: .9rem; }
}

/* ---------- Invoice print ---------- */
@media print {
  .topbar, .sidenav, .rail, .bottombar, .no-print, .toast-stack, .cookie-banner { display: none !important; }
  body { background: #fff; }
  .shell { display: block; padding: 0; }
  .card { box-shadow: none; border: 0; }
}
