.field-visit { margin: 1rem 0; border: 1px solid #b8cbbf; border-radius: 12px; padding: .8rem; background: #f5f8f3; }
.field-visit > summary { cursor: pointer; font-weight: 700; padding: .35rem 0; }
.field-visit fieldset { min-width: 0; border: 0; border-top: 1px solid #c8d4ca; padding: 1rem 0; margin: 1rem 0 0; }
.field-visit legend { font-weight: 700; }
.field-visit input:not([type=checkbox]):not([type=file]), .field-visit select, .field-visit textarea { box-sizing: border-box; width: 100%; min-width: 0; }
.field-visit input[type=checkbox] { width: 22px; height: 22px; flex-shrink: 0; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.field-checks { display: grid; gap: .35rem; margin: .7rem 0; }
.field-checks label { display: flex; gap: .6rem; align-items: center; min-height: 44px; }
.field-photo-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.field-photo-actions .button { display: inline-flex; align-items: center; cursor: pointer; min-height: 44px; }
.field-photo-actions .field-camera { display: none; }
html[data-layout="mobile"] .field-photo-actions .field-camera { display: inline-flex; }
html[data-layout="desktop"] #fieldCamera { display: none; }
.field-photos { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.field-photo { margin: 0; min-width: 0; }
.field-photo img { max-width: 100%; width: 100%; height: 150px; object-fit: cover; border-radius: 8px; }
.field-photo select, .field-photo input { margin-top: .4rem; }
.field-stem { display: flex; gap: .5rem; align-items: end; margin: .5rem 0; }
.field-stem label { flex: 1; }
.field-stem button { flex-shrink: 0; }
.field-history { margin-top: 1rem; }
.field-history article { border-top: 1px solid #d1dbd4; padding: .8rem 0; }
.field-history h4 { margin: .3rem 0; }
.field-history .field-photo-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.field-photo-links img { width: 96px; height: 80px; object-fit: cover; border-radius: 6px; }
.field-history p { overflow-wrap: anywhere; white-space: pre-line; }
.field-recovery { padding: .75rem; background: #fff7de; border-radius: 8px; margin: .6rem 0; }
#recordFieldVisit { display: none; }
#findMe { display: none; min-height: 44px; }
html[data-layout="mobile"] #findMe { display: block; }
body[data-field-visit="true"] .observation-fields { display: none; }
html[data-layout="mobile"] #recordFieldVisit { display: block; width: 100%; margin: .8rem 0; }
html[data-layout="mobile"] .field-visit { background: white; }
html[data-layout="mobile"] .field-visit input, html[data-layout="mobile"] .field-visit select, html[data-layout="mobile"] .field-visit textarea { font-size: 16px; }
html[data-layout="mobile"] .field-visit button, html[data-layout="mobile"] .field-visit select, html[data-layout="mobile"] .field-visit input:not([type=checkbox]):not([type=file]) { min-height: 44px; }
.field-visit button:focus-visible, .field-photo-actions:focus-within { outline: 3px solid #ce991b; outline-offset: 2px; }
#fieldLocationMarker { fill: #2f81df; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; }
#fieldLocationAccuracy { fill: #2f81df; fill-opacity: .12; stroke: #2f81df; stroke-opacity: .5; vector-effect: non-scaling-stroke; pointer-events: none; }

.field-step { border-top: 1px solid #c8d4ca; margin-top: .6rem; padding-top: .3rem; }
.field-step > summary { min-height: 44px; padding: .6rem .2rem; cursor: pointer; font-weight: 700; }
.field-step > summary:focus-visible { outline: 3px solid #ce991b; outline-offset: 2px; }
.field-step .field-next { margin: .8rem 0; }
.field-step .subdetails > summary { min-height: 44px; align-content: center; }
#fieldLocationPrompt { max-width: 26rem; width: calc(100% - 2rem); box-sizing: border-box; border: 1px solid #b8cbbf; border-radius: 16px; padding: 1.2rem; color: #203b32; background: #fff; }
#fieldLocationPrompt::backdrop { background: rgb(0 0 0 / 35%); }
#fieldLocationPrompt button { min-height: 44px; }

.field-known-tree { font-weight: 700; margin-bottom: .2rem; }
.field-primary { margin: .9rem 0; }
.field-primary fieldset { border: 0; padding: 0; margin: 0; }
.field-primary legend { margin-bottom: .5rem; }
#fieldStepMeasurements { border-top: 1px solid #c8d4ca; padding-top: .8rem; }
#fieldVisitForm > details { margin-top: .8rem; }
#fieldVisitForm > details > summary { min-height: 44px; cursor: pointer; align-content: center; }

.field-photo-actions .button { padding: .6rem .8rem; border: 1px solid #9db6a5; border-radius: 8px; background: #fff; color: #203b32; font-weight: 600; }
.field-photo-actions .field-camera { background: #245c42; border-color: #245c42; color: white; }
#fieldAdvanced { border-top: 1px solid #c8d4ca; padding-top: .4rem; }
/* During a phone visit, use the inspector itself instead of nesting another card. */
html[data-layout="mobile"] body[data-field-visit="true"] #fieldVisit { border: 0; padding: 0; margin: 0; }
html[data-layout="mobile"] body[data-field-visit="true"] #fieldVisit > summary,
html[data-layout="mobile"] body[data-field-visit="true"] #fieldVisit > p { display: none; }

.measurement-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.measurement-heading h3 { margin: 0; font-size: 1rem; }
.field-visit .measurement-change { border: 0; background: transparent; color: #245c42; text-decoration: underline; padding: .25rem; font-size: .85rem; min-height: 44px; }
#fieldMeasurementDetails { margin-top: .5rem; }

/* One editor: desktop leads with tree details; phone leads with observations. */
#recordFieldVisit { display: none !important; }
html[data-layout="desktop"] #changeFieldTree,
html[data-layout="desktop"] #fieldMapCorrections { display: none; }
html[data-layout="desktop"] #fieldVisitForm > .measurement-heading { display: none; }

#findMe { position: absolute; top: 12px; right: 12px; z-index: 8; width: 44px; height: 44px; min-width: 44px; padding: 11px; border-radius: 50%; background: #fff; border: 1px solid #a7b9ac; box-shadow: 0 1px 5px #102c2433; }
#findMe img { width: 20px; height: 20px; display: block; }
#findMe.location-active { background: #e0efff; border-color: #2f81df; }
#fieldLocationMarker { transition: opacity .15s; }
#fieldLocationMarker.location-faded { opacity: .15; }
html[data-layout="mobile"] #fieldMapCorrections > summary { display: none; }
#mobileFieldSequence h3 { margin: .9rem 0 .4rem; font-size: 1rem; }
#mobileFieldSequence > section { border-top: 1px solid #c8d4ca; padding-bottom: .5rem; }
html[data-layout="mobile"] #changeFieldTree { display: none; }
#offlineQueue { margin: .5rem; padding: .65rem; background: #fff7de; border-radius: 8px; }
#offlineQueue summary { cursor: pointer; }
#offlineQueue .queue-error { color: #a32222; }
#offlineQueue button { margin: .3rem .4rem .3rem 0; min-height: 44px; }

.queued-crown { fill: #d38a1418; stroke: #ca7d08; stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; cursor: pointer; }
body[data-map-task="true"] #queuedOutlines { pointer-events: none; opacity: .25; }

/* Guided tree editing: shared order, one section at a time on phones. */
.guided-step { border-top: 1px solid #c8d4ca; padding: .5rem 0; }
.guided-step > summary { min-height: 44px; align-content: center; font-weight: 700; cursor: pointer; }
.guided-step:focus { outline: none; }
.guided-step:focus-visible > summary { outline: 2px solid #245c42; }
.recorded-fact { display: block; margin-bottom: .5rem; }
.field-navigation { display: flex; gap: .5rem; }
.field-navigation button { min-height: 44px; }
body[data-guided-edit="true"] #fieldMapCorrections { display: block; }
body[data-guided-edit="true"] #fieldMapCorrections > summary,
body[data-guided-edit="true"] #fieldStepTree > summary,
body[data-guided-edit="true"] #fieldVisit > summary,
body[data-guided-edit="true"] #fieldVisit > p,
body[data-guided-edit="true"] #changeFieldTree { display: none; }
#fieldNewMeasurement > summary { min-height: 44px; align-content: center; cursor: pointer; }
html[data-layout="mobile"] body[data-guided-edit="true"]:not([data-guided-step="5"]) #saveTree { display: none; }
html[data-layout="mobile"] .guided-step > summary { pointer-events: none; list-style: none; }
html[data-layout="mobile"] .guided-step > summary::-webkit-details-marker { display: none; }
html[data-layout="mobile"] .field-navigation { flex: 1; }
html[data-layout="mobile"] #fieldNext { margin-left: auto; }
