@media print {
    html,
    body {
        width: 100% !important;
        min-width: 0 !important;
        overflow: visible !important;
        background: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sidebar,
    .header-actions,
    .mobile-nav-toggle,
    .no-print,
    .toolbar .btn:not(.print-keep),
    .print-empty-for-output,
    .print-empty-section,
    .print-empty-row,
    .print-empty-room {
        display: none !important;
    }

    .app-shell { display: block; }
    .main { padding: 0; }
    body { background: white; }
    .surface, .header-card, .card { box-shadow: none !important; background: white !important; }

    body.handover-print-mode .main > *:not(#abnahmeprotokoll) {
        display: none !important;
    }

    body.handover-print-mode .app-shell,
    body.handover-print-mode .main,
    body.handover-print-mode .handover-page,
    body.handover-print-mode .handover-doc {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        overflow: visible !important;
    }

    body.handover-print-mode .main,
    body.handover-print-mode .panel,
    body.handover-print-mode .card {
        padding: 0 !important;
    }

    body.handover-print-mode .surface,
    body.handover-print-mode .header-card,
    body.handover-print-mode .card {
        box-shadow: none !important;
        background: white !important;
        border-color: transparent !important;
        border-radius: 0 !important;
    }

    body.handover-print-mode .grid {
        display: grid !important;
    }

    body.handover-print-mode .grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    body.handover-print-mode .grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    body.handover-print-mode .grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }

    body.handover-print-mode .field-grid {
        display: grid !important;
        grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
        gap: 8px 10px !important;
    }

    body.handover-print-mode .field.span-3 { grid-column: span 3 !important; }
    body.handover-print-mode .field.span-4 { grid-column: span 4 !important; }
    body.handover-print-mode .field.span-5 { grid-column: span 5 !important; }
    body.handover-print-mode .field.span-6 { grid-column: span 6 !important; }
    body.handover-print-mode .field.span-8 { grid-column: span 8 !important; }
    body.handover-print-mode .field.span-12 { grid-column: span 12 !important; }

    body.handover-print-mode .handover-doc {
        gap: 12px;
        border: 0;
        font-size: .9rem;
    }

    body.handover-print-mode .handover-section {
        display: grid !important;
        gap: 10px !important;
        margin-top: 12px;
    }

    body.handover-print-mode .handover-doc input:not([type="checkbox"]),
    body.handover-print-mode .handover-doc textarea,
    body.handover-print-mode .handover-doc select {
        display: none !important;
    }

    body.handover-print-mode .handover-doc label {
        break-inside: avoid;
    }

    body.handover-print-mode .print-field-value {
        display: block !important;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        word-break: break-word;
        line-height: 1.35;
        min-height: 1.35em;
        padding: 3px 0;
    }

    body.handover-print-mode .print-field-value.print-value-empty {
        display: none !important;
    }

    body.handover-print-mode .table-wrap {
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    body.handover-print-mode .handover-table {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed !important;
        font-size: .68rem;
    }

    body.handover-print-mode .handover-table th,
    body.handover-print-mode .handover-table td {
        width: auto !important;
        max-width: none !important;
        padding: 4px 5px;
        vertical-align: top;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    body.handover-print-mode .handover-table th {
        font-size: .66rem;
        line-height: 1.2;
    }

    body.handover-print-mode .handover-section,
    body.handover-print-mode .signature-pad,
    body.handover-print-mode .handover-table tr {
        break-inside: avoid;
    }

    body.handover-print-mode .handover-rooms-section {
        break-inside: auto;
    }

    body.handover-print-mode .handover-rooms-section > .handover-section-title {
        break-before: page;
        page-break-before: always;
    }

    body.handover-print-mode .handover-room {
        display: grid !important;
        gap: 8px !important;
        padding: 0 !important;
        border: 0 !important;
        background: white !important;
    }

    body.handover-print-mode .handover-room:not(.print-first-room):not(.print-empty-room) {
        break-before: page;
        page-break-before: always;
    }

    body.handover-print-mode .handover-room-header,
    body.handover-print-mode .handover-room-fields {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.handover-print-mode .handover-room-header {
        display: block !important;
    }

    body.handover-print-mode .handover-room-fields {
        display: grid !important;
        grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
        gap: 8px 10px !important;
    }

    body.handover-print-mode .handover-photo-gallery {
        display: block;
        margin-top: 8px;
        font-size: 0;
    }

    body.handover-print-mode .handover-photo-gallery:empty {
        display: none;
    }

    body.handover-print-mode .handover-photo-item {
        display: inline-block;
        vertical-align: top;
        box-sizing: border-box;
        width: 49%;
        margin: 0 0 8px;
        padding: 0;
        font-size: .9rem;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.handover-print-mode .handover-photo-item:nth-child(2n) {
        margin-left: 2%;
    }

    body.handover-print-mode .handover-photo-item img {
        display: block;
        width: 100%;
        max-height: 95mm;
        object-fit: contain;
        border: 1px solid #ddd;
        border-radius: 0;
    }

    body.handover-print-mode .handover-choice-grid {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 6px 10px;
    }

    body.handover-print-mode .handover-choice {
        border: 0;
        background: transparent;
        padding: 0;
        font-weight: 700;
        min-width: 0;
    }

    body.handover-print-mode .handover-choice input {
        display: none !important;
    }

    body.handover-print-mode .handover-choice::before {
        content: "✓";
        margin-right: 5px;
    }

    body.handover-print-mode .signature-meta {
        display: grid !important;
        grid-template-columns: 1fr 32mm !important;
        gap: 6px !important;
    }

    body.handover-print-mode .signature-canvas {
        height: 120px;
        border-radius: 0;
    }
}
