/* ==========================================================================
   Дизайн-токены проекта (перенос палитры/шрифтов образца в чистый CSS)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Шрифты */
    --font-sans: 'Inter', sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Брендовые цвета */
    --brand: #00bfa5;
    --brand-hover: #00a18b;
    --brand-light: #e0f2f1;

    /* Teal-шкала */
    --teal-50: #f0fdfa;
    --teal-100: #ccfbf1;
    --teal-200: #99f6e4;
    --teal-400: #2dd4bf;
    --teal-500: #14b8a6;
    --teal-600: #0d9488;
    --teal-700: #0f766e;
    --teal-900: #134e4a;
    --teal-950: #042f2e;

    /* Slate-шкала */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;

    /* Акцентные шкалы */
    --rose-50: #fff1f2;
    --rose-200: #fecdd3;
    --rose-400: #fb7185;
    --rose-500: #f43f5e;
    --rose-600: #e11d48;

    --emerald-50: #ecfdf5;
    --emerald-200: #a7f3d0;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;

    --amber-50: #fffbeb;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --amber-700: #b45309;
    --amber-900: #854d0e;

    --blue-50: #eff6ff;
    --blue-500: #3b82f6;

    --purple-50: #faf5ff;
    --purple-500: #a855f7;

    /* Радиусы */
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-3xl: 24px;

    /* Тени */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-teal: 0 10px 15px -3px rgba(20, 184, 166, 0.2);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--slate-800);
    background: var(--slate-50);
    -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }
a { color: inherit; }

/* Тонкий скроллбар, как в образце */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--slate-100); }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }

/* ==========================================================================
   Общая шапка сайта (гостевая и авторизованная)
   ========================================================================== */
.ln-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #ffffff;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow-xs);
}
/* Колонка шапки = колонка доски (.container в pages/Scanner.css: 1750 px + padding
   30 px), чтобы логотип и правая группа сидели вровень с краями панелей, а не
   жались в 1280 px по центру (задача #630). */
.ln-header-inner {
    max-width: 1750px;
    margin: 0 auto;
    padding: 0 30px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ln-logo-group {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
}
.ln-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-lg);
    background: var(--teal-500);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 6px rgba(20, 184, 166, 0.12);
    transition: background-color 0.15s;
}
.ln-logo-group:hover .ln-logo { background: var(--teal-600); }
.ln-logo-img {
    width: 32px;
    height: 32px;
    display: block;
    flex-shrink: 0;
}
.ln-logo-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--slate-900);
    letter-spacing: -0.02em;
}

/* Гостевая навигация */
.ln-guest-nav {
    display: flex;
    gap: 32px;
    align-items: center;
}
.ln-guest-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
    padding: 0;
}
.ln-guest-link:hover { color: var(--teal-500); }
.ln-guest-actions { display: flex; gap: 12px; align-items: center; }
.ln-btn-ghost {
    color: var(--slate-600);
    font-size: 12px;
    font-weight: 700;
    padding: 8px 16px;
    text-decoration: none;
    transition: color 0.15s;
}
.ln-btn-ghost:hover { color: var(--slate-900); }
.ln-btn-dark {
    background: var(--slate-900);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    box-shadow: var(--shadow-xs);
    transition: background-color 0.15s;
}
.ln-btn-dark:hover { background: var(--slate-800); }

/* Навигация вошедшего пользователя */
.ln-user-right { display: flex; align-items: center; gap: 16px; }
/* На широком экране обёртка двух служебных кнопок не меняет существующий flex. */
.ln-session-actions { display: contents; }
.ln-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--teal-50);
    border: 1px solid var(--teal-100);
    color: var(--teal-700);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.ln-badge-ico { width: 12px; height: 12px; color: var(--teal-500); animation: ln-pulse 2s ease-in-out infinite; }
@keyframes ln-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.ln-account-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: var(--radius-lg);
    color: var(--slate-600);
    text-decoration: none;
    transition: all 0.15s;
}
.ln-account-link:hover { background: var(--slate-50); color: var(--slate-900); }
.ln-account-link.active {
    background: var(--teal-500);
    color: #ffffff;
    box-shadow: var(--shadow-teal);
}
/* Плашка модератора — фиолетовый акцент (админ остаётся teal-овым): панели разные,
   акцент тоже разный (решение владельца, задача №1). */
