/* ======= system-page (Medium Style) ======= */

.system-page {
    padding-top: calc(88px + var(--space-10)); /* Отступ под хедер + дополнительный отступ */
    padding-bottom: var(--space-20);
    background: var(--bg-primary);
    min-height: 100vh;
}

.system-page__container {
    max-width: 680px; /* Medium оптимальная ширина для чтения (50-75 символов) */
    padding: 0 var(--space-6);
    margin: 0 auto;
}

.system-page__title {
    color: var(--text-primary);
    font-size: clamp(42px, 5vw, 48px);
    font-style: normal;
    font-weight: 700;
    line-height: 1.15; /* Medium использует более плотный line-height для заголовков */
    letter-spacing: -0.02em;
    margin-bottom: var(--space-8);
    margin-top: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.system-page__content {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 21px; /* Medium использует 21px для основного текста */
    line-height: 1.58; /* Medium оптимальный line-height для чтения */
    font-weight: 400;
    font-family: 'Charter', 'Georgia', 'Times New Roman', serif; /* Medium использует serif для основного текста */
    letter-spacing: -0.003em; /* Небольшой negative letter-spacing для лучшей читаемости */
}

.system-page__content *:first-child {
    margin-top: 0;
}

.system-page__content h2 {
    margin-top: 56px; /* Medium использует большие отступы между секциями */
    margin-bottom: 8px;
    font-size: 28px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.016em;
    padding-top: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.system-page__content h3 {
    margin-top: 40px;
    margin-bottom: 6px;
    font-size: 24px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    letter-spacing: -0.014em;
    padding-top: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.system-page__content h4,
.system-page__content h5,
.system-page__content h6 {
    margin-top: 32px;
    margin-bottom: 4px;
    font-size: 20px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    padding-top: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: -0.011em;
}

.system-page__content p {
    margin-bottom: 29px; /* Medium использует большие отступы между параграфами */
    margin-top: 0;
    color: var(--text-primary);
    font-size: 21px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.58;
    letter-spacing: -0.003em;
    font-family: 'Charter', 'Georgia', 'Times New Roman', serif;
}

.system-page__content b,
.system-page__content strong {
    font-weight: 700; /* Medium использует bold (700) для акцентов */
    color: var(--text-primary);
}

.system-page__content a {
    font-weight: 400;
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(10, 132, 255, 0.3);
    transition: border-color var(--transition-base);
}

.system-page__content a:hover {
    color: var(--color-primary-hover);
    border-bottom-color: var(--color-primary-hover);
}

/* Email адреса в стиле Medium */
.system-page__content a[href^="mailto:"] {
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 400;
    word-break: break-all; /* Перенос длинных email адресов */
}

.system-page__content a[href^="mailto:"]:hover {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Стилизация email адресов без ссылок (просто текст) */
.system-page__content p:has-text("email:") {
    margin-bottom: 29px;
}

/* Улучшение отображения email в контексте "Owner contact email:" */
.system-page__content p b + span,
.system-page__content p strong + span {
    display: inline;
    word-break: break-all;
}

.system-page__content ul {
    margin: 0;
    margin-bottom: 29px;
    padding: 0;
    padding-left: 0;
    list-style: none;
}

.system-page__content ul>li {
    display: list-item;
    padding-left: 0;
    margin-left: 24px;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 21px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.58;
    letter-spacing: -0.003em;
    font-family: 'Charter', 'Georgia', 'Times New Roman', serif;
    list-style: disc;
    list-style-position: outside;
}

.system-page__content ul>li:last-child {
    margin-bottom: 0;
}

.system-page__content ul>li::marker {
    color: var(--text-primary);
    font-size: 21px;
}

.system-page__content ol {
    margin: 0;
    margin-bottom: 29px;
    padding: 0;
    padding-left: 0;
    list-style: none;
}

.system-page__content ol>li {
    display: list-item;
    padding-left: 0;
    margin-left: 24px;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 21px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.58;
    letter-spacing: -0.003em;
    font-family: 'Charter', 'Georgia', 'Times New Roman', serif;
    list-style: decimal;
    list-style-position: outside;
}

.system-page__content ol>li::marker {
    color: var(--text-primary);
    font-size: 21px;
    font-weight: 400;
}

.system-page__content ol>li:last-child {
    margin-bottom: 0;
}

.system-page__content blockquote {
    margin: 29px 0;
    padding: 0;
    padding-left: 20px;
    border-left: 3px solid var(--border-primary);
    color: var(--text-primary);
    font-size: 21px;
    font-style: normal;
    line-height: 1.58;
    background: transparent;
    border-radius: 0;
    font-family: 'Charter', 'Georgia', 'Times New Roman', serif;
    letter-spacing: -0.003em;
}

.system-page__content table {
    width: 100%;
    margin: var(--space-6) 0;
    border-collapse: collapse;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-m);
    overflow: hidden;
}

.system-page__content table th,
.system-page__content table td {
    padding: var(--space-4) var(--space-5);
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
}

.system-page__content table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.system-page__content table td {
    color: var(--text-secondary);
}

.system-page__content table tr:last-child td {
    border-bottom: none;
}

.system-page__content hr {
    margin: var(--space-12) 0;
    border: none;
    border-top: 1px solid var(--border-primary);
    background: none;
}

.system-page__content code {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: var(--radius-s);
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.system-page__content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-m);
    padding: var(--space-5);
    overflow-x: auto;
    margin: var(--space-6) 0;
    font-size: var(--font-size-sm);
    line-height: 1.6;
}

.system-page__content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: var(--text-primary);
}

.system-page__content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-m);
    margin: var(--space-6) 0;
}

