/**
 * BigBen CRM — Compact Cheatsheet / Шпаргалка-схема
 *
 * Принципы:
 *   — Без внешних рамок. Секции разделяются тонкими линиями
 *   — Боксы только для семантики (speech, banned, sub-block)
 *   — Иерархия через типографику и whitespace, не через бордюры
 *   — Монохром: серые тона, работает в ч/б печати
 *   — Цель: 1 лист A4
 *
 * Tokens:
 *   Border:   1px solid #d1d5db
 *   Bg:       #f6f7f8 (subtle fill)
 *   Spacing:  6 / 10 / 14px
 *   Fonts:    0.625 labels, 0.6875 small, 0.75 body, 0.875 heads
 */

/* ============================================
   Page
   ============================================ */

.cs-page {
    padding-bottom: 2rem !important;
}

.cs-page .breadcrumbs {
    margin-bottom: 0.75rem;
}

.cs-page .breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.cs-page .breadcrumbs li {
    display: flex;
    align-items: center;
    font-size: 0.8125rem;
    color: #9ca3af;
}

.cs-page .breadcrumbs li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: #d1d5db;
}

.cs-page .breadcrumbs li:last-child {
    color: #374151;
    font-weight: 500;
}

.cs-page .breadcrumbs a {
    color: #9ca3af;
    text-decoration: none;
}

.cs-page .breadcrumbs a:hover {
    color: #374151;
}

/* ============================================
   Container
   ============================================ */

.cs {
    max-width: 960px;
    margin: 0 auto;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #1a1a2e;
}

/* ============================================
   Toolbar (web only)
   ============================================ */

.cs__toolbar {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.cs__toolbar .btn {
    font-size: 0.75rem;
    padding: 6px 14px;
}

/* ============================================
   Title Bar
   ============================================ */

.cs__title-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 2px solid #1a1a2e;
    margin-bottom: 0;
}

.cs__logo {
    height: 28px;
    flex-shrink: 0;
    opacity: 0.85;
}

.cs__title-bar h1 {
    font-family: 'Manrope', sans-serif;
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.2;
    color: #1a1a2e;
}

.cs__title-bar p {
    font-size: 0.6875rem;
    margin: 2px 0 0;
    color: #9ca3af;
    font-weight: 400;
}

/* ============================================
   Section
   ============================================ */

.cs__section {
    border-bottom: 1px solid #d1d5db;
}

.cs__section:last-child {
    border-bottom: none;
}

.cs__section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0 6px;
    font-weight: 700;
    font-size: 0.875rem;
    line-height: 1.3;
    color: #1a1a2e;
}

.cs__section-head--warning {
    color: #1a1a2e;
}

.cs__num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.6875rem;
    background: #374151;
    color: white;
}

.cs__section-tag {
    font-weight: 400;
    font-size: 0.6875rem;
    color: #9ca3af;
    margin-left: auto;
}

.cs__section-body {
    padding: 4px 0 10px;
}

/* ============================================
   Grid Layouts
   ============================================ */

.cs__cols-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.cs__cols-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.cs__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.cs__row > .cs__section {
    border-bottom: none;
}

/* ============================================
   Labels
   ============================================ */

.cs__label {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin: 8px 0 3px;
}

.cs__label:first-child {
    margin-top: 0;
}

/* ============================================
   Speech
   ============================================ */

.cs__speech {
    background: #f6f7f8;
    border-left: 2px solid #9ca3af;
    padding: 4px 10px;
    font-size: 0.75rem;
    line-height: 1.45;
    color: #1a1a2e;
    margin: 3px 0;
}

/* ============================================
   Branch
   ============================================ */

.cs__branch {
    font-size: 0.75rem;
    line-height: 1.4;
}

.cs__branch-item {
    padding: 3px 0;
    border-bottom: 1px solid #f0f1f3;
}

.cs__branch-item:last-child {
    border-bottom: none;
}

.cs__branch-trigger {
    font-weight: 700;
    color: #374151;
}

.cs__branch-response {
    color: #4b5563;
}

/* ============================================
   Banned
   ============================================ */

.cs__banned {
    border-left: 3px solid #374151;
    padding: 6px 10px;
    font-size: 0.75rem;
    background: #f6f7f8;
}

.cs__banned-label {
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #374151;
    margin-bottom: 3px;
}

.cs__banned ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cs__banned li {
    padding-left: 14px;
    position: relative;
    color: #374151;
    margin-bottom: 1px;
    font-size: 0.6875rem;
}

.cs__banned li::before {
    content: '\2716';
    position: absolute;
    left: 0;
    font-weight: 700;
    font-size: 0.625rem;
}

.cs__banned-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 14px;
    font-size: 0.6875rem;
    color: #374151;
}

.cs__banned-inline span::before {
    content: '\2716  ';
    font-weight: 700;
}

/* ============================================
   Tip
   ============================================ */

.cs__tip {
    border-left: 2px solid #9ca3af;
    padding: 4px 10px;
    font-size: 0.6875rem;
    line-height: 1.4;
    color: #4b5563;
    margin-top: 6px;
    font-style: italic;
}

/* ============================================
   Table
   ============================================ */

.cs__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.6875rem;
    margin: 4px 0;
}

.cs__table th {
    font-weight: 700;
    text-align: left;
    padding: 4px 8px;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid #374151;
    color: #374151;
}

.cs__table td {
    padding: 4px 8px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
    line-height: 1.4;
    color: #374151;
}

.cs__table tr:last-child td {
    border-bottom: none;
}

