/* Focused UX layer: one scroll surface, small artwork with usable touch targets. */
#dialogBody details{border:1px solid var(--app-border);border-radius:8px;padding:10px 12px;margin:14px 0;min-width:0}
summary{cursor:pointer;min-height:44px;align-content:center;font-weight:700;overflow-wrap:anywhere}
#harvestForm summary{margin:0}#harvestForm details[open] summary{margin-bottom:10px}
.form-save{position:sticky;bottom:-20px;background:var(--app-surface);padding:12px 0 max(12px,env(safe-area-inset-bottom));border-top:1px solid var(--app-border);z-index:2}.form-save button{width:100%}
.target-fields{max-height:none;overflow:visible;padding:0;border:0}.target-fields input{max-width:none}.target-fields details{margin:8px 0}
.harvest-filters{display:grid;grid-template-columns:2fr 1fr 1fr;gap:12px;align-items:end}.harvest-filters label{min-width:0}.history-card{border:1px solid var(--app-border);padding:12px;border-radius:8px;margin-top:12px}.history-card dt{font-weight:700;margin-top:14px}.history-card dd{margin:6px 0;display:grid;gap:6px;overflow-wrap:anywhere}.history-card dd span{color:var(--app-text-muted)}
.boundary-handle,.boundary-handle.selected{width:44px;height:44px;min-height:44px;display:grid;place-items:center;background:transparent;border:0;box-shadow:none;outline:none;padding:0;border-radius:50%}.boundary-handle span{display:grid;place-items:center;width:28px;height:28px;border:2px solid white;background:#ac4e27;border-radius:50%;color:white;box-shadow:0 1px 5px #0005;font-size:11px}.boundary-handle.selected span{background:#285ea8;outline:3px solid #ffd46b}.boundary-handle:focus-visible{outline:3px solid #ffd46b}
.gallery .photo-thumb{width:100%;padding:0;display:block;overflow:hidden;text-align:left}.gallery .photo-thumb span{display:block;padding:8px;overflow-wrap:anywhere}#dialogBody .photo-thumb img{margin:0;width:100%;height:140px}.gallery button{min-height:44px}
.photo-dialog[open]{display:flex;flex-direction:column;gap:10px;width:min(1000px,calc(100vw - 20px));height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding:12px;overflow:hidden;background:var(--app-surface);color:var(--app-text)}.photo-toolbar{display:flex;gap:8px;align-items:center;flex:none}.photo-toolbar span{flex:1;min-width:0;font-size:13px;overflow-wrap:anywhere}.photo-toolbar button{min-width:44px;padding:8px}.photo-viewport{min-height:0;flex:1;overflow:auto;background:var(--app-surface-muted);touch-action:pan-x pan-y}.photo-viewport img{display:block;width:100%;height:100%;object-fit:contain;cursor:zoom-in}.photo-viewport img.zoomed{width:200%;height:auto;max-width:none;cursor:zoom-out}.photo-status{font-size:13px;margin:0}
#dialog.pdf-dialog[open]{display:flex;flex-direction:column;height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow:hidden}#dialog.pdf-dialog .dialog-heading{flex:none;position:static}#dialog.pdf-dialog #dialogBody{display:flex;flex-direction:column;min-height:0;flex:1;overflow:hidden;padding-bottom:10px}.pdf-preview{display:flex;flex-direction:column;flex:1;min-height:0}.pdf-actions,.pdf-toolbar,.pdf-status{flex:none}.pdf-toolbar{margin:8px 0}.pdf-dialog .pdf-canvas-wrap{min-height:60px;flex:1;max-height:none;height:auto}.pdf-preview>.fine{margin:6px 0 0}.pdf-dialog .dialog-error:empty{display:none}
.network-notice{position:fixed;left:12px;right:12px;bottom:calc(76px + env(safe-area-inset-bottom));z-index:11;padding:10px 14px;background:var(--app-surface);color:var(--app-text);border:2px solid #b87930;border-radius:8px;font-size:13px;max-width:650px;margin:auto;pointer-events:none}
header>div,.profile-copy,.brand-copy{min-width:0}.profile-copy strong{max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.profile-card>div{min-width:0;overflow-wrap:anywhere}#dialogBody fieldset{min-width:0}#permissionChecks{display:grid;gap:4px}#permissionChecks .check{margin:4px 0;min-height:44px}.forecast-list article[hidden]{display:none}
@media(max-width:760px){.harvest-filters{grid-template-columns:1fr 1fr}.harvest-filters label:first-child{grid-column:1/-1}.form-save{bottom:-20px}.network-notice{font-size:12px}.profile-copy strong{max-width:120px}}
@media(max-height:550px){.pdf-preview>.fine{display:none}.pdf-actions>*{padding:8px}.pdf-toolbar{margin:4px 0}.pdf-dialog .dialog-heading{padding:4px 12px}.pdf-dialog .dialog-heading h2{font-size:16px;margin:6px 0}.pdf-actions{gap:4px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
/* 0.7.4: fixed dialog frame, independently scrolling content, real footer space. */
#dialog[open]{display:flex;flex-direction:column;width:min(660px,calc(100vw - 32px));max-height:calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow:hidden;border-radius:14px}
#dialog .dialog-heading{position:static;flex:none;padding:18px 22px;border-bottom:1px solid var(--app-border);gap:16px}#dialogTitle{margin:0;font-size:21px;line-height:1.3;outline:none}
#dialog #dialogBody{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;padding:18px 22px 22px;scroll-padding:20px}
#dialogFooter{flex:none;border-top:1px solid var(--app-border);padding:14px 22px max(14px,env(safe-area-inset-bottom));background:var(--app-surface)}#dialogFooter .form-save{position:static;padding:0;margin:0;border:0}#dialogFooter button{min-height:48px;width:100%}
#dialogBody form{margin:0}#dialogBody form>label:first-child{margin-top:0}#dialogBody .form-intro{margin:0 0 18px}#dialogBody label{font-size:15px;margin:10px 0 14px}#dialogBody textarea{min-height:80px}#dialogBody .dialog-error:empty,#dialogBody p:empty{display:none}#dialogBody .dialog-error{margin-bottom:0}
.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}.field-grid>label:only-child{grid-column:1/-1}.field-grid>label{min-width:0}.report-settings fieldset{margin:18px 0;border-color:var(--app-border);padding:10px 14px}.report-settings legend{font-weight:700;font-size:15px;padding:0 6px}
.place-note{white-space:pre-wrap;margin:12px 0 20px}.place-gallery{border-top:1px solid var(--app-border);margin-top:24px;padding-top:18px}.place-gallery h2{margin:0 0 14px;font-size:18px}.upload-area{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.upload-area .upload-hint{margin:0;font-size:12px}.upload-area [data-progress]{flex:1 1 100%;font-size:13px;margin:0;overflow-wrap:anywhere}.upload-area [data-upload]{flex:1 1 100%}
#dialogBody label.file-picker{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:48px;padding:10px 16px;border:1px solid var(--app-border);border-radius:8px;background:var(--app-surface-muted);font-size:15px;font-weight:700;cursor:pointer;margin:0}.file-picker:before{content:'+';font-size:23px;line-height:1;font-weight:400}.file-picker:focus-within{outline:3px solid #b88339;outline-offset:2px}.file-picker input[type=file]{position:absolute;inset:0;opacity:0;width:100%;height:100%;min-height:0;margin:0;padding:0;cursor:pointer}.gallery:empty{display:none}.gallery:not(:empty){margin-bottom:18px}.gallery .photo-thumb{border-radius:8px}.gallery .photo-thumb span{font-size:12px;color:var(--app-text-muted)}
.boundary-banner{max-width:230px;min-height:44px;border-color:var(--app-border);box-shadow:0 2px 8px #0001}.boundary-banner strong{font-weight:650}.boundary-summary{padding:20px;border:1px solid var(--app-border);border-radius:10px;background:var(--app-surface);margin-bottom:20px}.boundary-summary h2{margin-top:0}.source-details{border-bottom:1px solid var(--app-border);padding:12px 0}.source-details summary{font-size:15px}.source-details>p{font-size:14px;color:var(--app-text-muted)}#reviewView{max-width:900px}
#dialog.pdf-dialog[open]{width:min(1000px,calc(100vw - 24px));height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}#dialog.pdf-dialog #dialogBody{display:flex;flex-direction:column;overflow:hidden;padding:12px}.dialog-notice{margin-top:0}
@media(max-width:560px){#dialog[open]{width:calc(100vw - 20px);max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));border-radius:12px}#dialog .dialog-heading{padding:14px 16px}#dialogTitle{font-size:19px}#dialog #dialogBody{padding:16px}#dialogFooter{padding:12px 16px max(12px,env(safe-area-inset-bottom))}.field-grid{grid-template-columns:1fr;gap:0}.boundary-summary{padding:16px}.upload-area{gap:8px 12px}}
@media(max-height:550px){#dialog .dialog-heading{padding:8px 16px}#dialogFooter{padding-top:8px;padding-bottom:8px}#dialog #dialogBody{padding-top:12px;padding-bottom:12px}}

.field-grid>label:last-child:nth-child(odd){grid-column:1/-1}

/* Place categories and personal map layers. */
.place-type-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.place-type-grid button{display:flex;align-items:center;gap:12px;text-align:left;padding:14px;min-height:86px}.place-type-grid button>svg{width:34px;height:34px;flex:none}.place-type-grid button>span{min-width:0}.place-type-grid strong{display:block;font-size:15px;overflow-wrap:anywhere}.place-type-grid small{display:block;font-size:12px;font-weight:400;color:var(--app-text-muted);margin-top:4px}.place-type-grid button:hover{background:var(--app-surface-muted)}
.map-legend{position:absolute;z-index:4;top:76px;left:calc(var(--sidebar) + 12px);max-width:calc(100% - var(--sidebar) - 76px);background:var(--app-surface);border:1px solid var(--app-border);border-radius:8px;box-shadow:0 2px 8px #0002;color:var(--app-text)}.map-legend>summary{padding:0 12px;min-height:44px;font-size:13px;list-style-position:inside}.map-legend>summary span{font-weight:400;color:var(--app-text-muted)}.map-legend[open]{width:285px;max-width:calc(100% - var(--sidebar) - 24px)}.legend-content{padding:0 12px 12px;max-height:calc(100dvh - 260px);overflow:auto;overscroll-behavior:contain}.legend-content>.fine{font-size:11px;margin:6px 0 10px}.legend-content .check{margin:0;min-height:44px;gap:10px;font-size:13px;cursor:pointer}.legend-content .check>span:not(.boundary-swatch){flex:1;min-width:0}.legend-content svg{width:24px;height:24px;flex:none;fill:none}.legend-content input{accent-color:var(--app-primary)}.legend-content button{width:100%;font-size:13px;margin:8px 0}.boundary-toggle{border-top:1px solid var(--app-border);margin-top:6px!important}.boundary-swatch{width:24px;border-top:3px solid #ac4e27;flex:none}#legendStatus:empty{display:none}
#placementRadius{font-size:13px;margin:8px 0}#placementRadius output{float:right;font-weight:700}#placementRadius input{width:100%;min-height:28px;margin:4px 0}.placement:has(#placementRadius:not([hidden])){max-height:50%;overflow:auto}#mapStatus{top:128px;max-width:calc(100% - var(--sidebar) - 76px)}
@media(max-width:420px){.place-type-grid{gap:8px}.place-type-grid button{padding:10px 8px;gap:8px;min-height:90px;flex-direction:column;align-items:flex-start}.place-type-grid button>svg{width:28px;height:28px}.place-type-grid strong{font-size:13px}.place-type-grid small{font-size:11px}.legend-content{max-height:calc(100dvh - 245px)}}
@media(max-height:550px){.legend-content{max-height:calc(100dvh - 205px)}.placement:has(#placementRadius:not([hidden])){max-height:65%}}

.storage-summary progress{width:100%;height:18px;accent-color:var(--text,#171916)}.storage-summary h2 small{font-size:16px;font-weight:400}.storage-breakdown{display:grid;grid-template-columns:1fr auto;gap:12px}.storage-breakdown dd{margin:0;font-weight:700}.storage-plans{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.storage-plans>div{border:1px solid var(--border,#ccc);padding:16px;border-radius:10px;display:grid;gap:4px}.contract-text{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;max-height:50vh;overflow:auto}.contract-item{border-bottom:1px solid #ccc;padding-bottom:20px;margin-bottom:20px}.contract-item form{display:grid;gap:14px;margin-top:18px}.contract-item .check{align-items:flex-start}

/* Bound the legend to the map, including short landscape screens and PWA safe areas. */
.map-legend[open]{max-height:calc(100% - 92px);overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.map-legend>summary{position:sticky;top:0;background:var(--app-surface);z-index:1}.map-legend .legend-content{max-height:none;overflow:visible}#harvestMapOptions{padding:0 0 8px}#harvestMapOptions label{font-size:13px}#harvestMapOptions select{min-height:44px}#harvestMapOptions .fine{font-size:12px;margin:6px 0}.harvest-row{align-items:center;gap:12px}.harvest-row>span{min-width:0;overflow-wrap:anywhere}.harvest-thumb{width:72px;height:72px;flex:0 0 72px;object-fit:cover;border-radius:6px;background:var(--app-border)}.map-marker-art.is-harvest{border-radius:50%;color:#8b3d1f;border-color:#8b3d1f}@media(max-width:420px){.harvest-thumb{width:56px;height:64px;flex-basis:56px}.harvest-row{gap:10px}}

/* 0.9.2: constrain the real form boxes, including Safari's intrinsic date/fieldset sizes. */
#shell,#shell>section,.page,.sky-timeline,.sky-heading,.sky-content{min-width:0;min-inline-size:0}
.page{overflow-x:hidden;overflow-y:auto}
#dialog[open]{max-width:calc(100% - 20px);min-width:0;margin:auto}
#dialog #dialogBody{width:100%;max-width:100%;min-width:0;min-inline-size:0;overflow-x:hidden;overflow-y:auto}
#dialogBody form,#dialogBody fieldset{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0;inline-size:100%;max-inline-size:100%;min-inline-size:0;margin-inline:0}
#dialogBody fieldset{contain:inline-size}#dialogBody legend{max-width:100%;white-space:normal;overflow-wrap:anywhere}
#dialogBody label,.sky-heading>*,.sky-readings>*,.species-quick>*,.field-grid>*,.harvest-filters>*,.gallery>*{min-width:0;min-inline-size:0;max-width:100%}
input,select,textarea{box-sizing:border-box;min-inline-size:0;max-inline-size:100%}
input[type=date],input[type=datetime-local],input[type=time]{-webkit-appearance:none;appearance:none;display:block;box-sizing:border-box;width:100%;inline-size:100%;min-width:0;min-inline-size:0;max-width:100%;max-inline-size:100%;min-height:48px;line-height:1.4;text-align:left;overflow:hidden}
input::-webkit-date-and-time-value{min-width:0;text-align:left;line-height:1.4}
input::-webkit-datetime-edit{min-width:0;padding:0}
.sky-heading{flex-wrap:wrap;align-items:flex-end}.sky-heading>label{flex:0 1 220px;max-width:100%}.sky-heading>div{flex:1 1 180px}.sky-now{flex-wrap:wrap}.sky-clock{white-space:nowrap}.sky-light{overflow-wrap:anywhere}.sky-readings{grid-template-columns:repeat(2,minmax(0,1fr))}.sky-events{grid-template-columns:repeat(3,minmax(0,1fr))}.sky-events button{min-width:0;white-space:normal;overflow-wrap:anywhere}.sky-location{overflow-wrap:anywhere}.sky-panorama{min-height:0;aspect-ratio:720/290}
.species-quick button{min-width:0;white-space:normal;overflow-wrap:anywhere}.photo-dialog,.photo-viewport,.pdf-preview{min-width:0}.photo-toolbar{flex-wrap:wrap}.photo-toolbar span{flex:1 1 120px}
/* Icon buttons have explicit boxes; typography cannot change their shape or centre. */
#add.fab{display:grid;place-items:center;box-sizing:border-box;width:50px;min-width:50px;max-width:50px;height:50px;min-height:50px;max-height:50px;aspect-ratio:1;padding:0;border:0;border-radius:7px;line-height:1;right:max(12px,env(safe-area-inset-right));bottom:48px;box-shadow:0 2px 8px #0003}
#add.fab svg{display:block;width:24px;height:24px;stroke-width:2.2;pointer-events:none}
#recenter{display:grid;place-items:center;box-sizing:border-box;width:44px;min-width:44px;height:44px;min-height:44px;padding:0;border-radius:6px;line-height:1}
#recenter svg{width:23px;height:23px;pointer-events:none}
.maplibregl-ctrl-group button{width:44px;height:44px;min-width:44px;min-height:44px;padding:0;line-height:1}
button,summary,nav,.maplibregl-control-container{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
/* Credits stay available with one tap, rather than opening across the map by default. */
.maplibregl-ctrl-bottom-right{max-width:calc(100% - 12px)}
.maplibregl-ctrl-attrib.maplibregl-compact{box-sizing:border-box;min-height:32px;width:32px;padding:0;border-radius:6px;background:#fffffff0;margin:0 10px 8px 0}
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button{box-sizing:border-box;right:0;top:0;width:32px;height:32px;min-width:32px;min-height:32px;max-width:32px;max-height:32px;margin:0;padding:0;border:0;border-radius:6px;background-position:center;background-repeat:no-repeat}
.maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show{width:auto;max-width:min(360px,calc(100vw - 24px));padding:8px 38px 8px 10px;line-height:1.5}
.maplibregl-ctrl-attrib-inner{overflow-wrap:anywhere;white-space:normal}

.boundary-banner{bottom:48px}
@media(max-width:760px){.sky-heading>label{flex-basis:100%;width:100%}.sky-readings{grid-template-columns:minmax(0,1fr)}.sky-events{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:360px){#dialog .dialog-heading{padding:12px}#dialog #dialogBody{padding:12px}#dialogFooter{padding-left:12px;padding-right:12px}.sky-timeline{padding:10px}.sky-now{gap:4px 10px}.sky-light{text-align:left;max-width:100%}.storage-plans{grid-template-columns:minmax(0,1fr)}}

/* Read first: compact event facts, then photos; mutation controls require an explicit action. */
.harvest-detail{min-width:0}.record-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.record-heading .eyebrow{margin:0}.record-status{padding:4px 9px;border:1px solid var(--app-border);border-radius:5px;font-size:12px;color:var(--app-danger)}.harvest-detail h3{font-size:23px;line-height:1.3;margin:10px 0 6px;overflow-wrap:anywhere}.record-summary{margin:0 0 20px;color:var(--app-text-muted);font-variant-numeric:tabular-nums}.record-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:0 0 18px}.record-facts>div{min-width:0}.record-facts dt{font-size:12px;color:var(--app-text-muted);margin-bottom:4px}.record-facts dd{margin:0;font-size:16px;font-weight:600;overflow-wrap:anywhere}.record-note{margin:20px 0}.harvest-detail h4{font-size:16px;margin:0 0 10px}.record-note p{white-space:pre-wrap;overflow-wrap:anywhere;margin:0}.record-photos{border-top:1px solid var(--app-border);padding-top:18px;margin-top:20px}.record-photos .fine{margin:0 0 16px}.record-history{margin-top:10px;color:var(--app-text-muted);font-size:13px}.record-additional[open] .record-facts{margin-top:16px;margin-bottom:4px}@media(max-width:420px){.harvest-detail h3{font-size:20px}.record-facts{grid-template-columns:minmax(0,1fr);gap:12px}.record-summary{margin-bottom:16px}}
