:root{color-scheme:light}*{box-sizing:border-box}body{margin:0;min-width:320px;background:#f1f5fa;color:#10223e;font:16px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}button,input,select,textarea{font:inherit}button,.button{min-height:44px;border:1px solid #bccde6;border-radius:9px;background:white;color:#143c7e;padding:10px 14px;font-weight:650;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:8px}button:hover,.button:hover{background:#edf3ff}button:disabled{opacity:.5;cursor:default}.primary{background:#245bdf;border-color:#245bdf;color:#fff}.primary:hover{background:#194abb}input,select,textarea{width:100%;min-height:44px;border:1px solid #b9c8dc;border-radius:7px;padding:9px 10px;color:#122544;background:white}textarea{resize:vertical}input[type=checkbox]{width:22px;min-height:22px;height:22px;accent-color:#245bdf;flex-shrink:0}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid #5383f6;outline-offset:3px}a{color:#245bdf}.workspace{max-width:1380px;margin:auto;padding:32px 24px 64px}.workspace-head,.section-head{display:flex;gap:16px;align-items:center;justify-content:space-between;flex-wrap:wrap}.workspace-head h1{font-size:clamp(1.9rem,4vw,2.6rem);letter-spacing:-.04em;margin:3px 0 8px;line-height:1.15}.eyebrow{font-weight:750;font-size:.875rem;color:#486084;letter-spacing:.08em}.workspace-head p{margin:0;color:#546681}.actions,.template-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.workspace-head .actions{margin-bottom:12px}.toolbar{display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap;margin:24px 0}.toolbar label{min-width:180px}.field{display:flex;flex-direction:column;gap:6px;font-size:.875rem;font-weight:650;min-width:0}.field input,.field select,.field textarea{font-size:1rem;font-weight:400}.field-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}.field.wide{grid-column:span 2}.panel{background:#fff;border:1px solid #d8e2ee;border-radius:14px;padding:24px;margin:18px 0;box-shadow:0 5px 18px #14284804}.panel h2{margin:0;font-size:1.25rem;letter-spacing:-.02em}.section-head{margin-bottom:18px}.muted{color:#586b85;font-size:.875rem}.save-status{font-size:.875rem;margin:10px 0;color:#385978;min-height:22px;overflow-wrap:anywhere}.device-note{display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;align-items:center}.device-note p{margin:0}.summary-grid{display:grid;grid-template-columns:repeat(4,1fr);background:#102746;color:white;border-radius:14px;overflow:hidden;margin:20px 0 8px}.summary-grid>div{padding:18px 24px;border-right:1px solid #ffffff24}.summary-grid span{display:block;font-size:.875rem;color:#c7d6ec}.summary-grid strong{display:block;font-size:1.65rem;margin-top:4px}.table-scroll{max-width:100%;overflow:auto;border:1px solid #d9e3f0;border-radius:9px}.entry-table{border-collapse:collapse;font-size:.875rem;width:100%}.entry-table th,.entry-table td{padding:10px;border-bottom:1px solid #e1e8f1;text-align:left;vertical-align:top}.entry-table thead{background:#eaf0f9}.entry-table th{color:#26415e;font-weight:700}.entry-table input,.entry-table select{min-width:130px}.entry-table input[type=number]{min-width:105px;width:110px}.entry-table input[type=checkbox]{min-width:22px;width:22px}.entry-table textarea{min-width:220px}.entry-table tfoot{background:#f4f7fc;font-weight:700}.calculated{display:block;min-width:70px;min-height:44px;background:#edf3fc;padding:10px 12px;border-radius:7px;font-weight:750}.invalid,.validation{color:#922c25}.validation{padding:14px;background:#fff0ed;border:1px solid #edb6ad;border-radius:8px}.quiet{border-color:transparent;background:transparent}.danger{color:#963c38;font-size:.875rem}.checks-routes{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,410px),1fr));gap:16px}fieldset{margin:0;border:1px solid #d5e0ee;border-radius:10px;padding:16px}legend{font-size:1rem;font-weight:700;padding:0 7px}.check-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.check-grid label{font-size:.875rem;font-weight:650;display:flex;flex-direction:column;gap:5px}.check-grid select{font-size:1rem;font-weight:400}.template-controls{margin:14px 0}.template-controls select{max-width:300px}.template-details summary{font-weight:750;cursor:pointer;min-height:44px;padding:8px 0}.template-details p{margin:5px 0 15px}.file-control{position:relative}.file-control input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.file-control:focus-within{outline:3px solid #5383f6;outline-offset:3px}.report-logo{max-height:64px;max-width:180px;object-fit:contain;margin:12px 0}dialog{color:#10223e;border:0;border-radius:16px;padding:0;max-width:min(960px,calc(100vw - 24px));width:960px;max-height:90vh;box-shadow:0 20px 90px #0005}dialog::backdrop{background:#09182c99}.dialog-inner{padding:26px}.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:20px}.dialog-head h2{margin:0;font-size:1.5rem}.builder-section{border:1px solid #d8e2ef;border-radius:10px;padding:16px;margin:16px 0}.builder-heading{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin-bottom:14px}.builder-heading>label:first-child{flex:1;min-width:180px}.builder-section label{font-size:.875rem;display:flex;flex-direction:column;gap:5px}.builder-section input,.builder-section select{font-size:1rem}.builder-field{padding:14px 0;border-top:1px solid #e0e8f3}.builder-field-main{display:grid;grid-template-columns:1fr 150px auto;gap:10px;align-items:end}.builder-field>label{margin-top:10px}.builder-field small{display:block;color:#5a6d89;margin-top:6px;overflow-wrap:anywhere}.inline-check{display:flex!important;flex-direction:row!important;align-items:center;gap:8px!important;font-size:.875rem}.field-actions{display:flex;gap:5px}.field-actions button,.builder-heading button,.check-editor button{font-size:.875rem;padding:9px}.check-editor{display:flex;gap:6px;margin:8px 0}.dialog-footer{position:sticky;bottom:0;background:white;padding:16px 0 0;display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;border-top:1px solid #dbe4f1}.preview-frame{border:1px solid #cbd8e8;width:100%;height:65vh;margin:18px 0}.legal-footer{display:flex;gap:20px;flex-wrap:wrap;font-size:.875rem;margin-top:24px}.help-steps{padding-left:24px}.help-steps li{margin:8px 0}[hidden]{display:none!important}@media(max-width:850px){.field-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.builder-field-main{grid-template-columns:1fr 140px}.field-actions{grid-column:1/-1}.summary-grid>div{padding:16px}.workspace{padding:24px 16px 50px}}@media(max-width:500px){.workspace{padding:24px 12px 44px}.panel{padding:17px}.field-grid{grid-template-columns:1fr}.field.wide{grid-column:auto}.summary-grid{grid-template-columns:1fr 1fr}.summary-grid>div{border-bottom:1px solid #ffffff24}.check-grid{grid-template-columns:1fr 1fr}.dialog-inner{padding:18px}.workspace-head .actions{width:100%}.workspace-head .actions button{flex:1}.builder-field-main{grid-template-columns:1fr}.field-actions{grid-column:auto}.check-editor{flex-wrap:wrap}.toolbar>label{flex:1}.template-controls>.button{flex:1}.summary-grid strong{font-size:1.45rem}}

.preview-notice{border-left:4px solid #245bdf;background:#e7effd;padding:14px 18px;border-radius:0 9px 9px 0;font-size:.875rem;margin:18px 0}.preview-notice a{font-weight:700}

/* The editor and preview scroll independently; typing never replaces the editor. */
#templateDialog{width:1600px;max-width:calc(100vw - 24px);height:92vh;max-height:92vh;overflow:hidden}
.template-shell{height:100%;display:flex;flex-direction:column;padding:22px;min-height:0}
.template-shell>.dialog-head{flex-shrink:0}.template-shell>.dialog-head p{margin:5px 0 12px}
.template-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;min-height:0;flex:1}
.template-editor,.template-preview-pane{min-width:0;overflow:auto;overscroll-behavior:contain;padding:0 8px 20px 0}
.template-editor .field-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.template-editor .builder-field-main{grid-template-columns:minmax(0,1fr) 135px}.template-editor .field-actions{grid-column:1/-1}
.template-preview-pane{background:#e4ebf5;border:1px solid #cad7e8;border-radius:12px;padding:16px}
.live-preview-heading{margin-bottom:14px}.live-preview-heading h3{margin:0;font-size:1.15rem}.live-preview-heading p{font-size:.875rem;margin:4px 0;color:#4a607c}
.live-paper{background:white;border:1px solid #ccd7e7;box-shadow:0 5px 20px #172c4812;max-width:610px;margin:auto;min-height:720px;overflow:hidden}.live-paper.landscape{max-width:none;min-height:500px}
.live-paper header{background:#102746;color:#fff;padding:22px}.live-paper header h3{font-size:1.5rem;line-height:1.2;margin:0 0 10px;overflow-wrap:anywhere}.live-paper header p{margin:0;font-size:.875rem;color:#d5e1f2}.live-paper header img{max-width:100px;max-height:56px;object-fit:contain;float:right;margin:0 0 10px 12px}.live-paper-body{padding:20px}.live-meta,.live-route{font-size:.875rem;font-weight:650;overflow-wrap:anywhere}
.live-paper section{margin:24px 0}.live-paper section h4{margin:0 0 12px;color:#245bdf;font-size:1rem;overflow-wrap:anywhere}.live-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;background:#dce5f1;border:1px solid #dce5f1;margin:0}.live-fields>div{background:#f6f8fc;padding:10px;min-width:0}.landscape .live-fields{grid-template-columns:repeat(3,minmax(0,1fr))}.live-fields dt{font-size:.875rem;color:#526681;overflow-wrap:anywhere}.live-fields dd{font-size:1rem;margin:4px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}.live-wide{grid-column:1/-1}.live-empty{font-size:.875rem;color:#63748e}.live-notes{white-space:pre-wrap;overflow-wrap:anywhere;font-size:1rem}
.live-table-scroll{overflow:auto;max-width:100%}.live-paper table{border-collapse:collapse;width:100%;font-size:.875rem}.live-paper th{background:#102746;color:white;text-align:left;font-weight:650}.live-paper td,.live-paper th{padding:10px;border:1px solid #d4deec;min-width:100px;max-width:240px;white-space:pre-wrap;overflow-wrap:anywhere}.live-paper tbody tr:nth-child(even){background:#f1f5fa}.live-paper tfoot{font-weight:700;background:#e9eff8}
.template-bottom{flex-shrink:0}.template-bottom .save-status{margin:8px 0 0}.template-bottom .validation{margin:8px 0 0;padding:8px 12px}.template-bottom .dialog-footer{position:static;padding-top:12px;margin-top:8px}.builder-tabs{display:none}
@media(max-width:1050px){#templateDialog{height:94vh;max-height:94vh}.template-shell{padding:16px}.template-layout{display:block;overflow:hidden}.template-editor,.template-preview-pane{height:100%}.builder-tabs{display:flex;gap:8px;margin:4px 0 12px}.builder-tabs button{flex:1}.builder-tabs [aria-pressed=true]{background:#245bdf;color:white;border-color:#245bdf}#templateDialog[data-view=edit] .template-preview-pane,#templateDialog[data-view=preview] .template-editor{display:none}.template-bottom .dialog-footer{gap:8px}.template-bottom .actions{gap:6px}}
@media(max-width:500px){.template-shell{padding:12px}.template-shell>.dialog-head{align-items:flex-start;gap:8px}.template-shell>.dialog-head h2{font-size:1.2rem}.template-shell>.dialog-head p{font-size:.875rem}.template-editor .builder-field-main{grid-template-columns:1fr}.template-editor .field-grid{grid-template-columns:1fr}.template-editor .field.wide{grid-column:auto}.live-paper-body,.live-paper header{padding:12px}.template-preview-pane{padding:10px}.landscape .live-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.template-bottom .actions{width:100%}.template-bottom .actions button{flex:1}}

.file-tools-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:18px}.file-tool-group{border:1px solid #d5e0ee;border-radius:10px;padding:20px;min-width:0}.file-tool-group h3{margin:0 0 10px;font-size:1.1rem}.file-tool-group p{font-size:.9375rem;line-height:1.6}.file-tool-group .file-help{background:#edf3fc;border-radius:8px;padding:14px;margin:14px 0 0}.file-tool-group .template-controls{align-items:stretch}.file-tool-group select{max-width:100%;min-width:0;flex:1 1 190px}.file-tool-group .file-control{flex:1 1 150px}.file-tool-group button{flex:1 1 150px}@media(max-width:850px){.file-tools-grid{grid-template-columns:1fr}.file-tool-group{padding:16px}}

/* Compact workspace: everyday actions first, occasional controls on demand. */
.workspace-head{align-items:flex-start;gap:20px;margin-bottom:22px}.workspace-head .daily-subtitle{max-width:560px;font-size:1rem;line-height:1.6}.workspace-head .actions{align-items:flex-start;gap:8px;margin-bottom:0}.daily-export-options{flex-basis:100%;text-align:right;font-size:.875rem}.daily-export-options summary{cursor:pointer;color:#526883;padding:6px 0;min-height:36px}.daily-export-content{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;max-width:440px;margin-top:8px;padding:14px;background:#fff;border:1px solid #dce4ee;border-radius:12px}.daily-export-content p{flex-basis:100%;text-align:left;font-size:.825rem;margin:4px 0 0}.toolbar.daily-quick-controls{margin:0 0 12px;align-items:flex-end;gap:12px}.daily-quick-controls label{min-width:180px}.daily-options{padding:0!important;margin:0 0 14px!important;background:transparent;border:0;box-shadow:none}.daily-options>summary{font-size:.9rem;color:#526883;cursor:pointer;padding:10px 0;min-height:44px}.daily-options[open]{padding:0 18px 18px!important;background:white;border:1px solid #dce4ee}.daily-option-fields{display:flex;align-items:flex-end;flex-wrap:wrap;gap:12px;margin:12px 0 18px}.daily-option-fields label{min-width:180px}.daily-option-fields p{flex-basis:100%;margin:0;font-size:.85rem}.daily-options .template-controls{margin:12px 0}.daily-options .preview-notice{font-size:.85rem;margin:12px 0 0}#dailyCloudStatus{font-size:.85rem;color:#397458;margin:8px 0 14px}#reportStatus:empty{display:none}#reportStatus{font-size:.875rem;margin:8px 0}.workspace-head+#worksheetHelp{display:none}@media(max-width:1100px){.workspace-head{display:block}.workspace-head .actions{margin-top:18px;max-width:440px}.daily-export-options{text-align:left}.daily-export-content{justify-content:flex-start}}@media(max-width:500px){.workspace-head .actions{width:100%}.daily-options .template-controls{gap:8px}.daily-quick-controls label{min-width:0;flex:1}.daily-quick-controls button{flex:0 0 auto}.workspace{padding-top:18px}}

#previewDialog{width:min(980px,calc(100vw - 20px));max-width:calc(100vw - 20px);max-height:calc(100dvh - 28px)}#previewDialog>.dialog-inner{display:flex;flex-direction:column;max-height:calc(100dvh - 28px);padding:18px;min-width:0}#previewDialog .dialog-head{flex-shrink:0;gap:12px}#previewDialog .dialog-head h2{font-size:1.2rem}#previewDialog .actions{flex-shrink:0;padding-top:12px}#previewDialog .muted{flex-shrink:0;font-size:.8rem;margin-bottom:0}.pdf-pages{overflow:auto;min-width:0;min-height:100px;flex:1;background:#e1e7f0;border:1px solid #bfcde0;border-radius:8px;padding:8px;margin-top:14px;overscroll-behavior:contain}.pdf-page{margin:0 0 14px}.pdf-page:last-child{margin-bottom:0}.pdf-page img{display:block;width:100%;height:auto;background:white;box-shadow:0 2px 6px #0002}.pdf-page figcaption{text-align:center;font-size:.8rem;color:#435773;padding:6px}.pdf-pages p{padding:20px}@media(max-width:500px){#previewDialog>.dialog-inner{padding:12px}#previewDialog .actions{gap:8px}#previewDialog .actions>*{flex:1}.pdf-pages{padding:4px}}@media print{body:has(#previewDialog[open])> :not(#previewDialog){display:none!important}#previewDialog[open]{position:static;display:block;max-height:none;width:100%;max-width:none;margin:0;padding:0;box-shadow:none}#previewDialog>.dialog-inner{display:block;max-height:none;padding:0}#previewDialog .dialog-head,#previewDialog .actions,#previewDialog .muted,#pdfMessage,.pdf-page figcaption{display:none!important}.pdf-pages{overflow:visible;border:0;padding:0;margin:0}.pdf-page{break-after:page;page-break-after:always;margin:0}.pdf-page:last-child{break-after:auto;page-break-after:auto}}

#pdfMessage:empty{display:none}#pdfMessage{font-size:.85rem;margin:8px 0}.report-history-list{list-style:none;padding:0;margin:18px 0}.report-history-list li{display:flex;gap:14px;justify-content:space-between;align-items:center;padding:16px 0;border-bottom:1px solid #dce4ee}.report-history-list li>div{min-width:0;overflow-wrap:anywhere}.report-history-list strong,.report-history-list span{display:block}.report-history-list span{font-size:.85rem;color:#526883;margin-top:6px}.report-history-list button{flex-shrink:0}#historyDialog{width:min(720px,calc(100vw - 24px))}.daily-quick-controls{flex-wrap:wrap}

.history-actions{display:flex;gap:8px;flex-shrink:0;flex-wrap:wrap}@media(max-width:500px){.report-history-list li{align-items:flex-start;flex-direction:column}.history-actions{width:100%}.history-actions button{flex:1}}

/* Wide report columns scroll inside their panel, never across the page. */
@media screen{
  .workspace,#debriefForm,#sections,.panel,.table-scroll{min-width:0}
  .table-scroll,.live-table-scroll{width:100%;contain:inline-size;overscroll-behavior-x:contain}
  .field input,.field select,.field textarea{min-width:0;max-width:100%}
  .field input[type=date]{min-inline-size:0;inline-size:100%}
  .summary-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .summary-grid>div{min-width:0;overflow-wrap:anywhere}
  .daily-quick-controls label{flex:0 1 210px;min-width:min(180px,100%);max-width:100%}
}
@media screen and (max-width:500px){.summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

.entry-table .row-actions-cell{position:sticky;left:0;z-index:1;background:#fff;min-width:100px;box-shadow:1px 0 #d9e3f0}.entry-table thead .row-actions-cell{background:#eaf0f9}.row-actions-cell>span{display:block;margin-bottom:6px}.row-actions-cell button{padding:8px;min-height:44px}

.summary-grid .expense-summary{display:block;text-align:left;width:100%;padding:0;border:0;background:transparent;color:white}.expense-summary small{display:block;font-size:.75rem;color:#cfddf4;margin-top:8px}.expense-summary:hover{text-decoration:underline}#expenseDialog{width:min(720px,calc(100vw - 24px))}.expense-entry{padding:18px 0;border-bottom:1px solid #dce4ee}.expense-entry h3{margin:0 0 12px;overflow-wrap:anywhere}.expense-entry dl{margin:0 0 16px}.expense-entry dl>div{display:grid;grid-template-columns:90px minmax(0,1fr);gap:12px}.expense-entry dt{color:#536780}.expense-entry dd{margin:0;overflow-wrap:anywhere}.settled-badge{color:#12664d;font-weight:700}#expenseDialog [aria-pressed=true]{background:#245bdf;color:white}#expenseMessage:empty{display:none}

.create-from-photo{display:block;width:100%;margin:12px 0 22px;min-height:48px}.work-item{padding:18px 0;border-top:1px solid #dce5f0}.work-select{display:flex;align-items:center;gap:10px;margin-bottom:12px}.work-select input{width:20px;height:20px}.work-items .actions{display:flex;flex-wrap:wrap;gap:12px}.work-items .field{min-width:0}.work-items input,.work-items select{max-width:100%;font-size:16px}
