.legal-page {
    padding: 140px 32px 100px;
    min-height: 100vh;
}

.legal-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 80px;
    align-items: start;
}

.legal-toc {
    position: sticky;
    top: 110px;
    padding: 24px 20px;
    background: linear-gradient(180deg, var(--bg-card), var(--bg-tertiary));
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    display: block !important;
}

.legal-toc-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--purple-300);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.legal-toc-list {
    list-style: none !important;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.legal-toc-list li {
    list-style: none !important;
    padding: 0;
    margin: 0;
}

.legal-toc-list li::before {
    display: none !important;
    content: none !important;
}

.legal-toc-link {
    display: block;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.legal-toc-link:hover {
    color: var(--text-primary);
    background: rgba(168, 85, 247, 0.06);
    border-left-color: var(--purple-500);
}

.legal-toc-link.active {
    color: var(--purple-300);
    background: rgba(168, 85, 247, 0.1);
    border-left-color: var(--accent-pink);
    font-weight: 600;
}

.legal-content {
    max-width: 820px;
    min-width: 0;
}

.legal-header {
    margin-bottom: 56px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}

.legal-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, var(--purple-500), var(--accent-pink), transparent);
    border-radius: 2px;
}

.legal-header h1 {
    font-size: clamp(34px, 4vw, 52px);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--purple-300) 0%, var(--accent-pink) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.legal-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
}

.legal-date::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.legal-section {
    margin-bottom: 32px;
    padding: 32px 36px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    scroll-margin-top: 110px;
}

.legal-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--purple-500), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.legal-section:hover {
    border-color: var(--border-medium);
    box-shadow: var(--glow-sm);
}

.legal-section:hover::before {
    opacity: 1;
}

.legal-section h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--purple-300);
    margin-bottom: 22px;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 14px;
    line-height: 1.3;
}

.legal-section h2::before {
    content: '';
    width: 4px;
    height: 22px;
    background: linear-gradient(180deg, var(--purple-400), var(--accent-pink));
    border-radius: 2px;
    flex-shrink: 0;
}

.legal-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 10px;
    padding-left: 12px;
    border-left: 2px solid var(--purple-500);
}

.legal-section p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.75;
    margin-bottom: 14px;
}

.legal-section p:last-child {
    margin-bottom: 0;
}

.legal-section ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 16px;
}

.legal-section ul li {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
    padding-left: 26px;
    position: relative;
    margin-bottom: 10px;
}

.legal-section ul li::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 11px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--purple-500);
    box-shadow: 0 0 6px var(--purple-500);
}

.legal-section strong {
    color: var(--text-primary);
    font-weight: 600;
}

.legal-section a {
    color: var(--purple-400);
    text-decoration: none;
    border-bottom: 1px dotted var(--purple-500);
    transition: all 0.2s ease;
}

.legal-section a:hover {
    color: var(--purple-300);
    border-bottom-color: var(--purple-300);
}

.legal-warning {
    padding: 22px 26px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(236, 72, 153, 0.05));
    border: 1px solid var(--border-medium);
    border-left: 3px solid var(--accent-pink);
    border-radius: 12px;
    margin: 20px 0;
}

.legal-warning p {
    color: var(--text-primary) !important;
    margin-bottom: 12px;
}

.legal-warning p:last-child {
    margin-bottom: 0;
}

.legal-warning strong {
    color: var(--accent-pink);
}

.legal-warning ul {
    list-style: none;
    padding-left: 0;
}

.legal-warning ul li {
    color: var(--text-secondary);
    padding-left: 26px;
    position: relative;
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.7;
}

.legal-warning ul li::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 11px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-pink);
    box-shadow: 0 0 6px var(--accent-pink);
}

.legal-toc-mobile {
    display: none !important;
    margin-bottom: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
}

.legal-toc-mobile summary {
    padding: 16px 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--purple-300);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    outline: none;
}

.legal-toc-mobile summary::-webkit-details-marker {
    display: none;
}

.legal-toc-mobile summary::marker {
    display: none;
    content: '';
}

.legal-toc-mobile summary::after {
    content: '▾';
    transition: transform 0.2s ease;
    font-size: 12px;
    color: var(--text-muted);
}

.legal-toc-mobile[open] summary::after {
    transform: rotate(180deg);
}

.legal-toc-mobile[open] summary {
    border-bottom: 1px solid var(--border-subtle);
}

.legal-toc-mobile .legal-toc-list {
    padding: 8px;
}

@media (max-width: 1024px) {
    .legal-inner {
        grid-template-columns: 1fr;
        gap: 0;
        display: block;
    }

    .legal-toc {
        display: none !important;
    }

    .legal-toc-mobile {
        display: block !important;
    }

    .legal-content {
        max-width: 100%;
    }
}

@media (min-width: 1025px) {
    .legal-toc-mobile {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .legal-page {
        padding: 100px 16px 60px;
    }

    .legal-header {
        margin-bottom: 32px;
        padding-bottom: 28px;
    }

    .legal-section {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .legal-section h2 {
        font-size: 19px;
        margin-bottom: 18px;
    }

    .legal-section h2::before {
        height: 19px;
    }
}