.ln-account-link.mod.active {
    background: var(--purple-500);
    box-shadow: 0 4px 12px -2px rgba(168, 85, 247, 0.45);
}
/* Счётчик непрочитанных обращений поддержки. Рендерится ТОЛЬКО при unread > 0,
   поэтому «ноль» и «статистика недоступна» неразличимы намеренно. min-width
   держит место: одна цифра и «99+» не сдвигают соседние пункты шапки. */
.ln-sup-badge {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 9999px;
    background: var(--rose-500);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.22);
}
.ln-logout-btn {
    background: none;
    border: none;
    color: var(--slate-400);
    padding: 5px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s;
}
.ln-logout-btn:hover { color: var(--rose-600); }

/* ==========================================================================
   Правая группа шапки, перенесённая с главной (задача #628): геометрия и
   цвета взяты один-в-один с главной и переписаны обычным CSS — здесь нет
   Tailwind. Селектор языка на главной живёт на зелёной палитре --site-*,
   почта и плашка — на slate; перенесено так же.
   ========================================================================== */
.ln-language-picker {
    position: relative;
    width: 86px;
    max-width: 100%;
    flex-shrink: 0;
}
.ln-language {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: #15221f;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
.ln-language-chevron { flex: none; color: #52635e; }
.ln-language[aria-expanded="true"] .ln-language-chevron { transform: rotate(180deg); }
/* Слой общий со страницей (портал в document.body): координаты top/left считает
   компонент. z 10001 — как у модалки сканера, чтобы список перекрывал ленту
   разделов (z 10000), а не прятался под ней. */
.ln-language-menu {
    position: fixed;
    z-index: 10001;
    width: 112px;
    margin: 0;
    padding: 7px 0;
    list-style: none;
    border: 1px solid #dce4e1;
    border-radius: 9px;
    background: #ffffff;
    color: #15221f;
    box-shadow: 0 5px 20px rgba(21, 34, 31, 0.07);
}
.ln-language-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 30px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
    cursor: pointer;
}
.ln-language-option.is-active { background: #f1f5f4; }
.ln-language-check { flex: none; color: #007a5a; }

.ln-account-email {
    font-size: 13px;
    font-weight: 500;
    color: var(--slate-700);
    max-width: 220px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.ln-access-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    background: var(--slate-100);
    color: var(--slate-500);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
/* Активная подписка — тот же teal, что на главной, в обеих темах. */
.ln-access-badge.premium {
    background: rgba(0, 184, 135, 0.1);
    border-color: rgba(0, 184, 135, 0.25);
    color: #00B887;
}
.ln-access-days { font-family: var(--font-mono); opacity: 0.8; }

/* То же правило, что на главной (701–1100px): в неширокой шапке группа ужата,
   а почта скрыта ниже 1024px. Без этого логотип и кнопки не влезают в 1024px
   и правый край шапки обрезается. */
@media (min-width: 701px) and (max-width: 1100px) {
    .ln-user-right { gap: 8px; }
    .ln-language-picker { width: 78px; }
    .ln-language { padding-inline: 4px; font-size: 12px; }
    .ln-access-badge { gap: 4px; padding-inline: 8px; font-size: 10px; }
    .ln-account-email { max-width: 170px; font-size: 12px; }
}
@media (min-width: 701px) and (max-width: 1023px) {
    .ln-account-email { display: none; }
}

/* Размеры иконок */
.i-3 { width: 12px; height: 12px; }
.i-35 { width: 14px; height: 14px; }
.i-4 { width: 16px; height: 16px; }
.i-45 { width: 18px; height: 18px; }
.i-5 { width: 20px; height: 20px; }
.i-6 { width: 24px; height: 24px; }
.i-10 { width: 40px; height: 40px; }

/* ==========================================================================
   Страница-заглушка «Графики доступны на платных тарифах» (ошибка 402)
   ========================================================================== */
.paywall {
    min-height: 100vh;
    background: var(--slate-50);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
}
.paywall-card {
    max-width: 460px;
    width: 100%;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: 48px 40px;
    text-align: center;
}
.paywall-ico {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    border-radius: var(--radius-xl);
    background: var(--teal-50);
    color: var(--teal-500);
    display: flex;
    align-items: center;
    justify-content: center;
}
.paywall-title {
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--slate-900);
    letter-spacing: -0.02em;
}
.paywall-text {
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--slate-500);
}
.paywall-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--teal-500);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: var(--radius-xl);
    text-decoration: none;
    box-shadow: var(--shadow-teal);
    transition: all 0.15s;
}
.paywall-btn:hover { background: var(--teal-600); transform: translateY(-1px); }

