:root {
    --bg: #0f0b1a;
    --bg-2: #1a1030;
    --card: #18122a;
    --card-2: #20163a;
    --text: #f5f2ff;
    --muted: #b6aecf;
    --line: rgba(255, 255, 255, 0.1);

    --accent: #a765ff;
    --accent-2: #d48fff;
    --accent-3: #d9ff3f;

    --radius: 18px;
    --shadow: 0 18px 36px rgba(0, 0, 0, 0.42);

    --safe-top: 0px;
    --safe-right: 0px;
    --safe-bottom: 0px;
    --safe-left: 0px;
    --tg-vh: 100vh;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at 18% 8%, #3a1f62 0%, var(--bg) 42%),
        radial-gradient(circle at 92% 26%, #2a1d4e 0%, transparent 48%),
        var(--bg);
    color: var(--text);
    font-family: "SF Pro Display", "Segoe UI", "Inter", system-ui, sans-serif;
    overflow-x: hidden;
}

body.viewerNoScroll {
    overflow: hidden;
    overscroll-behavior: none;
}

html.viewerNoScroll {
    overflow: hidden;
    overscroll-behavior: none;
}

#app {
    min-height: var(--tg-vh);
    padding: calc(16px + var(--safe-top)) calc(14px + var(--safe-right))
        calc(96px + var(--safe-bottom)) calc(14px + var(--safe-left));
    display: flex;
    justify-content: center;
}

#viewer-root {
    position: relative;
    z-index: 120;
}

.shell {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.noReveal .sectionReveal {
    animation: none !important;
}

.sectionReveal {
    animation: riseIn 220ms ease both;
}

.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #2b1450 0%, #5d2aa4 55%, #7b3ed4 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(2px);
}

.hero::before {
    width: 140px;
    height: 140px;
    right: -44px;
    top: -34px;
    background: rgba(212, 143, 255, 0.35);
}

.hero::after {
    width: 180px;
    height: 180px;
    left: -50px;
    bottom: -90px;
    background: rgba(146, 84, 235, 0.32);
}

.heroTitle {
    position: relative;
    margin: 0;
    font-size: 30px;
    line-height: 0.95;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    font-weight: 900;
}

.heroSub {
    position: relative;
    margin: 8px 0 0;
    font-size: 13px;
    color: rgba(245, 242, 255, 0.8);
}

