:root {
    --legal-bg: #0f1218;
    --legal-panel: #171b22;
    --legal-border: #2a303b;
    --legal-text: #e8edf6;
    --legal-muted: #acb6c8;
    --legal-accent: #f59e0b;
}

[data-theme="light"] {
    --legal-bg: #f5f2eb;
    --legal-panel: #ffffff;
    --legal-border: #d9cdb8;
    --legal-text: #1f2937;
    --legal-muted: #4b5563;
    --legal-accent: #b87413;
}

[data-theme="warm"] {
    --legal-bg: #1a1308;
    --legal-panel: #22180b;
    --legal-border: #5e4320;
    --legal-text: #f8ebd2;
    --legal-muted: #d5c3a3;
    --legal-accent: #f2aa3c;
}

html {
    height: auto !important;
    overflow-y: auto !important;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at 10% 0%, rgba(245, 158, 11, 0.12), transparent 36%), var(--legal-bg);
    color: var(--legal-text);
    font-family: "Manrope", "Segoe UI", sans-serif;
    line-height: 1.7;
}

body.legal-page {
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    height: auto !important;
    padding-bottom: 0 !important;
    padding-top: 72px;
}

.legal-shell {
    width: min(980px, 100%);
    margin: 0 auto;
    padding: 24px 20px 44px;
}

.legal-header {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid var(--legal-border);
    background: rgba(15, 18, 24, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.legal-header-inner {
    width: min(980px, 100%);
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.legal-brand {
    color: var(--legal-text);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.legal-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.legal-nav a {
    color: var(--legal-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
}

.legal-nav a:hover,
.legal-nav a.active {
    color: var(--legal-accent);
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.1);
}

.legal-card {
    background: var(--legal-panel);
    border: 1px solid var(--legal-border);
    border-radius: 18px;
    padding: 24px;
}

h1 {
    margin: 0 0 8px;
    font-size: clamp(1.7rem, 4vw, 2.3rem);
    line-height: 1.2;
}

.legal-meta {
    color: var(--legal-muted);
    font-size: 0.9rem;
    margin-bottom: 22px;
}

h2 {
    margin: 24px 0 8px;
    font-size: 1.2rem;
}

h3 {
    margin: 18px 0 6px;
    font-size: 1.02rem;
    color: #ffe7bd;
}

[data-theme="light"] h3 {
    color: #9a5c09;
}

p,
li {
    color: var(--legal-text);
    font-size: 1rem;
}

ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.legal-note {
    margin-top: 22px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: #ffdfab;
}

a {
    color: #ffd08a;
}

code {
    padding: 2px 5px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffe7bd;
    font-size: 0.92em;
}

.legal-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 14px 0 22px;
    border: 1px solid var(--legal-border);
    border-radius: 14px;
}

.legal-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.025);
}

.legal-table th,
.legal-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--legal-border);
    border-right: 1px solid var(--legal-border);
    vertical-align: top;
    text-align: left;
    color: var(--legal-text);
    font-size: 0.92rem;
    line-height: 1.55;
}

.legal-table th {
    color: #ffe7bd;
    background: rgba(245, 158, 11, 0.1);
    font-weight: 800;
}

.legal-table tr:last-child td {
    border-bottom: 0;
}

.legal-table th:last-child,
.legal-table td:last-child {
    border-right: 0;
}

[data-theme="light"] code,
[data-theme="light"] .legal-table th {
    color: #9a5c09;
}

.support-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
}

.support-panel-wide {
    width: 100%;
}

.support-panel h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.2rem;
    color: #ffe7bd;
}

[data-theme="light"] .support-panel h2 {
    color: #9a5c09;
}

[data-theme="light"] .support-headline h1 {
    color: #334155;
}

[data-theme="light"] .support-headline p {
    color: #64748b;
}

.support-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
    padding: 20px;
    border-radius: 18px;
    border: 1px solid rgba(245, 158, 11, 0.24);
    background:
        radial-gradient(circle at 100% 0%, rgba(245, 158, 11, 0.11), transparent 42%),
        linear-gradient(120deg, rgba(10, 13, 21, 0.96), rgba(14, 19, 29, 0.96));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        0 18px 42px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .support-form {
    border-color: rgba(184, 116, 19, 0.32);
    background:
        radial-gradient(circle at 100% 0%, rgba(245, 158, 11, 0.12), transparent 44%),
        linear-gradient(120deg, rgba(255, 255, 255, 0.98), rgba(248, 242, 233, 0.98));
    box-shadow:
        inset 0 0 0 1px rgba(184, 116, 19, 0.08),
        0 18px 34px rgba(106, 76, 35, 0.16);
}