/* Переопределение inline стилей из Word документа в Privacy Policy - Medium style */
.system-page__content p[class="Default"],
.system-page__content p.Default {
    margin-top: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 29px !important;
    margin-left: 0 !important;
    line-height: 1.58 !important;
    color: var(--text-primary) !important;
    font-size: 21px !important;
    font-weight: 400 !important;
    letter-spacing: -0.003em !important;
    font-family: var(--font-family) !important;
}

.system-page__content p[class="Default"] span,
.system-page__content p.Default span,
.system-page__content span[lang] {
    color: var(--text-primary) !important;
    font-size: 21px !important;
    font-weight: 400 !important;
    line-height: 1.58 !important;
    font-family: 'Charter', 'Georgia', 'Times New Roman', serif !important;
    letter-spacing: -0.003em !important;
}

.system-page__content p[class="Default"] b,
.system-page__content p.Default b,
.system-page__content p[class="Default"] strong,
.system-page__content p.Default strong,
.system-page__content span[lang] b,
.system-page__content span[lang] strong {
    color: var(--text-primary) !important;
    font-size: 21px !important;
    font-weight: 700 !important;
}

/* Заголовки внутри параграфов с классом Default - Medium style */
.system-page__content p[class="Default"] b span[style*="font-size:17.0pt"],
.system-page__content p.Default b span[style*="font-size:17.0pt"],
.system-page__content p[class="Default"] b span[style*="font-size:19.0pt"],
.system-page__content p.Default b span[style*="font-size:19.0pt"] {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    display: block;
    margin-top: 56px !important;
    margin-bottom: 8px !important;
    padding-top: 0 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.016em !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
}

/* Убираем ненужные классы и стили */
.system-page__content .SpellE,
.system-page__content .None,
.system-page__content .GramE,
.system-page__content .Hyperlink0,
.system-page__content o\:p {
    display: none;
}

.system-page__content o\:p {
    display: none !important;
}

/* Ссылки */
.system-page__content a {
    color: var(--color-primary) !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
    font-size: var(--font-size-lg) !important;
}

.system-page__content a:hover {
    color: var(--color-primary-hover) !important;
}