/* ==========================================================================
   Узкий экран (задача #372): общая шапка на телефоне переносится в две строки,
   иначе плашки «Личный кабинет» / «Админ» не влезают в 390px и режут логотип.
   ========================================================================== */
@media (max-width: 700px) {
    .ln-header-inner { height: auto; min-height: 52px; padding: 8px 12px; row-gap: 8px; flex-wrap: wrap; }
    .ln-logo-name { font-size: 16px; }
    .ln-user-right { width: 100%; gap: 6px; justify-content: space-between; flex-wrap: wrap; }
    .ln-account-link { font-size: 12px; padding: 11px 14px; min-height: 44px; }
    /* Отдельная строка под навигацией: переключатель темы напротив выхода. */
    .ln-session-actions {
        display: flex;
        flex: 0 0 100%;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        order: 100;
    }
    .ln-logout-btn { margin-left: 0; min-width: 44px; min-height: 44px; justify-content: center; }
    .ln-logo-group { padding: 6px 0; margin: -6px 0; }
    /* Как на главной (isNarrow): язык, почта и плашка доступа в тесной шапке не
       помещаются — скрыты; переключатель темы и выход остаются. */
    .ln-language-picker, .ln-account-email, .ln-access-badge { display: none; }
}

/* ==========================================================================
   Юридические страницы — редакционная подача документа:
   липкая боковая навигация + аккуратная типографика на светлом фоне.
   ========================================================================== */

.lg-page {
    min-height: 100vh;
    background: var(--slate-50);
    font-family: var(--font-sans);
    color: var(--slate-800);
    display: flex;
    flex-direction: column;
}

/* Шапка */
.lg-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #ffffff;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow-xs);
}
.lg-header-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.lg-logo-group {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.lg-logo-img {
    width: 32px;
    height: 32px;
    display: block;
    flex-shrink: 0;
}
.lg-logo-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--slate-900);
    letter-spacing: -0.02em;
}
.lg-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--slate-500);
    text-decoration: none;
    transition: color 0.15s;
}
.lg-back:hover { color: var(--teal-600); }

/* Основная область */
.lg-main { flex: 1; padding: 40px 24px 64px; }
.lg-layout {
    max-width: 72rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: start;
}
@media (min-width: 900px) {
    .lg-layout { grid-template-columns: 240px 1fr; gap: 48px; }
}

/* Боковая навигация */
.lg-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
@media (min-width: 900px) {
    .lg-nav {
        position: sticky;
        top: 92px;
        flex-direction: column;
        flex-wrap: nowrap;
    }
}
.lg-nav-item {
    display: block;
    padding: 10px 16px;
    border-radius: var(--radius-xl);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--slate-500);
    text-decoration: none;
    border: 1px solid transparent;
    background: #ffffff;
    transition: all 0.15s;
}
.lg-nav-item:hover { color: var(--slate-900); border-color: var(--slate-200); }
.lg-nav-item.active {
    color: var(--teal-700);
    background: var(--teal-50);
    border-color: var(--teal-100);
}

/* Документ */
.lg-doc {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-2xl);
    box-shadow: 0 20px 40px -20px rgba(15, 23, 42, 0.14);
    padding: 40px 32px;
    max-width: 46rem;
}
@media (min-width: 640px) { .lg-doc { padding: 48px 44px; } }

.lg-doc-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--slate-100);
}
.lg-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 30px;
    line-height: 1.15;
    font-weight: 700;
    color: var(--slate-900);
    letter-spacing: -0.02em;
}
.lg-updated {
    font-size: 12px;
    font-weight: 600;
    color: var(--slate-400);
    letter-spacing: 0.02em;
}

.lg-intro {
    margin: 0 0 28px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--slate-600);
}

.lg-section { margin-bottom: 28px; }
.lg-section:last-of-type { margin-bottom: 0; }
.lg-section-title {
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--slate-900);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.lg-section-title::before {
    content: '';
    width: 6px;
    height: 18px;
    border-radius: 3px;
    background: var(--teal-400);
    flex-shrink: 0;
}
.lg-section-text {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--slate-600);
}

.lg-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.lg-list li {
    position: relative;
    padding-left: 22px;
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--slate-600);
}
.lg-list li + li { margin-top: 8px; }
.lg-list-dot {
    position: absolute;
    left: 2px;
    top: 9px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--teal-400);
}

.lg-doc-foot {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid var(--slate-100);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--slate-400);
}
.lg-mail {
    color: var(--teal-600);
    text-decoration: none;
    font-weight: 600;
}
.lg-mail:hover { text-decoration: underline; }

