/* The estimator: a map beside a short panel of steps. Phone: the map on top, the steps below it. */
.est { display: grid; grid-template-columns: minmax(0, 1fr); }
/* the skip link lands below the bar (gate W14): the header space is main's margin, not .est's padding */
main:has(> .est) { margin-top: calc(var(--header-h) + env(safe-area-inset-top)); }
.est__map-col { position: relative; isolation: isolate; z-index: 0; height: 58svh; min-height: 340px; background: #33494b; }
.no-map .est__bar, .no-map .est__view { display: none !important; }
.est-step__h:focus { outline: none; }
.est-step__h:focus-visible { outline: 3px solid var(--tide); outline-offset: 4px; }
/* !important: Leaflet writes an inline "position: relative" when this sheet has not applied yet as the map starts (WebKit,
   owner-feedback pass 2026-11-12: the map came out 0px tall and a tap on it landed on the logo) */
.est__map { position: absolute !important; inset: 0; background: #33494b; }
.est__veil { position: absolute; inset: 0; z-index: 500; display: grid; place-items: center; padding: 24px; text-align: center; pointer-events: none;
  background: linear-gradient(180deg, rgb(18 20 22 / .55), rgb(18 20 22 / .82)); color: #fff; transition: opacity .5s ease; }
.est__veil p { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.3rem, 2.6vw, 2rem); letter-spacing: -0.01em; font-variation-settings: "wdth" 108; max-width: 18ch; text-shadow: 0 2px 18px rgb(0 0 0 / .5); }
/* Hap, 2026-11-12: "Remove find your address to open the satellite view, so you can scroll and zoom in on the map".
   The map is open and movable from the start; the veil only carries the two failure messages (no map, no imagery). */
.est__veil { opacity: 0; }
.no-map .est__veil, .tiles-bad .est__veil { opacity: 1; }

/* the bar over the map: the live area and the two tools, always under the thumb */
.est__bar { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 600; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 16px; border-radius: var(--radius-frame); background: #fff; box-shadow: 0 14px 34px -12px rgb(0 0 0 / .5); }
.est__bar-area { margin: 0; display: flex; flex-direction: column; line-height: 1.25; }
.est__bar-area .measure-num { font-size: 1.15rem; }
.est__bar-hint { font-size: var(--small); color: var(--soft); }
.est__bar-tools { display: flex; gap: 6px; }
.est-tool { min-height: var(--tap); padding: 0 14px; border-radius: var(--radius); border: 1.5px solid #c9cac6; background: #fff; font-weight: 650; font-size: .92rem; cursor: pointer; }
.est-tool:hover:not(:disabled) { border-color: var(--ink); }
.est-tool:disabled { opacity: .45; cursor: default; }
.est__view { position: absolute; top: 12px; right: 12px; z-index: 600; display: inline-flex; padding: 4px; border-radius: 999px; background: rgb(18 20 22 / .82); backdrop-filter: blur(6px); }
.est__view button { min-height: 38px; min-width: 76px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: #fff; font-weight: 650; font-size: .9rem; cursor: pointer; }
.est__view button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.est__view::after { content: ""; position: absolute; inset: -3px; }

/* the corner handles and the drawn shape */
.est-pt { width: 44px !important; height: 44px !important; margin: -22px 0 0 -22px !important; display: grid; place-items: center; background: none; cursor: grab; }   /* a 44px touch target */
.est-pt i { display: block; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--ink), 0 2px 8px rgb(0 0 0 / .5); transition: transform .15s var(--ease-out); }
.est-pt:hover i, .est-pt.leaflet-drag-target i { transform: scale(1.2); }
.est-pt--first i { background: var(--stripe); }
.leaflet-container { font-family: var(--font-body); background: #33494b; }
.leaflet-control-attribution { font-size: 12px !important; }
.leaflet-touch .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; }
.est-shape { transition: fill-opacity .6s ease, stroke-opacity .6s ease; }

.est__panel { --pad: var(--gutter); padding: 28px var(--pad) calc(48px + env(safe-area-inset-bottom)); min-width: 0; }
.est__head h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); line-height: 1; }
.est__head p { color: var(--muted); margin: 14px 0 0; max-width: 44ch; }
.est__steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 0; }
.est-step { padding: 26px 0; border-top: 1px solid var(--line); }
.est-step__h { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; font-variation-settings: "wdth" 108; margin-bottom: 14px; }
.est-step__n { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink); font-family: var(--font-measure); font-size: .88rem; font-weight: 600; font-variation-settings: normal; }
.est-step.is-done .est-step__n { background: var(--ink); color: #fff; }
.est-step__p { color: var(--muted); margin: 0 0 14px; }
.est-find label { display: block; font-weight: 650; font-size: .95rem; margin-bottom: 8px; }
.est-find__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.est-find__msg { margin: 10px 0 0; font-size: var(--small); color: var(--soft); min-height: 1em; }
.est-results { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.est-results button { width: 100%; min-height: var(--tap); text-align: left; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: .95rem; }
.est-results button:hover { border-color: var(--ink); }
.est-manual { border-radius: var(--radius-frame); box-shadow: var(--hair); }
.est-manual summary { list-style: none; cursor: pointer; min-height: 52px; display: flex; align-items: center; padding: 0 16px; font-weight: 650; color: var(--tide); }
.est-manual summary::-webkit-details-marker { display: none; }
.est-manual__in { padding: 4px 16px 18px; }
.est-manual__row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: end; }
.est-manual__row label { font-weight: 650; font-size: .92rem; display: grid; gap: 6px; }
.est-manual__row > span { padding-bottom: 16px; color: var(--soft); }
.est-manual__or { margin: 16px 0 8px; font-size: var(--small); color: var(--soft); }
.est-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.est-chips button { min-height: var(--tap); padding: 0 14px; border-radius: 999px; border: 1.5px solid #c9cac6; background: #fff; font-size: .9rem; font-weight: 600; cursor: pointer; }
.est-chips button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.opt { color: var(--soft); font-weight: 450; }

.est-group { border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
.est-group legend { font-weight: 650; font-size: .95rem; margin-bottom: 10px; padding: 0; }
.est-seg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.est-seg--3 { grid-template-columns: minmax(0, 1fr); }
.est-seg label, .est-opt { position: relative; display: block; cursor: pointer; }
.est-seg input, .est-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.est-seg span { display: flex; align-items: center; min-height: 50px; padding: 0 14px; border-radius: var(--radius); border: 1.5px solid #c9cac6; font-weight: 600; font-size: .95rem; transition: border-color .2s, background-color .2s; }
.est-seg input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.est-seg input:focus-visible + span, .est-opt input:focus-visible + .est-opt__box { outline: 3px solid var(--tide); outline-offset: 2px; }
.est-seg input:disabled + span { opacity: .4; cursor: not-allowed; }
.est-opts { display: grid; gap: 8px; }
.est-opt__box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 14px 16px; border-radius: var(--radius); border: 1.5px solid #c9cac6; transition: border-color .2s, box-shadow .2s; }
.est-opt__name { font-weight: 700; }
.est-opt__rate { font-size: var(--small); color: var(--soft); white-space: nowrap; align-self: center; }
.est-opt__line { grid-column: 1 / -1; font-size: var(--small); color: var(--muted); }
.est-opt input:checked + .est-opt__box { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
@media (min-width: 560px) { .est-seg--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.est-step--range { background: var(--concrete); margin: 0 calc(-1 * var(--pad)); padding: 28px var(--pad); border-top: 0; }
.est-range { margin: 0; font-family: var(--font-display); font-weight: 850; font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.05; letter-spacing: -0.02em; font-variation-settings: "wdth" 112; }
.est-range.is-empty { font-size: 1.15rem; font-weight: 650; color: var(--soft); font-family: var(--font-body); font-variation-settings: "wdth" 100; letter-spacing: 0; }
.est-break { margin: 18px 0 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.est-break dt, .est-break dd { margin: 0; padding: 10px 0; border-top: 1px solid #e0e0dc; font-size: .95rem; }
.est-break dt { color: var(--muted); }
.est-break dd { font-weight: 650; text-align: right; }
.est-flag { margin: 16px 0 0; padding: 12px 14px; border-left: 3px solid var(--paint-deep); background: #fff; font-size: .95rem; }
.est-status { margin: 16px 0 0; font-size: var(--small); color: var(--soft); }

@media (min-width: 1024px) {
  .est { grid-template-columns: minmax(0, 7fr) minmax(400px, 5fr); align-items: start; }
  .est__map-col { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top)); height: calc(100svh - var(--header-h)); min-height: 560px; }
  .est__bar { left: 20px; bottom: 20px; right: auto; min-width: 360px; }
  .est__view { top: 20px; right: 20px; }
  .est__panel { --pad: clamp(28px, 3vw, 56px); padding: 44px var(--pad) 64px; }
}
.capture .est__map-col { position: relative; }

/* the estimator: the solid header meets the map directly; no white lip over the imagery */
.page-est .edge--top { display: none !important; }

/* 2026-11-11 refinement: progress, the two ways to measure, the summary, the visit request's states */
.est__head .label { margin-bottom: 12px; }
.est-progress { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; counter-reset: prog; }
.est-progress li { counter-increment: prog; }
.est-progress a { display: flex; flex-direction: column; gap: 6px; min-height: var(--tap); padding-top: 8px; border-top: 3px solid var(--line); font-size: .8rem; font-weight: 650; color: var(--soft); text-decoration: none; transition: border-color .3s var(--ease), color .3s var(--ease); }
.est-progress a:hover { color: var(--ink); }
.est-progress li.is-done a { border-color: var(--ink); color: var(--ink); }
.est-step { scroll-margin-top: calc(var(--header-h) + 16px); }
.est-step__p--small { font-size: var(--small); color: var(--soft); }
.est-step__p b { color: var(--ink); }
.est-mode { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 4px; margin-bottom: 16px; border-radius: calc(var(--radius) + 4px); background: var(--concrete); }
.est-mode button { min-height: var(--tap); border: 0; border-radius: var(--radius); background: transparent; font: inherit; font-weight: 650; font-size: .95rem; color: var(--muted); cursor: pointer; transition: background-color .2s, color .2s, box-shadow .2s; }
.est-mode button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 0 0 1px var(--line); }
.est-mode button:focus-visible { outline: 3px solid var(--tide); outline-offset: 2px; }
.est-manual { box-shadow: none; }
.est-manual__total { display: grid; gap: 6px; margin-top: 14px; font-weight: 650; font-size: .92rem; }
.est-tool--go { background: var(--ink); color: #fff; border-color: var(--ink); }
.est-tool--go:hover { background: var(--tide); border-color: var(--tide); }
.est-spaces label { display: block; font-weight: 650; font-size: .95rem; margin-bottom: 8px; }
.est-spaces .field { max-width: 200px; }
.est-spaces .est-step__p { margin: 8px 0 0; }
.est-range__tag { display: inline-block; margin: 0 0 10px; padding: 4px 10px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font-size: .78rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--paint-deep); }
.est-notes { margin: 16px 0 0; font-size: .95rem; color: var(--muted); }
.est-notes p { margin: 0; max-width: 54ch; }
.est-range__go { margin-top: 20px; }
.est-find button.is-busy span::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 10px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; vertical-align: -1px; animation: est-spin .7s linear infinite; }
@keyframes est-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .est-find button.is-busy span::after { animation-duration: 2s; } }
.est-find__msg b { color: var(--ink); font-weight: 650; }
.tiles-bad .est__veil { opacity: 1 !important; }

@media (max-width: 700px) { .leaflet-control-attribution { font-size: 12px !important; line-height: 1.3; } }

/* phones: the bar sits above the map's credit line, the hint on its own row, the tools full width (e2e 2026-11-11) */
.est-tool { white-space: nowrap; }
@media (max-width: 560px) {
  .est__bar { bottom: 34px; left: 8px; right: 8px; flex-wrap: wrap; gap: 8px; padding: 10px 10px 10px 14px; }
  .est__bar-area { flex: 1 1 100%; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 10px; }
  .est__bar-hint { text-align: right; }
  .est__bar-tools { flex: 1 1 100%; }
  .est-tool { flex: 1 1 0; padding: 0 8px; }
}

.est__map-col { scroll-margin-top: calc(var(--header-h) + env(safe-area-inset-top)); }

/* final pass, 2026-11-11: the summary's label and value never touch on a phone */
.est-break { column-gap: 18px; }
.est-group legend .opt { font-weight: 450; color: var(--soft); font-size: var(--small); }
/* phones and tablets: until an address is found the map is a short band, so "Find the property" is on the first screen
   (the reviewer measured the address field about 930px down a 375px phone, under a dark map); it opens to full height
   the moment an address is found (estimate.js calls invalidateSize). Entering the size never needs the big map. */
@media (max-width: 1023px) {
  .est:not(.is-found) .est__veil p { font-size: 1.05rem; max-width: 26ch; }
}
/* 2026-11-11 night: condition buttons the same height when one label wraps; the phone map band a little taller so
   the imagery credit covers less of it (reviewer) */
.est-seg { align-items: stretch; }
/* phones and tablets before an address is found: a map tall enough to drag and zoom (Hap, 2026-11-12), short enough that
   "Find the property" still starts on the first screen; it grows to full height once an address is found */
@media (max-width: 1023px) { .est:not(.is-found) .est__map-col { height: 40svh; min-height: 250px; } }

/* ---------- 2026-11-16 (Hap's email): Sealcoating & striping parts, the site-review headline, photos ---------- */
.est-parts { margin-top: -6px; }
.est-range.is-review { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
/* photos on the visit request: a drop zone that is also the picker's label, thumbnails with a remove button */
.photos { display: grid; gap: 10px; }
.photos__h { margin: 0; font-weight: 600; font-size: .95rem; }
.photos__input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); }
.form .photos__drop { display: grid; margin: 0; font-weight: 400; grid-template-columns: auto minmax(0, 1fr); gap: 2px 14px; align-items: center; min-height: 76px; padding: 14px 16px; border-radius: var(--radius-frame); border: 1.5px dashed #a9aaa4; background: var(--concrete); cursor: pointer; transition: border-color .2s, background-color .2s; }
.form .photos__drop:hover, .form .photos__drop.is-over { border-color: var(--ink); background: #fff; }
.photos__input:focus-visible + .photos__drop { outline: 3px solid var(--tide); outline-offset: 2px; }
.photos__drop.is-full { opacity: .55; cursor: not-allowed; }
.photos__ico { grid-row: span 2; width: 30px; height: 30px; fill: var(--ink); }
.photos__drop-t { align-self: end; font-weight: 650; font-size: .98rem; }
.photos__drop-s { align-self: start; font-weight: 400; font-size: var(--small); color: var(--soft); line-height: 1.4; }
.photos__list { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.photos__list[hidden] { display: none; }
.photos__item { position: relative; width: 72px; height: 72px; }
.photos__item img { display: block; width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--hair); }
.photos__rm { position: absolute; top: -10px; right: -10px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.photos__rm svg { width: 24px; height: 24px; padding: 4px; border-radius: 50%; background: var(--ink); fill: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .35); }
.photos__rm:focus-visible svg { outline: 3px solid var(--tide); outline-offset: 1px; }
.photos__msg { margin: 0; font-size: var(--small); color: var(--soft); }
.photos__msg:empty { display: none; }
/* a two-part rate (Sealcoating & striping) sits under the name, not beside it, so the name keeps one line */
.est-opt__rate.is-wide { grid-column: 1 / -1; white-space: normal; }
/* visual review 2026-11-17: the three condition buttons share one height when "Potholes or soft spots" wraps */
.est-seg label { display: flex; }
.est-seg label > span { flex: 1; }
/* phones: the rate on its own line under the work's name, so names like "Demolition and replacement" keep one line */
@media (max-width: 600px) { .est-opt__rate { grid-column: 1 / -1; white-space: normal; align-self: start; } }
/* "Summary" (the no-prices label for step 4) needs 51px; at 320 a column is 52px with the 6px gap (gate W17, 2026-11-19) */
@media (max-width: 359px) { .est-progress { gap: 4px; } .est-progress a { font-size: 12px; } }
