/* ap_print.css — стили печати для раздела /fas/ */

#ap-copy-toast {
    display: none;
    position: fixed;
    background: #fff;
    color: #1a2330;
    border: 1px solid #d0d4dc;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    padding: 7px 14px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 300;
    z-index: 99999;
    pointer-events: none;
    white-space: nowrap;
}

@media print {
    /* Скрываем всё лишнее */
    header, footer, nav,
    .sticky-menu, .mmenu-bar, .zai-lcol,
    .modal-overlay, #warning-container,
    .social-proof-footer,
    [class*="warning"], [class*="alert"],
    [id*="search"], [class*="search"],
    .ap-dec-card,
    .okpd2-breadcrumbs,
    .okpd2-searchbar-wrap,
    .no-print,
    button, input,
    #ap-copy-toast { display: none !important; }

    /* Базовые стили */
    body {
        font-family: Arial, sans-serif;
        font-size: 10px;
        color: #000;
        background: #fff;
        margin: 0;
        padding: 0;
    }

    a, a:visited { color: #000 !important; text-decoration: none !important; }
    a::after { content: '' !important; }

    /* Основная колонка на всю ширину */
    .zai-rcol {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 8px !important;
        float: none !important;
        box-sizing: border-box !important;
    }
    [style*="max-width:1240px"],
    [style*="max-width: 1240px"] {
        max-width: 100% !important;
        padding: 0 !important;
    }
    [style*="overflow"] { overflow: visible !important; }
    [style*="min-width"] { min-width: 0 !important; }

    /* Значки «копировать / печать / PDF / вопрос» рядом с крошками */
    nav.okpd2-breadcrumbs + span { display: none !important; }

    /* Шапка решения в печать не идёт — реквизиты стоят первой строкой таблицы */
    .zg-hero { display: none !important; }

    /* Краткая суть — строгая таблица: подпись слева, значение справа */
    .ap-sut { display: table !important; width: 100% !important; border-collapse: collapse !important; background: none !important;
              border: 0 !important; border-radius: 0 !important; margin: 0 0 12px !important; page-break-inside: avoid !important; font-family: 'Times New Roman', Times, serif !important; }
    .ap-sut > div, .ap-sut > .ap-sut-req { display: table-row !important; padding: 0 !important; border: 0 !important; }
    .ap-sut > div > small, .ap-sut > div > p, .ap-sut > div > .v, .ap-sut > div > .r {
        display: table-cell !important; border: 1px solid #000 !important; padding: 4px 6px !important;
        font: normal 10.5pt/1.4 'Times New Roman', Times, serif !important; color: #000 !important; text-transform: none !important;
        letter-spacing: 0 !important; vertical-align: top !important; white-space: normal !important; background: none !important; }
    .ap-sut > div > small { width: 26mm !important; background: #e8e8e8 !important; font: bold 7.5pt/1.4 Arial, sans-serif !important;
        text-transform: uppercase !important; letter-spacing: .04em !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .ap-sut .r b, .ap-sut .r span { color: #000 !important; font-weight: normal !important; display: inline !important; font-size: inherit !important; margin: 0 !important; }
    .ap-sut .r span::before { content: '. '; }

    /* Текст решения */
    .ap-dec-html {
        font: normal 10.5pt/1.45 'Times New Roman', Times, serif !important;
        color: #000 !important;
    }
    .ap-dec-html * { font-family: inherit !important; letter-spacing: 0 !important; }
    .ap-dec-html div { margin-bottom: 2px !important; }

    /* Таблицы — не разрываются */
    table {
        border-collapse: collapse !important;
        width: 100% !important;
        table-layout: auto !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    thead { display: table-header-group !important; }
    tr { page-break-inside: avoid !important; break-inside: avoid !important; }
    th, td {
        border: 0.5pt solid #000 !important;
        padding: 2pt 4pt !important;
        font-size: 9.5pt !important;
        font-weight: normal !important;
        vertical-align: top !important;
        word-break: break-word !important;
        white-space: normal !important;
    }

    /* Заголовки не отрываются от текста */
    h1, h2, h3, h4 { page-break-after: avoid !important; }

    /* Абзацы не разрываются */
    p, div { orphans: 3; widows: 3; }
}

@page {
    size: A4;
    margin: 15mm 15mm 15mm 20mm;
}