/* ==========================================================================
   Телефон (≤700 px) — задача #385. По горизонтали ничего не вылезало и в
   десктопной разметке, но на 390 px: пять пилюль переключателя вставали в три
   ряда над документом, а поля карточки оставляли только 273 px текста.
   Полоса навигации — тот же приём, что у ленты разделов сканера (#375):
   одна строка с прокруткой вместо переноса.
   ========================================================================== */
@media (max-width: 700px) {
    .lg-header-inner { height: 56px; padding: 0 16px; gap: 10px; }
    .lg-logo-name { font-size: 17px; }
    .lg-main { padding: 20px 12px 48px; }
    .lg-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px;
        padding: 0 12px 4px;
    }
    .lg-nav::-webkit-scrollbar { display: none; }
    .lg-nav-item { flex: 0 0 auto; padding: 13px 16px; white-space: nowrap; }
    .lg-doc { padding: 26px 18px; border-radius: 18px; }
    .lg-title { font-size: 23px; }
    .lg-section-title { font-size: 17px; }
    .lg-doc-foot { flex-direction: column; align-items: flex-start; }
    .lg-back, .lg-mail { min-height: 44px; display: inline-flex; align-items: center; }
    .lg-logo-group { padding: 6px 0; margin: -6px 0; }
}

/* Hallmark · existing public system · shape: Long Document · theme: green brand (preserved) · copy: verbatim · surface: absolute · posture: restrained · nav: document index · footer: existing document contacts · hero: document title */
/* Critique: the old nested card narrowed long clauses; remove its frame, align the document and keep the index quiet. */

