* { box-sizing: border-box; }
:root { font-family: "Segoe UI", system-ui, sans-serif; color: #363636; background: #F5F5F5; color-scheme: light; --green: #67A130; }
body { margin: 0; height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
header { background: white; border-bottom: 1px solid #e3e6df; }
.header-inner { max-width: 1120px; margin: auto; padding: 13px 18px; display: flex; align-items: center; gap: 10px; }
.brand { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.badge { margin-left: auto; background: #edf3e8; color: #40572a; border-radius: 30px; font-size: .8125rem; padding: 5px 10px; }
main { overflow: auto; display: flex; flex-direction: column; padding: 20px 16px; }
.welcome { margin: auto; padding: 10px 0; text-align: center; }
.mark { margin: 0 auto 16px; width: 120px; height: 120px; object-fit: contain; }
h1 { margin: 0; font-size: clamp(1.8rem, 6vw, 2.9rem); line-height: 1.1; letter-spacing: -.045em; }
.welcome p { color: #535c50; margin: 12px 0 0; }
footer, #conversation { width: min(100%, 760px); margin-inline: auto; }
footer { padding: 0 12px max(8px, env(safe-area-inset-bottom)); }
form { background: #fff; border: 1px solid #dce3d6; border-radius: 20px; padding: 10px; box-shadow: 0 8px 28px #2538150b; }
textarea { width: 100%; border: 0; background: transparent; resize: vertical; min-height: 54px; max-height: 25dvh; padding: 8px; color: inherit; font: inherit; }
form:focus-within { border-color: var(--green); }
textarea:focus { outline: none; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 11px; min-height: 44px; padding: 0 9px; font-family: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; }
button:focus-visible { outline: 2px solid #426c1d; outline-offset: 2px; }
.attach { color: #363636; background: #f4f6f2; border-color: #e4e9e0; }
.attach:hover { background: #e9f2df; }
button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.send { margin-left: auto; padding-inline: 15px; background: var(--green); color: #112000; }
.send:disabled { background: #e7eddf; color: #5c6654; cursor: default; }
.note, #status { font-size: .8125rem; color: #576052; margin: 8px 0 0; }
.note { text-align: center; }
#previews { display: flex; gap: 8px; overflow-x: auto; padding: 4px; }
[hidden] { display: none !important; }
figure { margin: 0; position: relative; overflow: hidden; border-radius: 10px; background: #e9eee4; }
#previews figure { flex: 0 0 96px; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
#previews img { height: 90px; }
.remove { position: absolute; right: 0; top: 0; min-width: 44px; color: white; background: #30362dee; font-size: 1.3rem; }
.fallback { padding: 8px; overflow-wrap: anywhere; font-size: .8125rem; }
#previews .fallback { padding-top: 46px; }
#conversation { display: grid; justify-items: end; gap: 16px; }
.message { width: fit-content; max-width: min(100%, 530px); padding: 12px; border-radius: 16px 16px 4px 16px; background: #e9f2df; overflow-wrap: anywhere; }
.message strong { font-size: .875rem; }
.message p { margin: 5px 0 0; white-space: pre-wrap; }
.photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); width: min(65vw, 420px); gap: 6px; margin-top: 8px; }
.photos img { aspect-ratio: 4 / 3; }
@media (min-width: 640px) { footer { padding-bottom: 18px; } form { padding: 12px; } button { padding-inline: 13px; } }


.header-inner strong { flex: 1; }
.reset { background: white; border-color: #dce3d6; color: #363636; flex-shrink: 0; }
.welcome { width: min(100%, 520px); }
.welcome .intro { line-height: 1.5; max-width: 440px; margin: 18px auto; }
.welcome-actions { display: grid; gap: 8px; margin: 16px 0; }
.welcome-actions button { min-height: 48px; font-size: 1rem; }
.primary { background: var(--green); color: #112000; }
.secondary { background: white; color: #426c1d; border-color: var(--green); }
.starters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.starters button { background: white; border-color: #dce3d6; color: #363636; text-align: left; justify-content: flex-start; min-height: 64px; padding: 12px; }
.welcome .attribution { font-size: .8125rem; margin-top: 18px; }
.prototype-note { font-size: .75rem; margin-top: 4px; }
@media (max-width: 380px) { .header-inner { padding: 8px; gap: 5px; } .header-inner strong { font-size: .875rem; } .mark { width: 90px; height: 90px; } }

.assistant-message { justify-self: start; width: min(100%, 620px); background: white; border: 1px solid #dce3d6; border-radius: 4px 16px 16px 16px; padding: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.assessment h3 { font-size: 1rem; margin: 16px 0 6px; border-top: 1px solid #e3e6df; padding-top: 12px; }
.assessment h3:first-child { margin-top: 0; border: 0; padding-top: 0; }
.assessment p { margin: 6px 0; white-space: pre-wrap; }
.assessment .cost { color: #426c1d; font-size: 1.5rem; font-weight: 700; }
.assessment ol { padding-left: 24px; }
.assessment-note { font-size: .8rem; color: #576052; }
.inspection-link { display: block; padding: 10px; border: 1px solid var(--green); border-radius: 8px; text-align: center; color: #426c1d; }
.assessment button { margin-top: 10px; background: #f4f6f2; }
.photo-open { display: block; width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; }
#photo-viewer { max-width: 95vw; max-height: 90dvh; padding: 12px; border: 0; border-radius: 12px; background: white; }
#photo-viewer::backdrop { background: #000b; }
#full-photo { width: auto; height: auto; max-width: 85vw; max-height: 72dvh; object-fit: contain; margin: auto; }
#close-photo { margin-bottom: 8px; }

#photo-summary { margin: 2px 4px; font-size: .8125rem; color: #576052; }
.photo-size { padding: 3px 6px; font-size: .75rem; color: #363636; }
.photo-pending { display: grid; align-items: end; height: 90px; padding: 8px 6px; font-size: .75rem; }
#status { max-height: 4em; overflow: auto; overflow-wrap: anywhere; }

#photo-progress { font-size: .8125rem; color: #576052; margin: 8px 0 0; }
#photo-progress:empty { margin: 0; }
#status.has-error { color: #882b20; }
.photo-open:disabled { cursor: default; }
