body.page-privacy {
    min-height: 100vh;
    height: auto;
    overflow-y: auto;
    background: var(--bg-primary);
}

body.page-privacy .main-container {
    display: block;
    padding: 32px 0 64px;
    overflow: visible;
}


.privacy-shell {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.agreement-header {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 24px 48px var(--shadow-light);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#agreementTitle {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

#agreementSubtitle {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 720px;
}

.rules-updated {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.rules-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 30px 60px var(--shadow-light);
    padding: 32px;
}

.rules-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    align-items: start;
}

.rules-toc {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border-radius: 16px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.rules-toc__title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.rules-toc__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.rules-toc__item a {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
    text-decoration: none;
    transition: color 0.2s ease;
}

.rules-toc__item a[data-toc-level="h3"] {
    padding-left: 12px;
    font-size: 11px;
    opacity: 0.9;
}

.rules-toc__item a[data-toc-level="h4"] {
    padding-left: 20px;
    font-size: 11px;
    opacity: 0.85;
}

.rules-toc__item a:hover,
.rules-toc__item a:focus {
    color: var(--accent-primary);
    outline: none;
}

.rules-toc__empty {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.rules-card__content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.rules-loader {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 12px;
}

.rules-loader__spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--accent-primary);
    animation: rules-spin 0.8s linear infinite;
}

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

.rules-content {
    font-size: 12px;
    line-height: 1.75;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rules-paragraph {
    margin: 0;
}

.rules-heading {
    font-weight: 600;
    color: var(--text-primary);
}

.rules-heading--h1 {
    font-size: 18px;
    margin-top: 8px;
}

.rules-heading--h2 {
    font-size: 16px;
    margin-top: 12px;
}

.rules-heading--h3 {
    font-size: 14px;
    margin-top: 8px;
}

.rules-heading--h4 {
    font-size: 13px;
    margin-top: 6px;
}

.rules-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.7;
}

.rules-list--bullet {
    list-style: disc;
}

.rules-list--numbered {
    list-style: decimal;
}

.rules-divider {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.rules-error {
    font-size: 12px;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

body[data-theme="light"].page-privacy .rules-toc {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body[data-theme="light"].page-privacy .rules-loader {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

.page-privacy .footer-container {
    margin-top: auto;
}

@media (max-width: 1024px) {
    .rules-layout {
        grid-template-columns: 1fr;
    }

    .rules-toc {
        position: relative;
        top: 0;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    body.page-privacy .main-container {
        padding: 24px 0 48px;
    }

    .privacy-shell {
        padding: 0 16px;
        gap: 16px;
    }

    .agreement-header,
    .rules-card {
        padding: 24px;
    }

    #agreementTitle {
        font-size: 18px;
    }
}