/* Убираем все inline стили для цветов и размеров - Medium style */
.system-page__content [style*="color:#"],
.system-page__content [style*="color: #"],
.system-page__content [style*="font-size:"] {
    color: var(--text-primary) !important;
    font-size: 21px !important;
    line-height: 1.58 !important;
    letter-spacing: -0.003em !important;
}

/* Специальная обработка для первого параграфа с заголовком - Medium style */
.system-page__content > p[class="Default"]:first-child,
.system-page__content > p.Default:first-child {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    margin-bottom: 29px !important;
    line-height: 1.3 !important;
    letter-spacing: -0.014em !important;
}

.system-page__content > p[class="Default"]:first-child span,
.system-page__content > p.Default:first-child span {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
}

/* Breadcrumbs styling - Medium style */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 40px;
    font-size: 14px;
    color: rgba(142, 142, 147, 0.8);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.breadcrumbs__item {
    color: rgba(142, 142, 147, 0.8);
    transition: color var(--transition-base);
}

.breadcrumbs__item_link {
    color: rgba(142, 142, 147, 0.8);
    text-decoration: none;
}

.breadcrumbs__item_link:hover {
    color: var(--text-secondary);
}

.breadcrumbs__item_active {
    color: var(--text-secondary);
    font-weight: 400;
}

.breadcrumbs__item_separator {
    color: rgba(142, 142, 147, 0.6);
}

@media (max-width: 768px) {
    .system-page {
        padding-top: calc(88px + var(--space-6));
        padding-bottom: var(--space-16);
    }

    .system-page__container {
        padding: 0 var(--space-4);
    }

    .system-page__title {
        font-size: 36px;
        margin-bottom: 32px;
    }

    .breadcrumbs {
        margin-bottom: 32px;
        font-size: 13px;
    }

    .system-page__content {
        font-size: 18px; /* Medium использует 18px на мобильных */
        line-height: 1.6;
    }

    .system-page__content h2 {
        font-size: 24px;
        margin-top: 48px;
        line-height: 1.25;
    }

    .system-page__content h3 {
        font-size: 22px;
        margin-top: 36px;
        line-height: 1.3;
    }

    .system-page__content h4,
    .system-page__content h5,
    .system-page__content h6 {
        font-size: 20px;
        margin-top: 28px;
    }

    .system-page__content p {
        font-size: 18px;
        margin-bottom: 24px;
        line-height: 1.6;
    }

    .system-page__content ul>li {
        font-size: 18px;
        line-height: 1.6;
        margin-bottom: 12px;
        margin-left: 20px;
    }

    .system-page__content ul>li::marker {
        font-size: 18px;
    }

    .system-page__content ol>li {
        font-size: 18px;
        line-height: 1.6;
        margin-bottom: 12px;
        margin-left: 20px;
    }

    .system-page__content ol>li::marker {
        font-size: 18px;
    }

    .system-page__content blockquote {
        font-size: 18px;
        line-height: 1.6;
        margin: 24px 0;
        padding-left: 16px;
    }

    /* Переопределение для Privacy Policy на мобильных */
    .system-page__content p[class="Default"],
    .system-page__content p.Default {
        font-size: 18px !important;
        line-height: 1.6 !important;
        margin-bottom: 24px !important;
    }

    .system-page__content p[class="Default"] span,
    .system-page__content p.Default span,
    .system-page__content span[lang] {
        font-size: 18px !important;
        line-height: 1.6 !important;
    }

    .system-page__content p[class="Default"] b span[style*="font-size:17.0pt"],
    .system-page__content p.Default b span[style*="font-size:17.0pt"],
    .system-page__content p[class="Default"] b span[style*="font-size:19.0pt"],
    .system-page__content p.Default b span[style*="font-size:19.0pt"] {
        font-size: 24px !important;
        margin-top: 48px !important;
        line-height: 1.25 !important;
    }

    .system-page__content > p[class="Default"]:first-child,
    .system-page__content > p.Default:first-child {
        font-size: 22px !important;
        line-height: 1.3 !important;
    }
}