:root{color-scheme:dark;font:16px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#0d1117;color:#f0f4f8}*{box-sizing:border-box}body{margin:0}main{max-width:560px;margin:0 auto;padding:52px 24px 32px}header{margin-bottom:36px}.eyebrow{font-size:.7rem;letter-spacing:.16em;font-weight:700;color:#8da3b8}h1{font-size:3.4rem;line-height:1;margin:15px 0 20px;letter-spacing:-.05em}h1 span{color:#f5b642}.capture{position:relative;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;background:#f5b642;color:#171b21;border-radius:20px;min-height:226px;cursor:pointer;box-shadow:0 12px 32px #0004;font-size:1.2rem;font-weight:750;overflow:hidden}.camera{font-size:3.8rem;line-height:1;font-weight:300}.capture input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.capture:focus-within{outline:3px solid #fff;outline-offset:5px}.capture:has(input:disabled){opacity:.7}button,a{touch-action:manipulation}button{font:inherit;cursor:pointer;border:1px solid #536173;border-radius:9px;background:#1d2a39;color:#fff;padding:10px 14px;min-height:44px}button:disabled{opacity:.55}button:focus-visible,a:focus-visible{outline:3px solid #f5b642;outline-offset:4px}a{color:#ffd479}#queue-status{margin:24px 0 12px;min-height:1.5em;font-weight:550}.error{color:#ffb4aa}form label:not(.capture){display:block;margin:12px 0 6px}input:not([type=file]){font:inherit;color:#fff;background:#18222e;border:1px solid #69788c;border-radius:9px;padding:12px;width:100%;min-height:48px}form button[type=submit]{margin-top:15px;width:100%;background:#f5b642;color:#171b21;font-weight:700}[hidden]{display:none!important}@media(max-width:360px){main{padding:36px 18px}.capture{min-height:200px;font-size:1rem}h1{font-size:2.9rem}}

#field-capture{position:relative}.overlay-toggle{display:flex;align-items:center;gap:10px;margin:0 0 16px auto;border-radius:24px;font-size:.9rem}.overlay-toggle span{font-size:.75rem;color:#9faebe;font-weight:800}.overlay-toggle[aria-pressed=true]{border-color:#f5b642;background:#3b301d}.overlay-toggle[aria-pressed=true] span{color:#ffd479}
#photo-preview{position:fixed;inset:0;margin:0;width:100%;height:100%;height:100dvh;max-width:none;max-height:none;padding:0;border:0;background:#090c10;color:#fff;overflow:hidden}#photo-preview[open]{display:flex;flex-direction:column}#photo-preview::backdrop{background:#090c10}.preview-toolbar{display:flex;align-items:center;gap:16px;padding:calc(12px + env(safe-area-inset-top)) 16px 12px;flex-shrink:0}.preview-toolbar button{font-size:1.8rem;line-height:1;border:0;background:#202731;min-width:48px}#preview-status{font-size:.95rem}#preview-image{display:block;min-height:0;flex:1;width:100%;object-fit:contain}.preview-actions{display:flex;justify-content:center;gap:16px;padding:16px 20px calc(16px + env(safe-area-inset-bottom));flex-shrink:0}.preview-actions button{background:#f5b642;color:#15191e;font-weight:750;min-width:200px;border:0}.preview-actions a{padding:10px}

.capture-choices{display:grid;grid-template-columns:1fr 1fr;gap:14px}.capture-choices .capture{min-height:210px;border:1px solid #526070;box-shadow:none;gap:12px;padding:24px 12px;font-size:1.1rem}.document-capture{background:#1c2734;color:#f0f4f8}.capture svg{width:44px;height:44px}.worksite-capture small{font-size:.75rem;font-weight:600;letter-spacing:.04em;opacity:.8}.icon-button{display:inline-flex;align-items:center;justify-content:center;width:52px;height:52px;padding:13px;border:1px solid #465362;border-radius:50%;background:#202b37;color:#fff;text-decoration:none}.icon-button svg{width:24px;height:24px}.preview-actions .icon-button{min-width:52px;background:#202b37;color:#fff;border:1px solid #465362}.icon-button[aria-disabled=true]{opacity:.35;pointer-events:none}
#live-camera{position:fixed;inset:0;margin:0;width:100%;height:100%;height:100dvh;max-width:none;max-height:none;padding:0;border:0;background:#090c10;color:#fff;overflow:hidden}#live-camera[open]{display:flex;flex-direction:column}#live-camera::backdrop{background:#090c10}.camera-stage{position:relative;flex:1;min-height:0;overflow:hidden}.camera-stage video,.camera-stage canvas{position:absolute;width:100%;height:100%;object-fit:contain;inset:0}.camera-stage canvas{pointer-events:none}#camera-status{margin:8px 20px;text-align:center;min-height:1.5em;font-size:.9rem}.camera-actions{display:flex;justify-content:center;padding:8px 20px calc(20px + env(safe-area-inset-bottom))}#camera-shutter{width:76px;height:76px;padding:5px;border-radius:50%;border:2px solid #fff;background:none}#camera-shutter span{display:block;width:100%;height:100%;border-radius:50%;background:#fff}#camera-shutter:disabled{opacity:.35}@media(max-width:360px){.capture-choices{gap:10px}.capture-choices .capture{font-size:1rem;min-height:190px}}

/* Compact controls leave the image area to the camera. */
#field-capture h1{font-size:clamp(2.1rem,8.8vw,3.1rem)}.worksite-capture small{font-size:.7rem;letter-spacing:0}.preview-toolbar{gap:8px;padding:calc(6px + env(safe-area-inset-top)) 8px 6px;min-height:56px}.preview-toolbar #camera-back,.preview-toolbar #preview-back{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;background:transparent;border:0;border-radius:0;padding:6px;width:52px;height:52px;box-shadow:none}.preview-toolbar #camera-back svg,.preview-toolbar #preview-back svg{width:36px;height:36px;filter:drop-shadow(0 1px 3px #000)}
#live-camera .preview-toolbar{position:absolute;z-index:2;inset:0 0 auto;pointer-events:none;background:linear-gradient(#0006,transparent)}#live-camera .preview-toolbar button{pointer-events:auto}.camera-stage{flex:1}#camera-status:empty{display:none}#camera-status:not(:empty){position:absolute;z-index:2;top:60px;left:0;right:0;margin:0 18px;padding:8px;border-radius:8px;background:#090c10df}.camera-actions{padding:6px 16px calc(8px + env(safe-area-inset-bottom));min-height:82px}#camera-shutter{width:64px;height:64px}
#photo-preview .preview-toolbar{position:absolute;z-index:2;inset:0 0 auto;background:linear-gradient(#090c10e6,#090c1000)}#photo-preview #preview-image{height:100%;width:100%;flex:1}#preview-status{font-size:.8rem;flex:1;min-width:0;text-shadow:0 1px 3px #000}.preview-toolbar .preview-actions{padding:0;gap:8px;flex-shrink:0}.preview-actions .icon-button{width:44px;height:44px;min-width:44px;padding:10px;background:#111b26b3}.preview-actions .icon-button svg{width:22px;height:22px}
@media(orientation:landscape){#live-camera .camera-actions{position:absolute;right:12px;top:50%;transform:translateY(-50%);padding:0;min-height:0}.camera-stage{margin-right:86px}}

/* Installed field app: safe controls and image space, without cropping captures. */
:root{--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px)}
body{min-height:100svh}main{padding-left:calc(24px + var(--safe-left));padding-right:calc(24px + var(--safe-right));padding-bottom:calc(24px + var(--safe-bottom))}
#pwa-install{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:20px;padding:10px 12px;border:1px solid #25435a;border-radius:12px;background:#101c2c;font-size:.8rem;color:#cdd6e2}
#pwa-install>span:first-child{flex:1}#pwa-install button{font-size:.8rem;background:#087cc0;border:0;font-weight:650;padding:8px 12px}#pwa-install .pwa-help{flex:1}#pwa-install .pwa-dismiss{background:transparent;font-size:1.4rem;min-width:44px;padding:4px}
html.is-standalone #pwa-install,body:has(dialog[open]) #pwa-install{display:none!important}
html.is-standalone main{padding-top:calc(16px + var(--safe-top));max-width:640px}html.is-standalone #field-capture header{margin-bottom:20px}html.is-standalone #field-capture h1{margin:8px 0 12px;font-size:2.5rem}
#live-camera,#photo-preview{height:100dvh;overscroll-behavior:none}
.preview-toolbar{padding-top:calc(6px + var(--safe-top));padding-left:calc(8px + var(--safe-left));padding-right:calc(8px + var(--safe-right))}
.camera-stage{margin-left:var(--safe-left);margin-right:var(--safe-right);margin-top:var(--safe-top)}
.camera-actions{padding-left:calc(12px + var(--safe-left));padding-right:calc(12px + var(--safe-right));padding-bottom:calc(8px + var(--safe-bottom));flex-shrink:0}
#camera-status:not(:empty){top:calc(60px + var(--safe-top));left:var(--safe-left);right:var(--safe-right)}
#photo-preview #preview-image{padding-left:var(--safe-left);padding-right:var(--safe-right);padding-bottom:var(--safe-bottom);padding-top:calc(62px + var(--safe-top))}
html.is-standalone .camera-actions{min-height:76px;padding-top:4px;padding-bottom:calc(6px + var(--safe-bottom))}
@media(orientation:landscape){
 .camera-stage{margin-right:calc(80px + var(--safe-right))}
 #live-camera .camera-actions{right:calc(8px + var(--safe-right));padding:0;top:50%;min-height:0}
 #photo-preview #preview-image{padding-top:var(--safe-top);padding-left:calc(62px + var(--safe-left))}
}