.support-field {
    display: grid;
    gap: 7px;
}

.support-field-full {
    grid-column: 1 / -1;
}

.support-form label {
    font-size: 0.9rem;
    color: #ffe1af;
    font-weight: 600;
}

[data-theme="light"] .support-form label {
    color: #7b4f12;
}

.support-form input,
.support-form textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    color: var(--legal-text);
    padding: 11px 13px;
    font: inherit;
    transition: border-color 0.2s ease, background 0.2s ease;
}

[data-theme="light"] .support-form input,
[data-theme="light"] .support-form textarea {
    border-color: rgba(107, 114, 128, 0.32);
    background: #ffffff;
    color: #1f2937;
}

.support-form textarea {
    min-height: 140px;
    resize: vertical;
}

.support-form input::placeholder,
.support-form textarea::placeholder {
    color: #7f8aa1;
}

[data-theme="light"] .support-form input::placeholder,
[data-theme="light"] .support-form textarea::placeholder {
    color: #6b7280;
}

.support-form input:focus,
.support-form textarea:focus {
    outline: none;
    border-color: rgba(245, 158, 11, 0.62);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
}

[data-theme="light"] .support-form input:focus,
[data-theme="light"] .support-form textarea:focus {
    border-color: rgba(184, 116, 19, 0.7);
    background: #ffffff;
}

.support-form button {
    grid-column: 1 / -1;
    justify-self: stretch;
    border: 1px solid rgba(245, 158, 11, 0.62);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.84), rgba(217, 119, 6, 0.86));
    color: #1e1204;
    font-weight: 700;
    font: inherit;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 10px 24px rgba(217, 119, 6, 0.34);
}

.support-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(217, 119, 6, 0.42);
    filter: saturate(1.08);
}

.support-note {
    margin-top: 10px;
    color: var(--legal-muted);
    font-size: 0.9rem;
}

.faq-list {
    display: grid;
    gap: 10px;
}

.faq-item {
    border-left: 3px solid rgba(245, 158, 11, 0.5);
    border-radius: 10px;
    background: rgba(16, 22, 32, 0.78);
    padding: 12px 12px;
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
    cursor: default;
}

[data-theme="light"] .faq-item {
    background: #fffdf8;
    border-left-color: rgba(184, 116, 19, 0.6);
}

.faq-item h3 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

[data-theme="light"] .faq-item h3 {
    color: #1f2937;
}

.faq-caret {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f8fafc;
    border: 1px solid rgba(245, 158, 11, 0.42);
    background: rgba(245, 158, 11, 0.12);
    padding: 0;
    box-sizing: border-box;
    transform-origin: center center;
    transform: rotate(0deg);
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

[data-theme="light"] .faq-caret {
    color: #1f2937;
    border-color: rgba(184, 116, 19, 0.52);
    background: rgba(184, 116, 19, 0.12);
}

.faq-caret svg {
    width: 12px;
    height: 12px;
    display: block;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.faq-answer {
    margin: 0;
    color: var(--legal-muted);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-4px);
    transition: max-height 0.28s ease, opacity 0.22s ease, transform 0.22s ease, margin-top 0.22s ease;
}

.faq-item:hover,
.faq-item:focus-within {
    background: rgba(20, 28, 40, 0.92);
    transform: translateX(2px);
}

[data-theme="light"] .faq-item:hover,
[data-theme="light"] .faq-item:focus-within {
    background: #fff6e8;
}

.faq-item:hover .faq-caret,
.faq-item:focus-within .faq-caret {
    transform: rotate(180deg);
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.66);
}

.support-shell {
    width: min(860px, 100%);
}

.support-headline {
    margin-bottom: 14px;
}

.support-main {
    display: grid;
    gap: 48px;
}

.support-panel {
    padding: 0;
}

.faq-panel {
    margin-top: 28px;
}

.support-legal-footer {
    margin-top: 22px;
    padding: 12px 14px 16px;
    border-top: 1px solid rgba(245, 158, 11, 0.16);
    color: #8f97a8;
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.5;
}

[data-theme="light"] .support-legal-footer {
    color: #4b5563;
    border-top-color: rgba(184, 116, 19, 0.22);
    background: rgba(255, 255, 255, 0.72);
}

[data-theme="light"] .support-legal-footer .legal-inline-link {
    color: #7b4f12;
}