/* ============================================
   Formula
   ============================================ */

.cs__formula {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 5px 10px;
    background: #f6f7f8;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 4px 0;
}

.cs__formula span {
    white-space: nowrap;
}

/* ============================================
   Highlight
   ============================================ */

.cs__highlight {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    margin: 4px 0;
}

.cs__highlight-num {
    font-family: 'Manrope', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1;
    flex-shrink: 0;
}

.cs__highlight-text {
    font-size: 0.6875rem;
    color: #4b5563;
    line-height: 1.4;
}

/* ============================================
   List
   ============================================ */

.cs__list {
    margin: 4px 0;
    padding-left: 18px;
    font-size: 0.75rem;
}

.cs__list li {
    margin-bottom: 1px;
    line-height: 1.4;
    color: #374151;
}

.cs__list li strong {
    color: #1a1a2e;
}

/* ============================================
   Source
   ============================================ */

.cs__source {
    font-size: 0.5625rem;
    color: #9ca3af;
    font-style: italic;
    margin-top: 2px;
}

/* ============================================
   Connector
   ============================================ */

.cs__connector {
    text-align: center;
    font-size: 0.625rem;
    color: #9ca3af;
    padding: 2px 0;
    font-style: italic;
}

.cs__connector::before {
    content: '↓ ';
}

/* ============================================
   Divider
   ============================================ */

.cs__divider {
    border-top: 1px solid #e5e7eb;
    margin: 6px 0;
}

/* ============================================
   Sub-block
   ============================================ */

.cs__sub {
    border-left: 2px solid #d1d5db;
    padding: 4px 10px;
    margin: 4px 0;
}

.cs__sub-title {
    font-weight: 700;
    font-size: 0.6875rem;
    color: #374151;
    margin-bottom: 3px;
}

/* ============================================
   Print
   ============================================ */

@page {
    margin: 8mm 10mm;
    size: A4 portrait;
}

@media print {
    .no-print,
    header,
    footer,
    nav,
    .nav,
    .breadcrumbs,
    .cs__toolbar,
    .site-footer {
        display: none !important;
    }

    html, body {
        margin: 0;
        padding: 0;
        background: white;
    }

    main {
        padding: 0 !important;
    }

    .section, .cs-page {
        padding: 0 !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .cs {
        max-width: 100%;
        font-size: 7pt;
        line-height: 1.3;
    }

    /* Title */
    .cs__title-bar {
        padding: 4px 0;
        border-bottom-width: 1.5px;
        gap: 8px;
    }

    .cs__logo {
        height: 18px;
    }

    .cs__title-bar h1 {
        font-size: 10pt;
    }

    .cs__title-bar p {
        font-size: 5.5pt;
    }

    /* Sections */
    .cs__section-head {
        padding: 4px 0 3px;
        font-size: 7.5pt;
    }

    .cs__num {
        width: 14px;
        height: 14px;
        font-size: 6pt;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .cs__section-tag {
        font-size: 5.5pt;
    }

    .cs__section-body {
        padding: 3px 0 6px;
    }

    /* Typography */
    .cs__label {
        font-size: 5pt;
        margin: 3px 0 1px;
    }

    .cs__speech {
        font-size: 6.5pt;
        padding: 2px 6px;
        margin: 1px 0;
    }

    .cs__branch {
        font-size: 6.5pt;
    }

    .cs__branch-item {
        padding: 1px 0;
    }

    .cs__source {
        font-size: 4.5pt;
    }

    .cs__tip {
        font-size: 6pt;
        padding: 2px 6px;
        margin-top: 2px;
    }

    .cs__banned {
        padding: 3px 6px;
    }

    .cs__banned li {
        font-size: 6pt;
    }

    .cs__banned-label {
        font-size: 4.5pt;
    }

    .cs__banned-inline {
        font-size: 6pt;
        gap: 1px 10px;
    }

    .cs__table {
        font-size: 6pt;
    }

    .cs__table th {
        font-size: 5pt;
        padding: 2px 4px;
    }

    .cs__table td {
        padding: 2px 4px;
        font-size: 6pt;
    }

    .cs__formula {
        font-size: 6.5pt;
        padding: 2px 6px;
    }

    .cs__highlight {
        padding: 3px 0;
    }

    .cs__highlight-num {
        font-size: 9pt;
    }

    .cs__highlight-text {
        font-size: 6pt;
    }

    .cs__list {
        font-size: 6.5pt;
        padding-left: 12px;
        margin: 2px 0;
    }

    .cs__list li {
        margin-bottom: 0;
    }

    .cs__connector {
        padding: 1px 0;
        font-size: 5.5pt;
    }

    .cs__cols-2 {
        gap: 8px;
    }

    .cs__cols-3 {
        gap: 6px;
    }

    .cs__row {
        gap: 12px;
    }

    .cs__sub {
        padding: 3px 6px;
        margin: 2px 0;
    }

    .cs__sub-title {
        font-size: 6pt;
        margin-bottom: 1px;
    }

    .cs__section {
        page-break-inside: avoid;
    }

    .cs__divider {
        margin: 2px 0;
    }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 640px) {
    .cs__cols-2,
    .cs__cols-3 {
        grid-template-columns: 1fr;
    }

    .cs__row {
        grid-template-columns: 1fr;
    }

    .cs__title-bar h1 {
        font-size: 1rem;
    }

    .cs__highlight {
        flex-direction: column;
    }

    .cs__section-tag {
        display: none;
    }
}
