.legal-header {
    position: relative;
    overflow: hidden;
    padding: 0;
    border-bottom: 1px solid rgba(115, 214, 255, .12);
    background:
        radial-gradient(ellipse at 82% 18%, rgba(0, 200, 255, .13), transparent 34%),
        radial-gradient(ellipse at 12% 100%, rgba(108, 92, 231, .12), transparent 42%),
        linear-gradient(135deg, #091827, #0b1c2c 58%, #0b1728);
    text-align: left;
}

.legal-header-container {
    position: relative;
    z-index: 1;
    max-width: 1440px;
    padding-top: 1.3rem;
    padding-bottom: 2rem;
}

.legal-breadcrumb {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: 1.15rem;
    color: #8498ab;
    font-size: .72rem;
}

.legal-breadcrumb a { color: #b6d2e7; text-decoration: none; }
.legal-breadcrumb a:hover { color: #8bdcff; }
.legal-breadcrumb i { font-size: .55rem; }

.legal-hero-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    overflow: hidden;
    padding: clamp(1.5rem, 4vw, 3rem);
    border: 1px solid rgba(112, 200, 238, .19);
    border-radius: 22px;
    background: linear-gradient(115deg, rgba(15, 39, 58, .95), rgba(12, 31, 48, .75));
    box-shadow: 0 18px 48px rgba(0, 0, 0, .2);
}

.legal-hero-content::after {
    position: absolute;
    top: -8rem;
    right: 7rem;
    width: 18rem;
    height: 18rem;
    border: 1px solid rgba(104, 217, 255, .09);
    border-radius: 50%;
    box-shadow: 0 0 0 2.5rem rgba(104, 217, 255, .025), 0 0 0 5rem rgba(104, 217, 255, .018);
    content: "";
    pointer-events: none;
}

.legal-hero-copy { position: relative; z-index: 1; max-width: 780px; }
.legal-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .7rem;
    color: #72d6fa;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.legal-eyebrow::before { width: 1.15rem; height: 2px; border-radius: 2px; background: currentColor; content: ""; }
.legal-header h1 { margin: 0; color: #f0f7ff; font-size: clamp(1.8rem, 3.5vw, 2.8rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.12; }
.legal-hero-copy > p { max-width: 58ch; margin: .8rem 0 0; color: #a9bfd1; font-size: .92rem; line-height: 1.65; }
.legal-header-meta { display: flex; flex-wrap: wrap; gap: .55rem 1.2rem; margin-top: 1.25rem; color: #9eb4c7; font-size: .72rem; }
.legal-header-meta span { display: inline-flex; align-items: center; gap: .45rem; }
.legal-header-meta i { color: #63cbee; }

.legal-header-icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    width: 78px;
    height: 78px;
    flex: 0 0 78px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(108, 216, 255, .22);
    border-radius: 23px;
    background: linear-gradient(145deg, rgba(27, 105, 139, .34), rgba(87, 79, 174, .2));
    color: #77dcff;
    font-size: 1.65rem;
    margin-bottom: 0;
    box-shadow: 0 10px 30px rgba(0, 150, 210, .13), inset 0 1px rgba(255, 255, 255, .08);
}

.legal-wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding: 1.6rem clamp(16px, 3vw, 42px) 4rem; text-align: left; }
.legal-layout { display: grid; grid-template-columns: minmax(220px, 270px) minmax(0, 1fr); align-items: start; gap: 1.25rem; margin-top: 0; }
.legal-layout.no-toc { grid-template-columns: minmax(0, 1fr); }
.legal-layout.no-toc .legal-page { width: 100%; max-width: 980px; margin: 0 auto; }
.legal-toc[hidden] { display: none; }

.legal-toc {
    position: sticky;
    top: 90px;
    display: block;
    align-self: start;
    max-height: calc(100vh - 112px);
    overflow: hidden;
    padding: .9rem;
    border: 1px solid rgba(107, 191, 226, .16);
    border-radius: 17px;
    background: linear-gradient(150deg, rgba(15, 37, 55, .96), rgba(11, 28, 44, .97));
    box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
    scrollbar-width: thin;
}

.legal-toc-title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 0; padding: .35rem .35rem .75rem; border-bottom: 1px solid rgba(107, 191, 226, .12); color: #9ab0c1; font-size: .71rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; cursor: pointer; list-style: none; }
.legal-toc-title::-webkit-details-marker { display: none; }
.legal-toc-title > span { display: inline-flex; align-items: center; gap: .55rem; }
.legal-toc-title > span i { color: #6cd4f6; }
.legal-toc-chevron { color: #7d93a7; font-size: .65rem; transition: transform .18s ease; }
.legal-toc[open] .legal-toc-chevron { transform: rotate(180deg); }
.legal-toc-links { display: flex; max-height: calc(100vh - 190px); flex-direction: column; gap: .2rem; overflow-y: auto; padding-top: .7rem; scrollbar-width: thin; }
.legal-toc-link { padding: .55rem .65rem; border: 1px solid transparent; border-radius: 9px; color: #a8bbca; font-size: .78rem; line-height: 1.45; text-decoration: none; transition: color .18s ease, background .18s ease, border-color .18s ease; }
.legal-toc-link:hover { color: #83ddfa; background: rgba(0, 200, 255, .07); }
.legal-toc-link.sub { padding-left: 1.1rem; color: #8fa9bc; font-size: .74rem; }
.legal-toc-link.active { border-color: rgba(72, 196, 238, .15); color: #83ddfa; background: rgba(0, 200, 255, .09); }

.legal-page {
    min-width: 0;
    padding: clamp(1.5rem, 3.5vw, 3.25rem);
    border: 1px solid rgba(107, 191, 226, .15);
    border-radius: 18px;
    background: linear-gradient(155deg, rgba(14, 35, 53, .97), rgba(10, 26, 42, .98));
    color: var(--text-primary);
    line-height: 1.8;
    box-shadow: 0 16px 42px rgba(0, 0, 0, .2);
}

.legal-page h1, .legal-page h2, .legal-page h3 { margin: 2.3rem 0 1rem; font-weight: 750; scroll-margin-top: 104px; line-height: 1.3; }
.legal-page h1:first-child, .legal-page h2:first-child, .legal-page h3:first-child { margin-top: 0; }
.legal-page h2 { padding-bottom: .7rem; border-bottom: 1px solid rgba(107, 191, 226, .13); color: #6ed2f4; font-size: clamp(1.2rem, 2vw, 1.45rem); }
.legal-page h3 { color: #e2edf6; font-size: 1.08rem; }
.legal-page p, .legal-page ul, .legal-page ol { max-width: 78ch; color: #b8c8d6; }
.legal-page p { margin-bottom: 1.2rem; line-height: 1.85; }
.legal-page ul, .legal-page ol { padding-left: 1.4rem; margin-bottom: 1.3rem; line-height: 1.8; }
.legal-page li { margin-bottom: .55rem; padding-left: .2rem; }
.legal-page li::marker { color: #5ec9eb; }
.legal-page a { color: #72d6fa; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.legal-page a:hover { color: #b5ecff; }
.legal-page blockquote { margin: 1.5rem 0; padding: 1rem 1.25rem; border: 1px solid rgba(107, 191, 226, .14); border-left: 3px solid #55c5eb; border-radius: 0 12px 12px 0; background: rgba(23, 71, 96, .18); color: #b8c8d6; line-height: 1.75; }
.legal-page img { max-width: 100%; border-radius: 12px; }
.legal-page table { display: block; max-width: 100%; overflow-x: auto; margin: 1.5rem 0; border-collapse: collapse; }
.legal-page table td, .legal-page table th { padding: .75rem .9rem; border: 1px solid rgba(107, 191, 226, .16); text-align: left; }
.legal-page th { background: rgba(17, 52, 73, .72); color: #e4f2fb; }
.legal-fade { animation: legalFadeIn .5s ease both; }
@keyframes legalFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.legal-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; padding-top: 1.4rem; border-top: 1px solid rgba(107, 191, 226, .12); }
.legal-actions .btn { min-height: 42px; }
.back-top-btn { z-index: 90; }

@media (max-width: 1024px) {
    .legal-layout { grid-template-columns: minmax(0, 1fr); gap: .9rem; }
    .legal-layout.no-toc { gap: 0; }
    .legal-toc { position: static; max-height: none; }
    .legal-toc-links { max-height: 260px; }
}

@media (max-width: 768px) {
    .legal-header-container { padding-top: 1rem; padding-bottom: 1.25rem; }
    .legal-breadcrumb { margin-bottom: .8rem; }
    .legal-hero-content { gap: 1rem; padding: 1.4rem; border-radius: 17px; }
    .legal-header h1 { font-size: clamp(1.65rem, 7vw, 2.2rem); }
    .legal-hero-copy > p { font-size: .84rem; }
    .legal-header-icon { width: 60px; height: 60px; flex-basis: 60px; border-radius: 18px; font-size: 1.3rem; }
    .legal-wrap { padding: 1rem 16px 2.5rem; }
    .legal-page { padding: 1.5rem; border-radius: 15px; }
    .legal-page h2 { margin-top: 1.8rem; }
    .legal-actions { gap: .6rem; }
}

@media (max-width: 480px) {
    .legal-hero-content { align-items: flex-start; }
    .legal-header-icon { width: 48px; height: 48px; flex-basis: 48px; border-radius: 15px; font-size: 1.05rem; }
    .legal-header-meta { display: grid; gap: .45rem; margin-top: 1rem; }
    .legal-page { padding: 1.2rem 1.05rem; }
    .legal-actions .btn { flex: 1 1 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .legal-fade { animation: none; }
    .legal-toc-chevron, .legal-toc-link, .back-top-btn { transition: none; }
}