.support-legal-footer .legal-inline-link {
    margin-left: 8px;
    margin-right: 8px;
}

.faq-item:hover .faq-answer,
.faq-item:focus-within .faq-answer {
    max-height: 120px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 8px;
}

@media (max-width: 768px) {
    .legal-header-inner {
        padding: 10px 12px;
        align-items: flex-start;
        flex-direction: column;
    }

    .legal-shell {
        padding: 14px 12px 24px;
    }

    .legal-card {
        padding: 16px;
        border-radius: 14px;
    }

    .support-stack {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .support-form button {
        width: 100%;
        min-width: 0;
    }

    .support-form {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px;
    }

    .faq-item .faq-answer {
        max-height: 0;
        opacity: 0;
        transform: translateY(-4px);
        margin-top: 0;
    }

    .support-legal-footer {
        font-size: 0.78rem;
        padding: 10px 10px 14px;
    }
}

/* Keep footer/content layout clean on legal pages (no fixed overlay footer) */
body.legal-page .support-legal-footer {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin-top: 18px !important;
    z-index: auto !important;
}

body.legal-page .legal-shell {
    padding-bottom: 40px;
}

body.legal-page .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 300;
}

/* Ensure language selector remains visible in legal-page headers */
body.legal-page .nav-actions {
    flex-wrap: nowrap;
}

body.legal-page .lang-selector {
    display: block !important;
    min-width: 126px;
}

body.legal-page .lang-selector select {
    position: static !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    width: 100% !important;
    height: 36px !important;
    padding: 0 34px 0 10px !important;
    border-radius: 10px !important;
    border: 1px solid var(--border) !important;
    background-color: var(--bg-3) !important;
    color: var(--text) !important;
    font: inherit !important;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    width: 100%;
}

@media (max-width: 1100px) {
    body.legal-page .support-legal-footer {
        position: static !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        z-index: auto !important;
        margin-top: 14px !important;
    }

    body.legal-page .legal-shell {
        padding-bottom: 22px;
    }

    body.legal-page .nav-actions {
        gap: 8px;
    }

    body.legal-page .new-chat-btn {
        display: none;
    }

    body.legal-page .lang-selector {
        min-width: 118px;
    }
}

/* Production legal page redesign */
body.legal-redesign {
    background:
        linear-gradient(135deg, rgba(11, 31, 66, 0.96) 0%, rgba(13, 18, 30, 0.98) 48%, rgba(33, 25, 11, 0.96) 100%),
        #0b1220;
    font-family: "Lato", "Manrope", "Segoe UI", sans-serif;
}

body.legal-redesign::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 72%);
    z-index: -1;
}

[data-theme="light"] body.legal-redesign,
html[data-theme="light"] body.legal-redesign {
    background:
        linear-gradient(135deg, rgba(248, 250, 252, 0.98) 0%, rgba(239, 246, 255, 0.98) 46%, rgba(255, 247, 237, 0.98) 100%),
        #f8fafc;
}

.legal-redesign .legal-shell-wide {
    width: min(1180px, 100%);
    padding: 28px 20px 54px;
}

.legal-hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 24px;
    align-items: stretch;
    min-height: 356px;
    padding: clamp(24px, 5vw, 52px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 58, 138, 0.54)),
        linear-gradient(90deg, rgba(245, 158, 11, 0.12), transparent);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
    overflow: hidden;
}

[data-theme="light"] .legal-hero-panel {
    border-color: rgba(30, 58, 138, 0.16);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.88)),
        linear-gradient(90deg, rgba(180, 83, 9, 0.1), transparent);
    box-shadow: 0 22px 52px rgba(30, 58, 138, 0.13);
}

