/* Print layout — A4 Landscape, everything on ONE page */

@page {
    size: A4 landscape;
    margin: 5mm 8mm;
}

@media print {
    /* === Reset === */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body {
        background: white !important;
        color: #1a1a1a !important;
        font-size: 7px !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* === Hide non-print elements === */
    .site-header,
    .site-footer,
    .chart-actions,
    .advanced-options,
    .submit-btn,
    .back-btn,
    .print-btn,
    .zoom-btn,
    .zoom-overlay,
    .burger-btn,
    .burger-panel,
    .burger-backdrop,
    .print-settings,
    .theme-toggle,
    #chart-tooltip {
        display: none !important;
    }

    /* === User-hidden sections via checkboxes === */
    .print-hidden {
        display: none !important;
    }

    /* === Container — no margins, full width === */
    main {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

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

    /* === Title — minimal === */
    .chart-header {
        margin-bottom: 2px !important;
        padding-bottom: 1px !important;
        border-bottom: 1px solid #ccc !important;
    }

    .chart-title {
        font-size: 11px !important;
        color: #1a1a1a !important;
        text-shadow: none !important;
        margin: 0 !important;
    }

    /* === Main layout: chart 42% + data 58% === */
    .chart-layout {
        display: grid !important;
        grid-template-columns: 42% 58% !important;
        gap: 4px !important;
        margin-bottom: 2px !important;
        align-items: start !important;
    }

    /* === Chart wheel — BIGGER === */
    .chart-wheel {
        text-align: center !important;
    }

    .chart-wheel svg {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 340px !important;
        height: auto !important;
    }

    /* === Data tables column === */
    .chart-data {
        display: flex !important;
        flex-direction: column !important;
        gap: 1px !important;
    }

    /* === Section headings — tiny === */
    section h2 {
        font-size: 8px !important;
        color: #333 !important;
        margin-bottom: 1px !important;
        padding-bottom: 0 !important;
        border-bottom: 1px solid #ddd !important;
    }

    /* === Planet table — ultra compact === */
    .planet-table {
        margin-bottom: 1px !important;
    }

    .planet-table th {
        font-size: 6px !important;
        padding: 0 2px !important;
        color: #666 !important;
        border-bottom: 1px solid #ccc !important;
    }

    .planet-table td {
        font-size: 7px !important;
        padding: 0 2px !important;
        color: #1a1a1a !important;
        border-bottom: none !important;
        line-height: 1.3 !important;
    }

    .planet-table tr {
        border-left: none !important;
    }

    .element-fire,
    .element-earth,
    .element-air,
    .element-water {
        border-left: 2px solid #999 !important;
    }

    .element-fire { border-left-color: #d44 !important; }
    .element-earth { border-left-color: #4a8 !important; }
    .element-air { border-left-color: #88a !important; }
    .element-water { border-left-color: #46a !important; }

    .dignity-badge {
        font-size: 5px !important;
        padding: 0 1px !important;
        border: 1px solid #999 !important;
        background: #f0f0f0 !important;
        color: #333 !important;
    }

    .retro-badge {
        color: #666 !important;
        font-size: 6px !important;
    }

    /* === Balance — compact inline === */
    .balance-section {
        display: flex !important;
        gap: 6px !important;
    }

    .balance-group {
        gap: 0 !important;
    }

    .balance-row {
        gap: 2px !important;
    }

    .balance-label {
        font-size: 6px !important;
        min-width: 3.5rem !important;
        color: #333 !important;
    }

    .balance-bar {
        height: 8px !important;
        border: 1px solid #ccc !important;
        background: #f5f5f5 !important;
    }

    .balance-count {
        font-size: 7px !important;
        min-width: 1rem !important;
        color: #1a1a1a !important;
    }

    /* === House table — ultra compact === */
    .house-table td {
        font-size: 7px !important;
        padding: 0 2px !important;
        color: #1a1a1a !important;
        border-bottom: none !important;
        line-height: 1.3 !important;
    }

    .house-table td:first-child {
        color: #333 !important;
        font-weight: 600 !important;
    }

    /* === Bottom row: aspect grid + aspects side by side === */
    .chart-bottom {
        display: grid !important;
        grid-template-columns: auto 1fr !important;
        gap: 4px !important;
        margin-bottom: 0 !important;
        align-items: start !important;
    }

    .chart-bottom-right {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    /* === Aspect grid SVG — small === */
    .aspect-grid {
        margin-bottom: 0 !important;
        overflow: visible !important;
    }

    .aspect-grid svg {
        max-height: 140px !important;
        width: auto !important;
        height: auto !important;
    }

    /* === Aspect list — ultra compact, 2-column === */
    .aspect-list {
        margin-bottom: 0 !important;
    }

    .aspect-list-major,
    .aspect-list-minor {
        margin: 0 !important;
        columns: 2 !important;
        column-gap: 8px !important;
    }

    .aspect-item {
        font-size: 6px !important;
        padding: 0 1px !important;
        border-bottom: none !important;
        gap: 2px !important;
        break-inside: avoid !important;
        line-height: 1.3 !important;
    }

    .aspect-planets {
        min-width: 70px !important;
        color: #1a1a1a !important;
    }

    .aspect-type {
        min-width: 50px !important;
        color: #333 !important;
    }

    .aspect-orb {
        color: #666 !important;
        font-size: 6px !important;
    }

    .strength-exact,
    .strength-tight,
    .strength-wide {
        opacity: 1 !important;
    }

    /* === Patterns === */
    .pattern-list li {
        font-size: 7px !important;
        padding: 0 !important;
        border-bottom: none !important;
        color: #1a1a1a !important;
    }

    .no-patterns {
        font-size: 7px !important;
        color: #666 !important;
    }

    /* === CRITICAL: Allow content to flow, don't force page breaks === */
    .chart-container,
    .chart-layout,
    .chart-bottom,
    .chart-data,
    section {
        page-break-inside: auto !important;
        break-inside: auto !important;
    }

    /* Only avoid breaks on the top-level container */
    .chart-layout {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}
