:root{--brand:#216b59;--brand-dark:#185344;--brand-soft:#e6f2ee;--ink:#243746;--muted:#64748b;--field-border:#cbd5e1;--separator:#e2e8f0;--danger-bg:#fee2e2;--danger-ink:#991b1b;color:var(--ink);background-color:#eef2f5;font-family:Arial,sans-serif}*{box-sizing:border-box}body{margin:0}#app{background-color:#fff;max-width:560px;min-height:100vh;margin:0 auto;padding:24px 24px 110px}h1{margin-bottom:12px;font-size:28px}h2{margin-top:40px;font-size:18px}p{color:var(--muted);line-height:1.5}button{background-color:var(--brand);color:#fff;cursor:pointer;border:none;border-radius:10px;width:100%;padding:14px;font-size:16px;font-weight:700}form{border:1px solid #dce4e8;border-radius:12px;gap:10px;margin-top:20px;padding:18px;display:grid}label{font-size:14px;font-weight:700}input,textarea{border:1px solid var(--field-border);border-radius:8px;width:100%;padding:12px;font-family:inherit;font-size:16px}#manpower-form select,#crew-manager-panel select,#equipment-form select,#materials-form input,#materials-form select,#safety-form select,#safety-form textarea,#inspections-form select{border:1px solid var(--field-border);border-radius:8px;width:100%;padding:12px;font-size:16px}#manpower-form select,#crew-manager-panel select,#equipment-form select{background-color:#fff;font-family:inherit}.manpower-remove,.crew-deactivate,.equipment-remove,.materials-row button,.safety-row button{background-color:var(--danger-bg);width:auto;color:var(--danger-ink);padding:8px 12px;font-size:13px}.materials-row button,.safety-row button{font-size:14px}.entry{border-bottom:1px solid var(--separator);padding:16px 0}.entry-time{color:var(--brand);font-weight:700}.entry-location{color:var(--muted);font-size:14px}.entry-edit{background-color:var(--brand-soft);width:auto;color:var(--brand);margin-top:10px;padding:8px 14px;font-size:14px}.secondary-button{background-color:var(--separator);color:var(--ink)}.entry-edited{color:var(--muted);font-size:12px;font-style:italic}[hidden]{display:none!important}#photo-preview{object-fit:contain;border-radius:10px;width:100%;height:auto;max-height:350px;margin-top:10px}.photo-note{color:var(--muted);margin-top:0;font-size:12px}.entry-photo{object-fit:contain;border-radius:10px;width:100%;max-height:400px;margin-top:12px;margin-bottom:12px;display:block}#backup-button{margin-top:12px}.entry-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px;display:grid}.entry-gallery .entry-photo{object-fit:contain;background-color:#f8fafc;width:100%;height:180px;max-height:none;margin:0}#photo-preview-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px;display:grid}.photo-preview-image{object-fit:contain;background-color:#f8fafc;border-radius:10px;width:100%;height:160px}.photo-preview-item{flex-direction:column;gap:6px;display:flex}.photo-preview-remove,.entry-photo-remove{background-color:var(--danger-bg);color:var(--danger-ink);padding:8px;font-size:13px}.entry-photo-card{flex-direction:column;gap:8px;display:flex}.entry-photo-card .entry-photo{width:100%;margin:0}.entry-photo-remove{width:100%}#report-preview-button{background-color:var(--brand-soft);color:var(--brand);margin-top:30px}#report-preview{border:1px solid var(--field-border);background-color:#fff;border-radius:10px;margin-top:20px;padding:24px}#report-preview h2{margin-top:0;font-size:24px}#report-preview h3{border-bottom:2px solid var(--brand);margin-top:30px;padding-bottom:8px;font-size:18px}.report-entry{border-bottom:1px solid var(--separator);padding:12px 0}.report-entry-time{color:var(--ink);font-weight:700}.report-entry p:last-child{white-space:pre-wrap}.report-photo-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px;margin-bottom:14px;display:grid}.report-photo{object-fit:contain;background-color:#f8fafc;border-radius:8px;width:100%;height:auto;max-height:250px}.report-photo-status{color:var(--muted);font-size:12px}#manpower-section{margin-top:35px}.manpower-row,.crew-manager-row,.equipment-row{border-bottom:1px solid var(--separator);justify-content:space-between;align-items:center;gap:12px;padding:12px 0;display:flex}#crew-manager-section{margin-top:30px}#crew-manager-panel{border:1px solid #dce4e8;border-radius:12px;margin-top:15px;padding:18px}.crew-manager-row{flex-wrap:wrap}.crew-manager-row span{flex:1}#project-settings{background-color:#f8fafc;border:1px solid #dce4e8;border-radius:10px;margin-top:16px;margin-bottom:24px;padding:14px}#project-settings summary{cursor:pointer;color:var(--muted);font-size:14px;font-weight:700}#project-settings #crew-manager-section{margin-top:16px}#crew-manager-toggle{font-size:14px}.app-screen{padding-top:10px}#bottom-navigation{width:100%;max-width:560px;padding:10px 14px;padding-bottom:calc(10px + env(safe-area-inset-bottom));z-index:100;background-color:#fff;border-top:1px solid #dce4e8;grid-template-columns:repeat(2,1fr);gap:8px;display:grid;position:fixed;bottom:0;left:50%;transform:translate(-50%);box-shadow:0 -4px 16px #0000000d}#bottom-navigation button{width:100%;min-height:52px;color:var(--muted);background-color:#0000;border-radius:10px;padding:14px 8px;font-size:16px;font-weight:700}#bottom-navigation button.active-tab{background-color:var(--brand-soft);color:var(--brand)}#report-screen #manpower-section{margin-top:0}#project-setup-open{margin-top:24px}#project-setup-back{margin-bottom:10px}#project-setup-screen #crew-manager-section{margin-top:16px}.manpower-card{background-color:#fff;border:1px solid #dce4e8;border-radius:12px;margin-top:16px;padding:18px}.manpower-card h3{color:var(--ink);margin-top:0;margin-bottom:16px;font-size:17px}.manpower-card label{margin-bottom:8px;display:block}#rust-search-results button{text-align:left;margin-top:8px}#manpower-form{margin-top:14px}#non-rust-fields{gap:10px;display:grid}#manpower-list{margin-top:24px}#report-manpower-summary{margin-top:24px;margin-bottom:30px}#report-manpower-summary table,.equipment-report-table,.materials-report-table{border-collapse:collapse;width:100%;font-size:14px}#report-manpower-summary th,#report-manpower-summary td{border-bottom:1px solid var(--separator);text-align:left;padding:10px 8px}#report-manpower-summary th:last-child,#report-manpower-summary td:last-child{text-align:right}#report-manpower-summary tfoot{font-weight:700}#report-manpower-summary tfoot th,#report-manpower-summary tfoot td{border-top:2px solid var(--brand)}#equipment-section{margin-top:32px}#equipment-list{margin-top:20px}.equipment-row span{flex:1}#equipment-report-summary{margin:28px 0}#equipment-report-summary h3{margin-bottom:14px}.equipment-report-table th,.equipment-report-table td{text-align:left;border-bottom:1px solid #dce2e8;padding:10px 8px}.equipment-report-table th{background-color:#edf2f1;font-weight:700}.equipment-report-table th:last-child,.equipment-report-table td:last-child{text-align:right}.equipment-report-table tfoot{font-weight:700}#materials-section{margin-top:28px}#materials-form{border:1px solid #dce2e8;border-radius:12px;margin-top:14px;padding:18px}#materials-form[hidden]{display:none!important}#materials-form label{margin-bottom:14px;font-weight:600;display:block}#materials-form input,#materials-form select{margin-top:7px;display:block}#materials-form button{margin-top:8px}#materials-list{margin-top:18px}.materials-row{border-bottom:1px solid #dce2e8;justify-content:space-between;align-items:center;gap:12px;padding:12px 0;display:flex}.materials-row span{flex:1}#materials-none{margin-top:12px}#materials-none.active{color:#17624b;background-color:#dcece5}#materials-report-summary{margin:28px 0}#materials-report-summary h3{margin-bottom:14px}.materials-report-table th,.materials-report-table td{text-align:left;overflow-wrap:anywhere;border-bottom:1px solid #dce2e8;padding:10px 8px}.materials-report-table th{background-color:#edf2f1;font-weight:700}.materials-report-table th:last-child,.materials-report-table td:last-child{text-align:right}#backup-preview-section{border:1px solid #dce2e8;border-radius:12px;margin-top:24px;padding:18px}#backup-preview-section h3{margin-top:0}#backup-file-picker{box-sizing:border-box;border:1px solid var(--field-border);border-radius:8px;width:100%;margin-top:16px;padding:12px;display:block}#backup-preview-result{margin-top:18px}#backup-preview-result li{margin-bottom:8px}#safety-section{margin-top:28px}#safety-none{margin-bottom:10px}#safety-none.active{color:#17624b;background-color:#dcece5}#safety-form{border:1px solid #dce2e8;border-radius:12px;margin-top:14px;padding:18px}#safety-form[hidden]{display:none!important}#safety-form label{margin-bottom:14px;font-weight:600;display:block}#safety-form select,#safety-form textarea{margin-top:7px;display:block}#safety-list{margin-top:18px}.safety-row{border-bottom:1px solid #dce2e8;justify-content:space-between;align-items:flex-start;gap:12px;padding:14px 0;display:flex}.safety-row-content{flex:1}.safety-row-content small{color:var(--muted);margin-top:5px;display:block}.safety-row-content p{margin:8px 0}#report-input-sections{gap:14px;margin-top:22px;margin-bottom:24px;display:grid}.report-accordion{background-color:#fff;border:1px solid #d6dee6;border-radius:14px;overflow:hidden}.report-accordion>summary{cursor:pointer;background-color:var(--section-bg,#fff);min-height:64px;box-shadow:inset 4px 0 0 var(--section-color,var(--brand));justify-content:space-between;align-items:center;padding:16px 18px;list-style:none;display:flex}.report-accordion>summary::-webkit-details-marker{display:none}.report-accordion>summary:after{content:"+";color:var(--section-color,var(--brand));margin-left:14px;font-size:26px;font-weight:400}.report-accordion[open]>summary:after{content:"−"}.report-accordion[open]>summary{background-color:var(--section-bg,#fff);border-bottom:1px solid #d6dee6}.report-accordion-text{flex-direction:column;gap:5px;display:flex}.report-accordion-text strong{color:#17324d;font-size:18px}.report-accordion-status{color:var(--muted);font-size:14px;font-weight:400}.report-accordion>section{margin:0;padding:18px}.report-accordion>section>h2:first-child{display:none}.safety-subgroup{border:1px solid #dce2e8;border-radius:12px;margin-bottom:14px;padding:16px}.safety-subgroup h3{color:#17324d;margin:0 0 8px;font-size:17px}.safety-subgroup>p{color:var(--muted);margin:0 0 14px;font-size:14px}#safety-routine-list,#safety-concerns-list{margin-top:14px}#safety-routine-list>p,#safety-concerns-list>p{color:var(--muted);font-size:14px}#safety-add-routine,#safety-add-concern,#safety-none{margin-bottom:10px}#safety-attachment-picker{margin:8px 0 18px}.safety-attachment-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.safety-attachment-actions button{margin:0;padding:12px 8px;font-size:14px}.safety-attachment-hint{color:var(--muted);margin:10px 0;font-size:13px;line-height:1.5}.safety-attachment-preview{overflow-wrap:anywhere;border:1px solid #d6dee6;border-radius:10px;flex-wrap:wrap;align-items:center;gap:8px;margin:10px 0;padding:10px;display:flex}.safety-attachment-preview img{object-fit:contain;background:#f7f8fa;border-radius:8px;width:100%;height:160px}.safety-attachment-name{color:#17324d;flex:100%;font-size:13px}.safety-attachment-pdf{text-align:center;background:#f5f7fa;border:1px solid #d6dee6;border-radius:8px;width:100%;padding:22px;display:block}.safety-attachment-preview .safety-attachment-small-button{width:auto;margin:0;padding:8px 12px;font-size:13px}.safety-attachment-remove{background-color:var(--danger-bg);color:var(--danger-ink)}.safety-saved-attachments{flex-direction:column;gap:8px;display:flex}.safety-saved-attachment{color:#17624b;overflow-wrap:anywhere;font-size:14px}#report-safety-summary{margin-top:24px}.report-safety-entry{overflow-wrap:anywhere;border-bottom:1px solid #dce2e8;padding:14px 0}.report-safety-entry p{margin:7px 0}.report-safety-attachments{grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:12px;display:grid}.report-safety-file{color:#17624b;overflow-wrap:anywhere;flex-direction:column;gap:6px;min-width:0;font-size:12px;display:flex}.report-safety-file img{object-fit:contain;background:#f7f8fa;border-radius:6px;width:100%;max-width:100%;height:130px}@media (width<=370px){.safety-attachment-actions{grid-template-columns:1fr}}.report-accordion--safety{--section-color:#4c8468;--section-bg:#f0f8f3}.report-accordion--manpower{--section-color:#a16c7b;--section-bg:#fbf3f5}.report-accordion--equipment{--section-color:#a77b43;--section-bg:#fff7ed}.report-accordion--materials{--section-color:#507da8;--section-bg:#f1f7fe}#report-preview #report-safety-summary{--report-color:#4c8468;--report-bg:#f8fcfa}#report-preview #report-manpower-summary{--report-color:#a16c7b;--report-bg:#fdf9fa}#report-preview #equipment-report-summary{--report-color:#a77b43;--report-bg:#fffbf6}#report-preview #materials-report-summary{--report-color:#507da8;--report-bg:#f9fbfe}#report-preview #report-safety-summary,#report-preview #report-manpower-summary,#report-preview #equipment-report-summary,#report-preview #materials-report-summary{background-color:var(--report-bg);border-left:3px solid var(--report-color);border-radius:6px;padding:1px 0 10px 8px}#report-preview #report-safety-summary h3,#report-preview #report-manpower-summary h3,#report-preview #equipment-report-summary h3,#report-preview #materials-report-summary h3{border-bottom-color:var(--report-color)}#record-activity-picker{margin-bottom:24px}#record-activity-picker h2{margin:8px 0 14px}.activity-type-buttons{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.activity-type-buttons button{background:var(--separator);min-height:76px;color:var(--ink);border:1px solid var(--field-border);border-radius:12px;padding:12px 8px;font-size:15px}.activity-type-buttons button[aria-pressed=true]{background:var(--brand-soft);color:#165546;border:2px solid var(--brand)}#record-screen[data-activity-type=observation] #inspections-section{display:none}#record-screen[data-activity-type=inspection]>h2,#record-screen[data-activity-type=inspection] #empty-message,#record-screen[data-activity-type=inspection] #observations,#record-screen[data-activity-type=inspection] #observation-form{display:none!important}#record-screen #inspections-section>h2{margin:12px 0 16px}#inspections-form label{gap:6px;display:grid}#inspections-form select{min-height:48px;color:var(--ink);background:#fff;font-family:inherit;font-weight:400}#inspections-list{margin-top:18px}#inspections-list .inspection-row{border-bottom:1px solid var(--separator);align-items:flex-start;gap:12px;padding:14px 0;display:flex}#inspections-list .inspection-row span{overflow-wrap:anywhere;flex:1;min-width:0;line-height:1.5}#inspections-list .inspection-row button{background:var(--danger-bg);color:#b91c1c;flex-shrink:0;width:auto;padding:8px 12px;font-size:13px}#inspections-list .inspection-card{background:#fafbfc;border:1px solid #dce4e8;border-radius:12px;margin-bottom:14px;padding:16px}.inspection-card-header{justify-content:space-between;align-items:center;gap:12px;display:flex}.inspection-card-time{color:var(--muted);font-size:14px}.inspection-card-title{color:var(--ink);margin:14px 0 10px;font-size:18px}.inspection-card-detail{color:#475569;white-space:pre-wrap;overflow-wrap:anywhere;margin:7px 0;font-size:14px;line-height:1.5}.inspection-card-status{background:var(--separator);color:#475569;text-align:center;border-radius:20px;padding:6px 11px;font-size:12px;font-weight:700;display:inline-block}.inspection-card-status[data-result=Passed]{color:#166534;background:#dcfce7}.inspection-card-status[data-result=Failed]{background:var(--danger-bg);color:var(--danger-ink)}.inspection-card-status[data-result=Pending\ Results]{color:#92400e;background:#fef3c7}.inspection-card-status[data-result=Not\ Completed]{background:var(--separator);color:#475569}.inspection-card-actions{border-top:1px solid var(--separator);justify-content:flex-end;gap:10px;margin-top:14px;padding-top:12px;display:flex}#inspections-list .inspection-card-remove{background:var(--danger-bg);color:#b91c1c;width:auto;padding:8px 14px;font-size:13px}#inspections-list .inspection-card-edit{background:var(--brand-soft);width:auto;color:var(--brand);border-radius:8px;padding:8px 14px;font-size:13px}.inspection-evidence-gallery{flex-wrap:wrap;justify-content:flex-start;gap:12px;margin:12px 0;display:flex}.inspection-evidence-link{color:#52657c;overflow-wrap:anywhere;flex-direction:column;flex:0 270px;align-items:flex-start;gap:6px;max-width:100%;font-size:12px;display:flex}.inspection-evidence-link img{object-fit:contain;background:#f7f8fa;border-radius:8px;width:100%;height:180px;display:block}#record-activity-picker .activity-type-buttons button{width:100%;min-width:0;padding:12px 6px;font-size:14px;line-height:1.35}#record-screen[data-activity-type=materials]>h2,#record-screen[data-activity-type=materials] #empty-message,#record-screen[data-activity-type=materials] #observations,#record-screen[data-activity-type=materials] #observation-form,#record-screen[data-activity-type=materials] #inspections-section,#record-screen #add-button,#record-screen #inspections-add{display:none!important}:is(#record-screen[data-activity-type=observation]:not(:has(#observation-form:not([hidden]))) #add-button,#record-screen[data-activity-type=inspection]:not(:has(#inspections-form:not([hidden]))) #inspections-add){display:block!important}#record-screen #add-button,#record-screen #inspections-add,#record-screen #materials-add-button{background-color:var(--brand);color:#fff;border-color:var(--brand)}#record-screen #add-button:hover,#record-screen #inspections-add:hover,#record-screen #materials-add-button:hover{background-color:var(--brand-dark)}#record-activity-picker #choose-materials{grid-column:auto}#record-screen #safety-record-section{display:none}#record-screen[data-activity-type=safety] #safety-record-section{display:block}#record-screen[data-activity-type=safety]>h2,#record-screen[data-activity-type=safety] #empty-message,#record-screen[data-activity-type=safety] #observations,#record-screen[data-activity-type=safety] #observation-form,#record-screen[data-activity-type=safety] #inspections-section,#record-screen[data-activity-type=safety] #materials-record-section{display:none!important}#safety-record-section>h2{margin:12px 0 16px}#safety-form input[name=location]{margin-top:7px;display:block}#record-screen #safety-record-add{display:none!important}#record-screen[data-activity-type=safety] #safety-record-section:not(:has(#safety-form:not([hidden]))) #safety-record-add{display:block!important}#safety-record-add,#safety-record-add:hover{background-color:var(--brand);color:#fff;border-color:var(--brand)}#safety-record-add:hover{background-color:var(--brand-dark)}.safety-record-item{border-bottom:1px solid var(--field-border);padding:18px 0}.safety-record-item p{margin:8px 0 0}.safety-record-item small{color:var(--muted);margin-top:10px;display:block}#report-preview .report-company-logo{object-fit:contain;width:auto;max-width:180px;height:auto;max-height:100px;margin-bottom:16px;display:block}
