.ai-capture{max-width:640px;margin:0 auto;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink)}
.ai-heading{display:flex;align-items:flex-start;gap:14px;margin-bottom:18px}.ai-heading .button{padding-left:0}.ai-heading h1{font-size:24px;font-weight:600;letter-spacing:0;line-height:1.3;margin:4px 0 6px}.ai-heading p{font-size:14px;color:var(--muted)}
.ai-camera-panel[hidden],.ai-details[hidden]{display:none!important}.ai-camera-panel,.ai-details{min-width:0}.ai-viewfinder{position:relative;background:#18201e;border-radius:10px;overflow:hidden;aspect-ratio:4/3;max-height:55vh}.ai-viewfinder video{width:100%;height:100%;object-fit:contain;display:block}.ai-frame{position:absolute;inset:10% 15%;border:2px solid #ffffffa0;border-radius:6px;pointer-events:none}
.ai-camera-actions{display:grid;gap:10px;margin-top:16px}.ai-camera-actions .button{min-height:54px;width:100%;font-size:16px}.ai-camera-actions #ai-read{background:var(--green);color:var(--dark);font-weight:700}.ai-camera-actions #ai-read:hover{background:#b9e76a}.ai-explanation,.ai-costs{font-size:13px;color:var(--muted);line-height:1.5}.ai-explanation{margin:12px 0}.ai-costs{margin-top:20px;padding-top:14px;border-top:1px solid var(--line)}.ai-costs summary{font-size:13px;font-weight:500}.ai-costs p{margin-top:10px}.ai-capture[data-step="capture"] .ai-costs{display:none}
#ai-status{font-size:15px;font-weight:600;margin:0 0 14px;line-height:1.5}#ai-error,#ai-warning{color:#8c3c1a;white-space:pre-wrap;font-size:14px;line-height:1.5;margin:12px 0}#ai-error:empty,#ai-warning:empty,#ai-per-scan:empty{display:none}.ai-details{border-radius:10px;padding:24px}.ai-photo-review{display:flex;gap:18px;align-items:flex-start;margin-bottom:22px}.ai-photo-review>div{min-width:0}.ai-photo-review .button{padding:8px 0;min-height:44px}#ai-photo-link{flex-shrink:0}#ai-photo{width:112px;height:140px;max-width:30vw;object-fit:contain;background:#f4f5f3;border:1px solid var(--line);border-radius:6px}#ai-reading{font-size:14px;line-height:1.5;margin-top:10px}#ai-per-scan{font-size:12px;margin:6px 0}#ai-saved{background:#edf2ed;color:#405b49;font-size:12px}
#ai-form fieldset{border:0;padding:0;margin:0;display:grid;grid-template-columns:1fr 1fr;gap:16px;min-width:0}#ai-form label{min-width:0;font-size:14px;font-weight:500;display:flex;flex-direction:column;gap:6px}#ai-form label:nth-child(-n+3),#ai-form label:last-child{grid-column:1/-1}#ai-form input,#ai-form textarea{width:100%;min-width:0;box-sizing:border-box;font-size:16px;font-weight:400;border-radius:6px}#ai-form textarea{min-height:96px}.ai-field-state{margin-left:6px;color:#a13535;font-size:12px;font-weight:700}.ai-field-state:empty{display:none}#ai-form label.is-missing input{border-color:#c98271;background:#fffaf8}.dictation-hint{font-size:12px;font-weight:400;color:var(--muted)}.ai-review-actions{margin-top:22px;display:flex;gap:8px}.ai-review-actions .button{flex:1;min-width:0}.ai-review-actions [hidden]{display:none}#ai-save{width:100%;font-size:15px;border-radius:6px}
@media(max-width:760px){body.ai-scan-active .topbar,body.ai-scan-active .mobile-navigation{display:none}.ai-heading{margin-bottom:12px}.ai-heading h1{font-size:22px}.ai-details{padding:18px}.ai-viewfinder{aspect-ratio:3/4;max-height:62vh}.ai-camera-actions{margin-top:12px}.ai-costs{margin-top:16px}body.ai-camera-active{position:fixed;inset:0;width:100%;height:100dvh;overflow:hidden;overscroll-behavior:none}body.ai-camera-active #app,body.ai-camera-active .shell,body.ai-camera-active .shell>div{height:100%;min-height:0}body.ai-camera-active .main.ai-scan-screen{height:100%;padding:12px 14px calc(12px + env(safe-area-inset-bottom));overflow:hidden}body.ai-camera-active .ai-capture[data-step="capture"]{height:100%;display:grid;grid-template-rows:auto auto minmax(0,1fr)}body.ai-camera-active .ai-camera-panel{display:grid;grid-template-rows:minmax(0,1fr) auto;min-height:0}body.ai-camera-active .ai-viewfinder{width:100%;height:100%;min-height:0;max-height:none;aspect-ratio:auto}}@media(max-width:390px){#ai-form fieldset{grid-template-columns:1fr}.ai-photo-review{gap:12px}.ai-camera-actions{display:grid}.ai-camera-actions .button{width:100%}}

#ai-form[hidden]{display:none!important}#ai-last-saved:empty{display:none}#ai-last-saved{padding:10px 12px;background:#edf2ed;border-radius:6px;font-size:14px;margin-bottom:14px}

#ai-last-saved{display:flex;align-items:center;justify-content:space-between;gap:12px}
#ai-last-saved[hidden]{display:none}
.ai-viewfinder{touch-action:none}
.ai-viewfinder video{transform-origin:center;object-fit:cover}
#ai-last-name{min-width:0;overflow-wrap:anywhere}
#ai-view-contact{flex:none;min-height:44px}
.ai-photo-review #ai-retake{padding:10px 14px;min-height:48px;white-space:normal}
#toast:not(.show){visibility:hidden}
@media(max-width:760px), (max-height:500px) and (pointer:coarse){
  body.ai-camera-active .sidebar,body.ai-camera-active .topbar,body.ai-camera-active .install-prompt{display:none}
  body.ai-scan-active .mobile-navigation{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
  body.ai-camera-active{position:fixed;inset:0;width:100%;height:100dvh;overflow:hidden;overscroll-behavior:none}
  body.ai-camera-active .main.ai-scan-screen{position:fixed;top:var(--staging-banner-height,0px);left:0;right:0;height:calc(100dvh - var(--staging-banner-height,0px) - 73px - env(safe-area-inset-bottom));width:100%;margin:0;padding:12px max(14px,env(safe-area-inset-right)) 12px max(14px,env(safe-area-inset-left));overflow:hidden;background:#f6f7f4}
  body.ai-camera-active .ai-capture[data-step="capture"]{height:100%;display:flex;flex-direction:column;min-height:0}
  body.ai-camera-active .ai-capture>header,body.ai-camera-active .ai-capture>p,body.ai-camera-active #ai-last-saved{flex:none}
  body.ai-camera-active .ai-camera-panel{flex:1;min-height:0;display:flex;flex-direction:column}
  body.ai-camera-active .ai-viewfinder{flex:1;min-height:0;height:auto;max-height:none;aspect-ratio:auto}
  body.ai-camera-active .ai-camera-actions{flex:none;margin-top:12px}
  body.ai-camera-active #ai-read{min-height:56px;font-size:18px;line-height:1.3;white-space:normal;padding:14px 18px}
  body.ai-camera-active .ai-heading>div{min-width:0}
  body.ai-camera-active .ai-heading p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}
