:root { color-scheme: dark; }
button, .file-button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid #38bdf8; outline-offset: 3px; }
input, textarea { min-width: 0; max-width: 100%; }
.workspace-tools { max-width: 1152px; margin: 20px auto 0; padding: 0 16px; }
.tool-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-row button, .file-button, #undoFormatBtn { border: 1px solid #475569; padding: 8px 12px; border-radius: 8px; font-size: 12px; background: #1e293b; }
.file-button input { display: block; max-width: 180px; font-size: 10px; margin-top: 4px; }
.workspace-tools p, .helper { color: #94a3b8; font-size: 11px; margin-top: 10px; line-height: 1.6; }
#saveStatus { color: #67e8f9; }
#reportDocument { overflow-wrap: anywhere; }
#reportDocument > div:first-child { gap: 16px; flex-wrap: wrap; }
#reportDocument > div:first-child > div:first-child { min-width: 0; }
#docPhone, #docEmail { overflow-wrap: anywhere; }
#signatureCanvas { display: block; width: 100%; aspect-ratio: 3.5; touch-action: none; }
#signatureDisplay { background: white; width: 100%; object-fit: contain; }
#photosGrid img { width: 100%; height: 160px; object-fit: contain; background: white; }
#photosGrid figure { min-width: 0; break-inside: avoid; }
#photosGrid figcaption { font-size: 10px; padding: 5px; overflow-wrap: anywhere; }
#toast { max-width: calc(100vw - 40px); }
#pdfDialog { color: #e2e8f0; background: #0f172a; border: 1px solid #475569; border-radius: 16px; padding: 24px; width: min(560px, calc(100vw - 28px)); max-height: 90vh; overflow: auto; }
#pdfDialog::backdrop { background: rgb(0 0 0 / .75); }
#pdfDialog h2 { font-size: 22px; font-weight: 800; margin-bottom: 12px; }
#pdfDialog p { font-size: 14px; line-height: 1.6; margin: 12px 0; overflow-wrap: anywhere; }
#pdfDialog .pdf-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
#pdfDialog a, #pdfDialog button { display: inline-block; padding: 10px 14px; border: 1px solid #64748b; border-radius: 8px; font-size: 14px; }
#pdfDialog [hidden] { display: none !important; }
#pdfShareButton { background: #047857; color: white; }
#pdfDownload { background: #0369a1; color: white; }
.paper-mode main { display: block; max-width: 850px; }
.paper-mode main > .no-print { display: none; }
.paper-mode #reportDocument, .paper-mode #reportDocument * { color: #111827 !important; background: white !important; border-color: #cbd5e1 !important; box-shadow: none !important; }
.paper-mode #reportDocument { border-radius: 0; }
@media(max-width: 420px) { main { padding-left: 10px !important; padding-right: 10px !important; } #reportDocument { padding: 16px; } #docPhone, #docEmail { display: block; } #reportDocument .font-mono.flex { display: block; } }
@page { size: auto; margin: 14mm; }
@media print {
    :root { color-scheme: light; }
    .no-print { display: none !important; }
    body { background: white !important; color: black !important; padding: 0 !important; }
    main { display: block !important; max-width: none !important; padding: 0 !important; margin: 0 !important; }
    .print-container { width: 100% !important; margin: 0 !important; padding: 0 !important; }
    #reportDocument, #reportDocument * { color: #111827 !important; background: white !important; border-color: #cbd5e1 !important; box-shadow: none !important; }
    #reportDocument { border: 0 !important; border-radius: 0 !important; padding: 0 !important; }
    #reportDocument h3 { break-after: avoid; }
    #reportDocument > div:first-child, #reportDocument > div:last-child { break-inside: avoid; }
    #photosGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #docDescription { white-space: pre-wrap; }
}