/* Только публичные юридические страницы. Исходники документов и рабочего приложения не меняются. */
:root {
  --legal-background: #fafbfb;
  --legal-surface: #fff;
  --legal-muted-surface: #f1f5f4;
  --legal-text: #15221f;
  --legal-muted: #52635e;
  --legal-border: #dce4e1;
  --legal-accent: #007a5a;
  --legal-dark-background: #171b1e;
  --legal-dark-surface: #171b1e;
  --legal-dark-muted-surface: #1c2226;
  --legal-dark-text: #e8ecee;
  --legal-dark-muted: #939da4;
  --legal-dark-border: #2c3337;
  --legal-dark-accent: #50dfb0;
  --legal-dark-active-bg: #1a2c28;
  --legal-dark-active-fg: #76c7b3;
  --legal-font: var(--font-sans);
  --legal-active-bg: var(--legal-muted-surface);
  --legal-active-fg: var(--legal-accent);
  color-scheme: light;
}
:root.dark {
  --legal-background: var(--legal-dark-background);
  --legal-surface: var(--legal-dark-surface);
  --legal-muted-surface: var(--legal-dark-muted-surface);
  --legal-text: var(--legal-dark-text);
  --legal-muted: var(--legal-dark-muted);
  --legal-border: var(--legal-dark-border);
  --legal-accent: var(--legal-dark-accent);
  --legal-active-bg: var(--legal-dark-active-bg);
  --legal-active-fg: var(--legal-dark-active-fg);
  color-scheme: dark;
}
/* Без JavaScript документы читаются целиком, а тема следует настройке системы. */
@media (prefers-color-scheme: dark) {
  :root:not([data-legal-theme]) {
    --legal-background: var(--legal-dark-background);
    --legal-surface: var(--legal-dark-surface);
    --legal-muted-surface: var(--legal-dark-muted-surface);
    --legal-text: var(--legal-dark-text);
    --legal-muted: var(--legal-dark-muted);
    --legal-border: var(--legal-dark-border);
    --legal-accent: var(--legal-dark-accent);
    --legal-active-bg: var(--legal-dark-active-bg);
    --legal-active-fg: var(--legal-dark-active-fg);
    color-scheme: dark;
  }
}
html, body { overflow-x: clip; }
html { scroll-padding-top: 88px; }
body { background: var(--legal-background); color: var(--legal-text); }
.lg-page { background: var(--legal-background); color: var(--legal-text); font-family: var(--legal-font); }
.lg-page a:focus-visible { outline: 2px solid var(--legal-accent); outline-offset: 4px; }
.lg-header { background: var(--legal-surface); border-bottom: 1px solid var(--legal-border); box-shadow: none; }
.lg-header-inner { max-width: 1184px; height: 64px; padding-inline: 24px; }
.lg-logo-name { font-family: var(--legal-font); color: var(--legal-text); font-weight: 650; letter-spacing: -.025em; }
.lg-logo-group { min-height: 44px; min-width: 0; }
.lg-logo-img { width: 28px; height: 28px; }
.lg-back { min-height: 44px; color: var(--legal-muted); font-size: 14px; font-weight: 550; flex: none; }
.lg-back svg { width: 16px; height: 16px; }
.lg-back:hover { color: var(--legal-accent); }
.lg-main { padding: 52px 24px 80px; }
.lg-layout { max-width: 1120px; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; }
.lg-nav { position: sticky; top: 100px; flex-direction: column; flex-wrap: nowrap; gap: 6px; }
.lg-nav-item { padding: 12px 16px; min-height: 44px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--legal-muted); font-size: 14px; font-weight: 550; line-height: 1.5; transition: background-color 150ms, color 150ms; }
.lg-nav-item:hover { background: var(--legal-muted-surface); border-color: transparent; color: var(--legal-text); }
.lg-nav-item.active { color: var(--legal-active-fg); background: var(--legal-active-bg); border-color: transparent; }
.lg-doc { min-width: 0; width: 100%; max-width: 760px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.lg-doc-head { gap: 16px; padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--legal-border); }
.lg-title { min-width: 0; overflow-wrap: break-word; font-family: var(--legal-font); color: var(--legal-text); font-size: clamp(30px, 3.3vw, 44px); font-weight: 650; letter-spacing: -.035em; line-height: 1.16; text-wrap: balance; }
.lg-updated { color: var(--legal-muted); font-size: 13px; font-weight: 400; line-height: 1.6; letter-spacing: normal; }
.lg-intro { font-size: 17px; color: var(--legal-muted); line-height: 1.8; margin-bottom: 36px; }
.lg-section { margin-bottom: 36px; }
.lg-section-title { display: block; min-width: 0; overflow-wrap: break-word; font-family: var(--legal-font); color: var(--legal-text); font-size: 20px; font-weight: 600; line-height: 1.45; letter-spacing: -.02em; margin-bottom: 16px; }
.lg-section-title::before { content: none; }
.lg-section-text, .lg-list li { padding-left: 0; color: var(--legal-muted); font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
.lg-list li + li { margin-top: 12px; }
.lg-list-dot { display: none; }
.lg-doc-foot { margin-top: 48px; padding-top: 24px; gap: 16px 24px; border-top: 1px solid var(--legal-border); color: var(--legal-muted); font-size: 13px; line-height: 1.7; justify-content: flex-start; }
.lg-mail { color: var(--legal-accent); font-size: 14px; font-weight: 550; line-height: 1.7; text-decoration: underline; text-underline-offset: 4px; overflow-wrap: anywhere; }
.lg-mail:hover { text-decoration-thickness: 2px; }
.lg-page ::selection { background: var(--legal-muted-surface); color: var(--legal-text); }
::-webkit-scrollbar-track { background: var(--legal-background); }
::-webkit-scrollbar-thumb { background: var(--legal-border); }
::-webkit-scrollbar-thumb:hover { background: var(--legal-muted); }
@media (max-width: 899px) {
  .lg-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .lg-doc { max-width: none; }
  .lg-nav { position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; overflow: visible; }
  .lg-nav-item { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 700px) {
  .lg-header-inner { height: 60px; padding-inline: 20px; gap: 12px; }
  .lg-logo-name { font-size: 17px; }
  .lg-back { font-size: 13px; gap: 5px; }
  .lg-main { padding: 28px 20px 56px; }
  .lg-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg-nav-item { padding: 10px 12px; }
  .lg-doc { padding: 0; border-radius: 0; }
  .lg-doc-head { gap: 14px; padding-bottom: 24px; margin-bottom: 24px; }
  .lg-title { font-size: 30px; }
  .lg-intro { font-size: 16px; }
  .lg-section-title { font-size: 19px; }
  .lg-doc-foot { align-items: flex-start; }
}
@media (max-width: 380px) {
  .lg-header-inner { height: auto; min-height: 60px; flex-wrap: wrap; gap: 0 12px; padding-block: 8px; }
  .lg-back { margin-left: 36px; min-height: 36px; }
  .lg-title { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lg-page a { transition: none; }
}
/* Language remains available on static legal pages without hydrating the SPA. */
.lg-language {
  margin-left: auto;
  min-width: 108px;
  border: 1px solid var(--line, #d7dee8);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text, #172033);
  padding: 7px 30px 7px 10px;
  font: inherit;
  cursor: pointer;
}

.dark .lg-language {
  background: var(--surface, #151b27);
  color: var(--text, #f4f7fb);
}