.card {
    background: linear-gradient(160deg, var(--card) 0%, #140f23 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    transition:
        transform 0.16s ease,
        border-color 0.16s ease;
}

.card:active {
    transform: translateY(1px);
}

.sectionTitle {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--muted);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.subStatus {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.subBadge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
}

.subBadge.active {
    color: #d9ff3f;
    border-color: rgba(217, 255, 63, 0.6);
    background: rgba(217, 255, 63, 0.12);
}

.subBadge.inactive {
    color: #ffd3d9;
    border-color: rgba(255, 140, 156, 0.45);
    background: rgba(255, 140, 156, 0.12);
}

.subInfo {
    display: grid;
    gap: 6px;
    font-size: 14px;
}

.subInfo strong {
    color: var(--text);
}

.renewControl {
    margin-top: 10px;
    border: 1px solid rgba(212, 143, 255, 0.32);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(117, 63, 190, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: opacity 0.16s ease;
}

.renewControl.busy {
    opacity: 0.72;
}

.renewMeta {
    min-width: 0;
}

.renewTitle {
    margin: 0;
    font-size: 13px;
    line-height: 1.2;
    color: #f7f2ff;
    font-weight: 800;
}

.renewSwitch {
    width: 50px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 2px;
    background: rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition:
        background 0.16s ease,
        border-color 0.16s ease;
}

.renewSwitch.on {
    background: linear-gradient(90deg, #30b89c, #58d0b0);
    border-color: rgba(88, 208, 176, 0.7);
}

.renewSwitch.off {
    background: rgba(255, 255, 255, 0.12);
}

.renewSwitch:disabled {
    cursor: not-allowed;
    filter: grayscale(0.2);
}

.renewKnob {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
    transform: translateX(0);
    transition: transform 0.16s ease;
}

.renewSwitch.on .renewKnob {
    transform: translateX(20px);
}

.btn {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 15px;
    font-weight: 800;
    color: #120d1f;
    background: linear-gradient(90deg, var(--accent-3), #f0ff8f);
    cursor: pointer;
    transition:
        transform 0.12s ease,
        filter 0.16s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    cursor: not-allowed;
    filter: grayscale(0.2) brightness(0.9);
}

.btn.secondary {
    background: linear-gradient(90deg, #8650da, #b876ff);
    color: #f7f2ff;
}

.btn.payform {
    background: linear-gradient(90deg, #2f9e9a, #58c8c0);
    color: #eefcfa;
}

.btn.danger {
    background: linear-gradient(90deg, #aa2c46, #de4063);
    color: #ffeef2;
}

.btn.ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid var(--line);
}

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.actions.stack {
    grid-template-columns: 1fr;
}

.subOnlyAction {
    margin-top: 10px;
}

.faqList {
    display: grid;
    gap: 8px;
}

.faqItem {
    border: 1px solid rgba(212, 143, 255, 0.24);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.faqItem[open] {
    border-color: rgba(212, 143, 255, 0.46);
    background: rgba(167, 101, 255, 0.1);
}

.faqQuestion {
    list-style: none;
    cursor: pointer;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
    color: #f7f2ff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.faqQuestion::-webkit-details-marker {
    display: none;
}

.faqQuestion::after {
    content: "+";
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid rgba(212, 143, 255, 0.42);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f7f2ff;
    font-size: 13px;
    font-weight: 900;
    background: rgba(167, 101, 255, 0.2);
}

.faqItem[open] .faqQuestion::after {
    content: "−";
}

.faqAnswer {
    margin: 0;
    padding: 0 14px 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.chips::-webkit-scrollbar {
    display: none;
}

.chip {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    padding: 9px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition:
        transform 0.12s ease,
        border-color 0.16s ease,
        background 0.16s ease;
}

.chip:active {
    transform: scale(0.97);
}

.chip.active {
    border-color: rgba(212, 143, 255, 0.7);
    background: linear-gradient(
        90deg,
        rgba(167, 101, 255, 0.35),
        rgba(212, 143, 255, 0.2)
    );
}

.posts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.postsWrap {
    position: relative;
}

.postsWrap.loading .posts {
    opacity: 0.42;
    transition: opacity 0.15s ease;
}

.postsLoadingOverlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    background: rgba(15, 11, 26, 0.36);
    border-radius: 16px;
    pointer-events: none;
}

.postsSection {
    display: grid;
    gap: 10px;
}

.post {
    background: linear-gradient(160deg, var(--card-2), #17102c);
    border: 0;
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
    transition: transform 0.14s ease;
}

.post:active {
    transform: translateY(1px);
}

.postMeta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
}

.postCategory {
    color: #e8d7ff;
    background: rgba(167, 101, 255, 0.22);
    border: 1px solid rgba(167, 101, 255, 0.5);
    border-radius: 999px;
    padding: 4px 9px;
    font-weight: 700;
    font-size: 12px;
}

.postMedia {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.mediaThumb {
    margin: 0;
    padding: 0;
    width: 100%;
    aspect-ratio: 4 / 5;
    display: block;
    line-height: 0;
    appearance: none;
    border: 0;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.mediaThumb:active {
    transform: scale(0.99);
}

.postMedia img,
.postMedia video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    border: 0;
    background: #0c0816;
}

.videoPreviewStub {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: #f7f2ff;
    background:
        radial-gradient(
            circle at 30% 28%,
            rgba(212, 143, 255, 0.28),
            rgba(34, 21, 58, 0.85)
        ),
        linear-gradient(155deg, #25163f 0%, #110b20 100%);
}

.mediaBadge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.6);
    color: #f7f2ff;
    font-size: 11px;
    font-weight: 700;
}

.mediaCountBadge {
    position: absolute;
    right: 8px;
    top: 8px;
    min-width: 34px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.postText {
    margin: 0;
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.42;
}

.contacts {
    margin-top: 12px;
    display: grid;
    gap: 8px;
}

.contactsTitle {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.contactBtns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.contactBtn {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border-radius: 12px;
    padding: 11px 10px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition:
        transform 0.12s ease,
        border-color 0.16s ease;
}

.contactBtn:active {
    transform: scale(0.98);
}

.inlineHeader {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.noMargin {
    margin: 0;
}

.iconBtn {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition:
        transform 0.12s ease,
        border-color 0.16s ease;
}

.iconBtn:active {
    transform: scale(0.96);
}

.iconBtn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.paySummary {
    border: 1px solid rgba(212, 143, 255, 0.32);
    border-radius: 14px;
    background: rgba(167, 101, 255, 0.1);
    padding: 10px 12px;
    margin-bottom: 12px;
}

.payLabel {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.payValue {
    margin-top: 4px;
    font-size: 18px;
    font-weight: 900;
    color: #f7f2ff;
}

.subscribeSuccessCard {
    display: grid;
    gap: 12px;
    justify-items: center;
    text-align: center;
    padding-top: 18px;
    padding-bottom: 18px;
}

.successBadge {
    width: 74px;
    height: 74px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(212, 143, 255, 0.55);
    background: radial-gradient(
            circle at 35% 30%,
            rgba(212, 143, 255, 0.4),
            rgba(167, 101, 255, 0.1)
        ),
        rgba(255, 255, 255, 0.03);
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.successBadge svg {
    width: 38px;
    height: 38px;
    stroke: #d9ff3f;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.successTitle {
    margin: 2px 0 0;
    font-size: 20px;
    line-height: 1.2;
    font-weight: 900;
    color: #f7f2ff;
}

.successText {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--muted);
}

.successText strong {
    color: var(--text);
}

.fieldLabel {
    display: block;
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.textInput {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 15px;
    padding: 0 12px;
    outline: none;
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease;
}

.textInput::placeholder {
    color: #8f86ad;
}

.textInput:focus {
    border-color: rgba(212, 143, 255, 0.75);
    box-shadow: 0 0 0 3px rgba(167, 101, 255, 0.2);
}

.textInput.error {
    border-color: rgba(255, 140, 156, 0.8);
}

.fieldHint {
    margin: 8px 0 12px;
    font-size: 12px;
    color: var(--muted);
}

.fieldError {
    margin: 6px 0 0;
    font-size: 12px;
    color: #ffb4bf;
}

.btn.busy {
    filter: saturate(0.75);
}

.contactBtn.tg {
    border-color: rgba(95, 178, 255, 0.5);
    background: rgba(95, 178, 255, 0.15);
}

.contactBtn.wa {
    border-color: rgba(84, 224, 126, 0.5);
    background: rgba(84, 224, 126, 0.15);
}

.empty {
    color: var(--muted);
    text-align: center;
    font-size: 14px;
    padding: 10px 6px;
}

.previewPostsTitle {
    margin: 2px 4px 0;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.3px;
    color: #f7f2ff;
}

.loadMore {
    margin-top: 2px;
}

.catalogLoader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    padding: 8px 2px;
}

.catalogLoader.inline {
    justify-content: center;
}

.catalogLoader.firstLoad {
    padding: 14px 2px 4px;
}

.loaderSpin {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid rgba(212, 143, 255, 0.25);
    border-top-color: #d48fff;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.mediaViewer {
    position: fixed;
    inset: 0;
    background: rgba(9, 6, 15, 0.86);
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 14px;
    opacity: 1;
    transition: opacity 180ms ease;
}

.mediaViewerDialog {
    width: min(100%, 760px);
    max-height: 92vh;
    border-radius: 18px;
    background: rgba(20, 14, 34, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    position: relative;
    display: grid;
    gap: 8px;
    opacity: 1;
    transform: translateY(0) scale(1);
    transition:
        opacity 180ms ease,
        transform 180ms ease;
}

.mediaViewer.closing {
    opacity: 0;
    pointer-events: none;
}

.mediaViewer.closing .mediaViewerDialog {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
}

.viewerHead {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.viewerBody {
    width: 100%;
    overflow: auto;
}

.viewerBody img,
.viewerBody video {
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 12px;
    background: #09070f;
}

.viewerClose {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(24, 18, 42, 0.78);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.viewerNav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(24, 18, 42, 0.78);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.viewerNav.prev {
    left: 10px;
}

.viewerNav.next {
    right: 10px;
}

.bottomNavWrap {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px calc(14px + var(--safe-right)) calc(18px + var(--safe-bottom))
        calc(14px + var(--safe-left));
    z-index: 90;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.bottomNav {
    pointer-events: auto;
    width: 100%;
    max-width: 460px;
    background: rgba(24, 18, 42, 0.95);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 6px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.bottomNav.locked {
    opacity: 0.66;
}

.bottomNavBtn {
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    min-height: 48px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition:
        transform 0.12s ease,
        border-color 0.16s ease;
}

.bottomNavBtn:disabled {
    cursor: not-allowed;
    transform: none !important;
    filter: saturate(0.65) brightness(0.9);
}

.bottomNavBtn:active {
    transform: scale(0.98);
}

.bottomNavBtn.active {
    color: #f7f2ff;
    background: linear-gradient(
        90deg,
        rgba(167, 101, 255, 0.4),
        rgba(212, 143, 255, 0.24)
    );
    border: 1px solid rgba(212, 143, 255, 0.45);
}

.bottomNavIcon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bottomNavIcon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(86px + var(--safe-bottom));
    background: rgba(18, 13, 31, 0.96);
    border: 1px solid rgba(212, 143, 255, 0.5);
    border-radius: 12px;
    color: #f6f2ff;
    padding: 10px 12px;
    font-size: 13px;
    z-index: 100;
    box-shadow: var(--shadow);
}

@keyframes riseIn {
    from {
        transform: translateY(6px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 360px) {
    .heroTitle {
        font-size: 26px;
    }

    .contactBtns,
    .actions:not(.stack) {
        grid-template-columns: 1fr;
    }
}