.legal-hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.legal-eyebrow {
    margin: 0 0 14px;
    color: #facc15;
    font-weight: 900;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

[data-theme="light"] .legal-eyebrow {
    color: #92400e;
}

.legal-hero-panel h1,
.legal-document-card h2,
.legal-document-card h3 {
    font-family: "EB Garamond", Georgia, serif;
}

.legal-hero-panel h1 {
    max-width: 760px;
    margin: 0;
    color: #fff7ed;
    font-size: clamp(2.35rem, 7vw, 5.4rem);
    line-height: 0.95;
    letter-spacing: 0;
    font-weight: 700;
}

[data-theme="light"] .legal-hero-panel h1 {
    color: #0f172a;
}

.legal-hero-lede {
    max-width: 760px;
    margin: 20px 0 0;
    color: rgba(232, 237, 246, 0.86);
    font-size: clamp(1.02rem, 2vw, 1.18rem);
    line-height: 1.68;
}

[data-theme="light"] .legal-hero-lede {
    color: #334155;
}

.legal-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.legal-chip-row span {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border: 1px solid rgba(250, 204, 21, 0.26);
    border-radius: 999px;
    background: rgba(250, 204, 21, 0.08);
    color: #fff7ed;
    font-weight: 800;
    font-size: 0.82rem;
}

[data-theme="light"] .legal-chip-row span {
    border-color: rgba(146, 64, 14, 0.18);
    background: rgba(255, 247, 237, 0.8);
    color: #1e3a8a;
}

.legal-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.legal-action-primary,
.legal-action-secondary {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.94rem;
    font-weight: 900;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
    cursor: pointer;
}

.legal-action-primary {
    background: #b45309;
    color: #fff7ed;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.legal-action-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff7ed;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.legal-action-primary:hover,
.legal-action-primary:focus-visible {
    background: #d97706;
}

.legal-action-secondary:hover,
.legal-action-secondary:focus-visible {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(250, 204, 21, 0.38);
}

[data-theme="light"] .legal-action-secondary {
    color: #1e3a8a;
    background: rgba(255, 255, 255, 0.84);
    border-color: rgba(30, 58, 138, 0.16);
}

.legal-hero-panel-card {
    display: flex;
    flex-direction: column;
    justify-content: end;
    gap: 8px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .legal-hero-panel-card {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(30, 58, 138, 0.15);
}

.legal-seal,
.legal-trust-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #facc15;
    background: rgba(250, 204, 21, 0.1);
    border: 1px solid rgba(250, 204, 21, 0.24);
}

.legal-seal svg,
.legal-trust-icon svg {
    width: 23px;
    height: 23px;
}

.legal-hero-panel-card p {
    margin: 12px 0 0;
    color: rgba(232, 237, 246, 0.68);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 900;
}

.legal-hero-panel-card strong {
    color: #fff7ed;
    font-size: 1.16rem;
    line-height: 1.1;
}

[data-theme="light"] .legal-hero-panel-card p {
    color: #64748b;
}

[data-theme="light"] .legal-hero-panel-card strong,
[data-theme="light"] .legal-seal,
[data-theme="light"] .legal-trust-icon {
    color: #92400e;
}

.legal-trust-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.legal-trust-card {
    min-height: 190px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.76);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

[data-theme="light"] .legal-trust-card {
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(30, 58, 138, 0.12);
    box-shadow: 0 16px 32px rgba(30, 58, 138, 0.1);
}

.legal-trust-card h2 {
    margin: 14px 0 7px;
    color: #fff7ed;
    font-size: 1rem;
    line-height: 1.25;
}

.legal-trust-card p {
    margin: 0;
    color: rgba(232, 237, 246, 0.72);
    font-size: 0.92rem;
    line-height: 1.58;
}

[data-theme="light"] .legal-trust-card h2 {
    color: #0f172a;
}

[data-theme="light"] .legal-trust-card p {
    color: #475569;
}

.legal-content-grid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.legal-toc {
    position: sticky;
    top: 92px;
}

.legal-toc-inner {
    max-height: calc(100vh - 118px);
    overflow: auto;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.76);
}

[data-theme="light"] .legal-toc-inner {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(30, 58, 138, 0.13);
}

.legal-toc p {
    margin: 0 0 12px;
    color: #facc15;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

[data-theme="light"] .legal-toc p {
    color: #92400e;
}

.legal-toc nav {
    display: grid;
    gap: 2px;
}

.legal-toc a {
    display: block;
    padding: 8px 9px;
    border-radius: 7px;
    color: rgba(232, 237, 246, 0.78);
    text-decoration: none;
    font-size: 0.83rem;
    line-height: 1.28;
    font-weight: 700;
}

.legal-toc a:hover,
.legal-toc a:focus-visible {
    color: #fff7ed;
    background: rgba(250, 204, 21, 0.1);
}

[data-theme="light"] .legal-toc a {
    color: #334155;
}

[data-theme="light"] .legal-toc a:hover,
[data-theme="light"] .legal-toc a:focus-visible {
    color: #0f172a;
    background: rgba(30, 58, 138, 0.08);
}

.legal-redesign .legal-document-card {
    border-radius: 8px;
    padding: clamp(22px, 4vw, 42px);
    background: rgba(15, 23, 42, 0.86);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.24);
}

[data-theme="light"] .legal-redesign .legal-document-card {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(30, 58, 138, 0.12);
    box-shadow: 0 22px 52px rgba(30, 58, 138, 0.1);
}

.legal-document-card h2 {
    scroll-margin-top: 96px;
    margin: 34px 0 10px;
    color: #fff7ed;
    font-size: clamp(1.38rem, 2.3vw, 2rem);
    line-height: 1.08;
}

.legal-document-card h2:first-child {
    margin-top: 0;
}

.legal-document-card h3 {
    scroll-margin-top: 96px;
    color: #fde68a;
    font-size: 1.18rem;
}

.legal-document-card p,
.legal-document-card li {
    max-width: 76ch;
    color: rgba(232, 237, 246, 0.82);
    font-size: 1rem;
    line-height: 1.74;
}

.legal-document-card ul {
    max-width: 76ch;
}

[data-theme="light"] .legal-document-card h2 {
    color: #0f172a;
}

[data-theme="light"] .legal-document-card h3 {
    color: #92400e;
}

[data-theme="light"] .legal-document-card p,
[data-theme="light"] .legal-document-card li {
    color: #334155;
}

.legal-redesign .legal-table-wrap {
    border-radius: 8px;
    border-color: rgba(255, 255, 255, 0.14);
}

.legal-redesign .legal-table {
    background: rgba(255, 255, 255, 0.04);
}

.legal-redesign .legal-table th {
    color: #fff7ed;
    background: rgba(180, 83, 9, 0.35);
}

.legal-redesign .legal-table td,
.legal-redesign .legal-table th {
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .legal-redesign .legal-table-wrap,
[data-theme="light"] .legal-redesign .legal-table td,
[data-theme="light"] .legal-redesign .legal-table th {
    border-color: rgba(30, 58, 138, 0.13);
}

[data-theme="light"] .legal-redesign .legal-table th {
    color: #0f172a;
    background: rgba(219, 234, 254, 0.75);
}

.legal-redesign .legal-note {
    border-radius: 8px;
    background: rgba(180, 83, 9, 0.18);
    border-color: rgba(250, 204, 21, 0.22);
    color: #fff7ed;
}

[data-theme="light"] .legal-redesign .legal-note {
    background: rgba(255, 247, 237, 0.9);
    border-color: rgba(146, 64, 14, 0.18);
    color: #7c2d12;
}

.legal-redesign a:focus-visible,
.legal-redesign button:focus-visible {
    outline: 3px solid rgba(250, 204, 21, 0.72);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .legal-action-primary,
    .legal-action-secondary {
        transition: none;
    }
}

@media (max-width: 1020px) {
    .legal-hero-panel {
        grid-template-columns: 1fr;
    }

    .legal-hero-panel-card {
        min-height: 180px;
    }

    .legal-trust-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .legal-content-grid {
        grid-template-columns: 1fr;
    }

    .legal-toc {
        position: static;
    }

    .legal-toc-inner {
        max-height: none;
    }

    .legal-toc nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .legal-redesign .legal-shell-wide {
        padding: 18px 14px 44px;
    }

    .legal-hero-panel {
        min-height: 0;
        gap: 16px;
        padding: 20px;
    }

    .legal-hero-panel h1 {
        font-size: clamp(2.12rem, 12vw, 3rem);
    }

    .legal-hero-lede {
        margin-top: 14px;
        font-size: 0.98rem;
        line-height: 1.55;
    }

    .legal-chip-row {
        gap: 8px;
        margin-top: 16px;
    }

    .legal-chip-row span {
        width: auto;
        min-height: 30px;
        font-size: 0.76rem;
        padding: 6px 9px;
    }

    .legal-hero-actions {
        margin-top: 18px;
        gap: 9px;
    }

    .legal-action-primary,
    .legal-action-secondary {
        flex: 1 1 150px;
    }

    .legal-hero-panel-card {
        display: grid;
        grid-template-columns: 44px 1fr 1fr;
        align-items: center;
        column-gap: 11px;
        row-gap: 4px;
        min-height: 0;
        padding: 16px;
    }

    .legal-hero-panel-card .legal-seal {
        grid-row: 1 / 5;
    }

    .legal-hero-panel-card p {
        margin: 0;
        font-size: 0.7rem;
    }

    .legal-hero-panel-card strong {
        font-size: 1rem;
    }

    .legal-trust-grid,
    .legal-toc nav {
        grid-template-columns: 1fr;
    }

    .legal-trust-card {
        min-height: 0;
    }

    .legal-document-card p,
    .legal-document-card li {
        font-size: 0.98rem;
    }
}
