/* #883 Nest PR 4: the roof survey's Site plan tab and the address finder (redesign screens 18 to 27 and 68), and the survey
   tab bar (four tabs on a roof survey: Site plan, Property, Elements, Report; three on a building survey). Only under the
   switch: every rule starts with html[data-phone-nest][data-app-design="flow"], which assets/app-design.js sets only when
   /me names phone_ui_flow and phone_ui_nest. With the switch off nothing here matches.
   Values are reference/sn.css's (tokens --nest-* from assets/phone-nest.css). The elements are the app's own; the few
   arrangement hooks (.ph-nest-*, data-nest-primary) come from assets/phone-nest-site.js. No url(), no web fonts. */

/* ---------- the survey tab bar (all survey screens): slim, equal width, current tab underlined in teal ---------- */
/* The side edge of Flow's content column (.ph-main: 760 px wide, 18 px padding): 18 px on a phone, centred on a desktop. */
html[data-phone-nest][data-app-design="flow"] { --ph-nest-edge-l: max(18px, env(safe-area-inset-left), calc((100vw - 760px) / 2 + 18px)); --ph-nest-edge-r: max(18px, env(safe-area-inset-right), calc((100vw - 760px) / 2 + 18px)); }
html[data-phone-nest][data-app-design="flow"] body .ph-sticky #tabs {
  display: flex; flex-wrap: nowrap; gap: 0; margin: 0 var(--ph-nest-edge-r) 0 var(--ph-nest-edge-l);
  padding: 0; background: var(--nest-mist); border: 0; border-bottom: 1px solid var(--nest-line); border-radius: 0; box-shadow: none;
}
html[data-phone-nest][data-app-design="flow"] body .ph-sticky #tabs button {
  position: relative; flex: 1 1 0; min-width: 0; height: 42px; min-height: 42px; margin: 0 0 -1px; padding: 0;
  border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; box-shadow: none;
  font: 600 15px/1 var(--nest-text); letter-spacing: 0; color: var(--nest-muted); white-space: nowrap; overflow-wrap: normal; opacity: 1;
}
html[data-phone-nest][data-app-design="flow"] body .ph-sticky #tabs:has(> #premium-site-tab:not([hidden])) button { font-size: 14px; }
html[data-phone-nest][data-app-design="flow"] body .ph-sticky #tabs button[hidden] { display: none; }
html[data-phone-nest][data-app-design="flow"] body .ph-sticky #tabs button[aria-current="true"] { color: var(--nest-teal); border-bottom-color: var(--nest-teal); background: none; }
html[data-phone-nest][data-app-design="flow"] body .ph-sticky #tabs button:focus-visible { outline: 2px solid var(--nest-teal); outline-offset: -2px; }
/* 44 pt hit area (HANDOVER rule 11) on the 42 px drawn tab */
html[data-phone-nest][data-app-design="flow"] body .ph-sticky #tabs button::after { content: ""; position: absolute; left: 0; right: 0; top: -1px; bottom: -1px; }
html[data-phone-nest][data-app-design="flow"] body .ph-sticky:has(#tabs:not([hidden])) { background: var(--nest-mist); }
/* the Site plan tab replaces the old "Open site plan" button on Property (HANDOVER rule 5) */
html[data-phone-nest][data-app-design="flow"] body #site-open { display: none; }

/* ---------- Site plan screen: top bar, instruction line, content ---------- */
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] { --ph-nest-safe: max(34px, env(safe-area-inset-bottom)); --ph-nest-side: var(--ph-nest-edge-l); }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"][data-nest-os="android"] { --ph-nest-safe: max(16px, env(safe-area-inset-bottom)); }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body { background: var(--nest-mist); color: var(--nest-ink); }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body .ph-sticky { background: var(--nest-mist); }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body .ph-top:has(#back) {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; grid-template-rows: 1fr auto auto 1fr; align-items: center; gap: 0;
  min-height: 44px; padding: env(safe-area-inset-top) 6px 0; background: var(--nest-mist); color: var(--nest-ink); border: 0; box-shadow: none;
}
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body .ph-top:has(#back) #back {
  grid-column: 1; grid-row: 1 / -1; width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0; border: 0; background: none;
  color: var(--nest-teal); font: 400 34px/1 var(--nest-text); display: flex; align-items: center; justify-content: center;
}
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body .ph-top:has(#back) .ph-title { grid-column: 2; grid-row: 2; min-width: 0; display: block; text-align: center; }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body .ph-top:has(#back) #title {
  display: block; margin: 0; font: 700 17px/1.2 var(--nest-disp); font-stretch: 110%; letter-spacing: -.01em; color: var(--nest-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body .ph-top:has(#back) #status {
  grid-column: 2; grid-row: 3; margin: 3px 0 0; font: 500 11px/1 var(--nest-mono); letter-spacing: 0; text-transform: none; color: var(--nest-muted); text-align: center;
}
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body .ph-top:has(#back) #status:empty { display: none; }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"][data-nest-os="android"] body .ph-top:has(#back) { min-height: 64px; grid-template-columns: 48px minmax(0, 1fr) 8px; padding: env(safe-area-inset-top) 8px 0 4px; }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"][data-nest-os="android"] body .ph-top:has(#back) .ph-title { text-align: left; padding-left: 4px; }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"][data-nest-os="android"] body .ph-top:has(#back) #title { font-size: 22px; }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"][data-nest-os="android"] body .ph-top:has(#back) #status { text-align: left; padding-left: 4px; }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #nest-site-instruction {
  margin: 0; padding: 6px var(--ph-nest-edge-r) 10px var(--ph-nest-edge-l);
  font: 400 14px/20px var(--nest-text); color: var(--nest-soft); background: var(--nest-mist);
}
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body .ph-main { padding-top: 0; }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-first {
  display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 12px 0 calc(var(--ph-nest-safe) + 76px); background: none; border: 0; box-shadow: none;
  font: 400 16px/1.4 var(--nest-text); color: var(--nest-ink);
}
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-first.ph-nest-has-aux { padding-bottom: calc(var(--ph-nest-safe) + 116px); }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-first > *,
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-first-plan > * { animation: none; margin-block: 0; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) :is(#site-first-plan, [id$="-roofs"]) { display: flex; flex-direction: column; gap: 14px; margin: 0; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) [id$="-roofs"][hidden],
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-plan-photos[hidden] { display: none; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-hide { display: none; }
/* "Survey › Site plan" (phone_element_overlay's breadcrumb): the title, Back and the tabs already say where you are, as on the
   part sheet (#891). Owner fix, 9 Nov. */
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-first > .ph-capture-breadcrumb { display: none; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-vh {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) :is(p, h2, h3, ul, label) { margin: 0; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-small { font: 400 13px/18px var(--nest-text); color: var(--nest-muted); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-eyebrow { margin: 0 0 -6px; font: 600 12px/1 var(--nest-text); letter-spacing: .06em; text-transform: uppercase; color: var(--nest-muted); }

/* every button on this screen: small text buttons by default (rule 2), pills, 44 pt hit areas. :where() keeps this rule
   weaker than every more specific rule below (chips, zoom, the pinned button). */
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) button:where(:not(.site-address-option, .ph-nest-disc, .flow-map-pin, .flow-photo-row, .maplibregl-ctrl-attrib-button)) {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: auto; height: 32px; min-height: 32px; margin: 0; padding: 0 8px;
  border: 0; border-radius: 999px; background: none; box-shadow: none; color: var(--nest-teal); font: 600 14px/1 var(--nest-text); letter-spacing: 0;
  white-space: nowrap; text-align: center; opacity: 1;
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) button:where(:not(.site-address-option, .ph-nest-disc, .flow-map-pin, .flow-photo-row, .maplibregl-ctrl-attrib-button))::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%);
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) button:disabled { color: #8FB0AB; cursor: default; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) button[hidden] { display: none; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) button:focus-visible { outline: 2px solid var(--nest-teal); outline-offset: 2px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) button .ph-nest-icon { width: 18px; height: 18px; flex: none; }
/* a whole-width filled pill inside the page (the static picture's Use this as the site plan / Make the picture here) */
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) #site-map-controls button.ph-primary:not(.ph-nest-confirm) {
  width: 100%; height: 52px; min-height: 52px; padding: 0 18px; background: var(--nest-teal); color: #fff; font-size: 17px;
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) #site-map-controls button.ph-primary:not(.ph-nest-confirm):disabled { background: #8FB0AB; color: #fff; }
/* small pale pill: Show saved position (rule 2) */
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) button.ph-nest-pill { height: 36px; min-height: 36px; padding: 0 14px; background: var(--nest-notice); color: var(--nest-teal); }

/* ---------- Roof layout / Photos on plans: two chips under the tabs ---------- */
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-plan-tabs { display: flex; gap: 8px; margin: 0; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-plan-tabs button {
  flex: none; height: 34px; min-height: 34px; padding: 0 14px; border: 1px solid var(--nest-line); background: var(--nest-field); color: var(--nest-ink); font-size: 14px;
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-plan-tabs button[aria-pressed="true"] { background: var(--nest-teal); border-color: var(--nest-teal); color: #fff; }

/* ---------- the plan: a card, zoom buttons and the hint on the picture ---------- */
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-plan {
  position: relative; background: var(--nest-card); border: 1px solid var(--nest-line); border-radius: 2px; overflow: hidden;
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-plan .site-picture-viewport { margin: 0; max-height: 55vh; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-plan .roof-plan { margin: 0; border: 0; border-radius: 0; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-zoom { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; margin: 0; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-zoom button {
  width: 36px; height: 36px; min-height: 36px; padding: 0; background: var(--nest-field); border: 1px solid var(--nest-line); color: var(--nest-teal);
  box-shadow: 0 2px 6px rgba(15, 46, 45, .12);
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-hint {
  position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 64px); padding: 4px 8px; background: rgba(248, 249, 246, .95);
  border: 1px solid var(--nest-line); border-radius: 2px; font: 400 12px/1.35 var(--nest-text); color: var(--nest-soft); pointer-events: none;
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-plan .roof-pin { border-radius: 2px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-about { font: 400 13px/18px var(--nest-text); color: var(--nest-muted); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) [data-site-plan-choose] { align-self: flex-start; font-size: 15px; height: 36px; min-height: 36px; }
/* no picture yet: an empty plan card (18), a compact row while the finder is open (22) */
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 200px; padding: 16px; text-align: center; color: var(--nest-muted);
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-empty .ph-nest-lead .ph-nest-icon { width: 36px; height: 36px; color: #AEB7B2; display: block; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-empty .ph-nest-main { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-empty .site-picture-empty {
  display: block; min-height: 0; margin: 0; padding: 0; background: none; border: 0; font: 700 13px/18px var(--nest-text); color: var(--nest-ink);
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-empty [data-site-plan-choose] { align-self: center; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-finder="open"] .ph-nest-empty {
  flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; min-height: 56px; padding: 10px 14px; text-align: left;
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-finder="open"] .ph-nest-empty .ph-nest-lead .ph-nest-icon { width: 24px; height: 24px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-finder="open"] .ph-nest-empty .ph-nest-main { align-items: flex-start; gap: 0; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-finder="open"] .ph-nest-empty .site-picture-empty { font: 600 16px/1.3 var(--nest-text); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-finder="open"] .ph-nest-empty .ph-nest-about { display: none; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-finder="open"] .ph-nest-empty [data-site-plan-choose] { align-self: flex-start; margin-left: -8px; }

/* ---------- roofs: one compact row each (19) ---------- */
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) ul.sp-roofs {
  display: block; margin: 0; padding: 0; list-style: none; background: var(--nest-card); border: 1px solid var(--nest-line); border-radius: 2px;
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) ul.sp-roofs > li { display: flex; align-items: center; flex-wrap: nowrap; gap: 12px; min-height: 56px; padding: 10px 14px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) ul.sp-roofs > li + li { border-top: 1px solid var(--nest-line); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) ul.sp-roofs .ph-nest-main { flex: 1; min-width: 0; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) ul.sp-roofs .ph-nest-main b { display: block; font: 600 16px/1.3 var(--nest-text); color: var(--nest-ink); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) ul.sp-roofs .ph-nest-main small { display: block; margin-top: 2px; font: 400 13px/18px var(--nest-text); color: var(--nest-muted); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) ul.sp-roofs .ph-nest-trail { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; max-width: 62%; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) ul.sp-roofs .ph-nest-trail button { font-size: 15px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) ul.sp-roofs .ph-nest-trail button[aria-pressed="true"] { background: var(--nest-notice); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: -6px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-tools > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-tools [role="status"] { font: 400 13px/18px var(--nest-text); color: var(--nest-muted); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) [id$="-roofs"] > :is(label, input[type="text"]) { font: 600 13px/1.2 var(--nest-text); color: var(--nest-soft); }

/* ---------- the folded "Find the site by address" row (one card with the finder in it) ---------- */
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-disc {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; height: auto; margin: 0; padding: 10px 14px; text-align: left;
  background: var(--nest-card); border: 1px solid var(--nest-line); border-radius: 2px; color: var(--nest-ink); font: inherit; box-shadow: none; cursor: pointer;
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-disc:focus-visible { outline: 2px solid var(--nest-teal); outline-offset: -2px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-disc .ph-nest-main { flex: 1; min-width: 0; display: block; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-disc .ph-nest-t { display: block; font: 600 16px/1.3 var(--nest-text); color: var(--nest-ink); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-disc .ph-nest-d { display: block; margin-top: 2px; font: 400 13px/18px var(--nest-text); color: var(--nest-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-disc .ph-nest-chev { flex: none; color: var(--nest-muted); display: flex; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-disc .ph-nest-chev .ph-nest-icon { width: 20px; height: 20px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-disc[aria-expanded="true"] { border-bottom-color: transparent; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-disc[aria-expanded="true"] .ph-nest-chev { transform: rotate(180deg); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-disc[aria-expanded="true"] .ph-nest-d { display: none; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-disc[aria-expanded="false"] + :is(#site-map-controls, #nest-building-finder) { display: none; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-disc + :is(#site-map-controls, #nest-building-finder) {
  display: flex; flex-direction: column; gap: 12px; margin: -14px 0 0; padding: 12px 14px 14px;
  background: var(--nest-card); border: 1px solid var(--nest-line); border-top: 0; border-radius: 0 0 2px 2px; box-shadow: inset 0 1px 0 var(--nest-line);
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) > div:not([hidden]) { margin: 0; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) > div[data-live-roofs]:empty { display: none; }
/* the field: label, a white box with the search icon inside, helper text under it */
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .site-address-label { display: flex; flex-direction: column; gap: 6px; font: 600 13px/1.2 var(--nest-text); color: var(--nest-soft); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .ph-nest-field {
  position: relative; display: flex; align-items: center; gap: 4px; min-height: 48px; padding: 0 4px 0 12px;
  background: var(--nest-field); border: 1px solid var(--nest-line); border-radius: 2px;
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .ph-nest-field:focus-within { border-color: var(--nest-teal); box-shadow: 0 0 0 1px var(--nest-teal); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .ph-nest-field input {
  flex: 1; min-width: 0; width: auto; height: 46px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; outline: 0; background: none; box-shadow: none;
  font: 400 16px/1.35 var(--nest-text); color: var(--nest-ink);
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .ph-nest-field input::placeholder { color: var(--nest-muted); opacity: 1; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .ph-nest-field button { width: 40px; height: 40px; min-height: 40px; padding: 0; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .ph-nest-field button .ph-nest-icon { width: 20px; height: 20px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .site-address-note { margin-top: 6px; font: 400 12px/16px var(--nest-text); color: var(--nest-muted); }
/* matching addresses drop down right under the field (23) */
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .site-address-list {
  margin: -6px 0 0; padding: 0; background: var(--nest-field); border: 1px solid var(--nest-line); border-radius: 2px; box-shadow: 0 6px 16px rgba(15, 46, 45, .12);
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .site-address-option {
  min-height: 48px; padding: 12px 14px; border: 0; border-radius: 0; background: none; font: 400 15px/1.35 var(--nest-text); color: var(--nest-ink);
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .site-map-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 0 -8px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .site-map-actions:not(:has(> button:not([hidden]):not(.ph-nest-confirm))) { display: none; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .site-map-actions button { font-size: 14px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .site-map-actions button.ph-nest-pill { margin-left: 8px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) > p { font: 400 13px/18px var(--nest-text); color: var(--nest-muted); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) > p:last-child { font: 400 12px/16px var(--nest-text); }
/* "Position confirmed": a notice with a tick (25) */
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) > p.ph-nest-notice {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; background: var(--nest-notice); border-radius: 2px; font: 400 14px/20px var(--nest-text); color: var(--nest-soft);
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) > p.ph-nest-notice .ph-nest-icon { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--nest-teal); stroke-width: 2.4; }
/* the map in the finder: cross, MapLibre's own credit and attribution toggle, the failure in place (24, 27) */
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .site-map-frame { position: relative; border: 1px solid var(--nest-line); border-radius: 2px; overflow: hidden; background: #D9E0D8; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .site-map-frame:has(> .site-map[hidden]) { display: none; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .site-map { height: 220px; margin: 0; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .site-map-centre { font: 400 30px/1 var(--nest-text); color: #fff; text-shadow: 0 0 2px rgba(0, 0, 0, .6); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .ph-nest-mapfail {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px;
  background: #D9E0D8; color: var(--nest-muted); text-align: center;
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .ph-nest-mapfail .ph-nest-icon { width: 32px; height: 32px; color: #AEB7B2; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .ph-nest-mapfail p { margin: 0; font: 400 13px/18px var(--nest-text); color: var(--nest-muted); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .site-snapshot-choices:not([hidden]) { display: flex; flex-wrap: wrap; gap: 6px; margin-left: -8px; }
/* the static picture's move arrows: four round 44 pt icon buttons in a row, pale pill with a teal arrow (sn.css icon button
   on the secondary pill's colours). Owner fix, 9 Nov: they were bare arrow characters. */
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-map-controls .site-snapshot-arrows:not([hidden]) { display: flex; flex-wrap: nowrap; gap: 8px; margin: 10px 0 0; }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-map-controls .site-snapshot-arrows > button.ph-nest-arrow {
  flex: none; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 999px; background: var(--nest-notice); color: var(--nest-teal);
}
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-map-controls .site-snapshot-arrows > button.ph-nest-arrow .ph-nest-icon { width: 20px; height: 20px; stroke-width: 2.2; }
/* the picture's credit, once (owner fix, 9 Nov: it was printed twice, tiny on the picture and again as a big paragraph).
   Esri prints its credit in a dark strip along the bottom of the 800 x 600 picture, about 19 px high and unreadable at phone
   size. The preview leaves off the bottom 22 px (800 / 578, from the top) and the same words follow straight under it as one
   small caption strip, as the live map's credit bar (sn.css .mapbox .attr: 10/14 px, Ink soft, Card). The saved picture is
   unchanged. With the live placing map open (Make the picture here), the same caption holds the provider's full credit straight
   under the map and MapLibre's own bar is hidden on that map: MapLibre folds its bar to a small "i" once the map is dragged,
   which would leave no credit words on show, and Esri's licence needs them visible (opus-crit-924). */
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-map-controls img.site-snapshot-image {
  display: block; box-sizing: border-box; width: 100%; height: auto; aspect-ratio: 800 / 578; object-fit: cover; object-position: top; margin: 0; border-radius: 2px 2px 0 0;
}
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-map-controls img.site-snapshot-image[hidden] { display: none; }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-map-controls img.site-snapshot-image:not([hidden]) + p {
  margin: 0; padding: 4px 8px; background: var(--nest-card); border: 1px solid var(--nest-line); border-top: 0; border-radius: 0 0 2px 2px;
  font: 400 10px/14px var(--nest-text); color: var(--nest-soft);
}
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-map-controls img.site-snapshot-image[hidden] + p { display: none; }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-map-controls div:has(> .site-map-frame:not([hidden])) > img.site-snapshot-image[hidden] + p:not(:empty) {
  display: block; margin: 0; padding: 4px 8px; background: var(--nest-card); border: 1px solid var(--nest-line); border-top: 0; border-radius: 0 0 2px 2px;
  font: 400 10px/14px var(--nest-text); color: var(--nest-soft);
}
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-map-controls div:has(> img.site-snapshot-image) > .site-map-frame:not([hidden]) { border-radius: 2px 2px 0 0; }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-map-controls div:has(> img.site-snapshot-image) > .site-map-frame .maplibregl-ctrl-attrib { display: none; }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-map-controls .site-snapshot-arrows > button.ph-nest-arrow:disabled { background: var(--nest-notice); color: #8FB0AB; }

/* ---------- the photos on plans view (20, 21) ---------- */
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-plan-photos { display: flex; flex-direction: column; gap: 14px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-plan-photos > h2 { display: none; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-photo-map-frame { padding: 0; border: 1px solid var(--nest-line); border-radius: 2px; background: var(--nest-card); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-map-pin { width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; background: none; box-shadow: none; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-map-pin span {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: var(--nest-teal); color: #fff; font: 700 13px/1 var(--nest-text);
  box-shadow: 0 1px 4px rgba(15, 46, 45, .3); outline: 0;
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-map-pin[aria-pressed="true"] span { width: 32px; height: 32px; background: var(--nest-signal); color: var(--nest-deep); border-color: var(--nest-deep); outline: 0; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-photo-list {
  display: block; gap: 0; background: var(--nest-card); border: 1px solid var(--nest-line); border-radius: 2px;
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-photo-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; width: 100%; min-height: 56px; margin: 0; padding: 10px 14px; text-align: left;
  border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--nest-ink); font: inherit;
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-photo-row + .flow-photo-row { border-top: 1px solid var(--nest-line); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-photo-row b { grid-column: 1; font: 600 16px/1.3 var(--nest-text); color: var(--nest-ink); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-photo-row > span { grid-column: 1; font: 400 13px/18px var(--nest-text); color: var(--nest-muted); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-photo-row small {
  grid-column: 2; grid-row: 1 / span 2; align-self: center; display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 2px;
  background: var(--nest-notice); color: var(--nest-teal); font: 600 12px/1 var(--nest-text); white-space: nowrap;
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-photo-row[aria-pressed="true"] { background: var(--nest-notice); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-photo-row[aria-pressed="true"] small { background: var(--nest-field); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-photo-inspector {
  display: flex; flex-direction: column; gap: 10px; padding: 4px 14px 14px; background: var(--nest-notice); border: 0; border-radius: 0;
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-photo-inspector + .flow-photo-row { border-top: 1px solid var(--nest-line); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-photo-inspector > h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-photo-inspector h3 { font: 600 16px/1.3 var(--nest-text); color: var(--nest-ink); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-photo-inspector > img { max-height: 220px; border-radius: 2px; background: var(--nest-mist); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-photo-inspector > p { font: 400 13px/18px var(--nest-text); color: var(--nest-muted); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) :is(.flow-photo-inspector, .flow-plan-photos) label { display: flex; flex-direction: column; gap: 6px; font: 600 13px/1.2 var(--nest-text); color: var(--nest-soft); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) :is(textarea, select) {
  min-height: 48px; padding: 10px 12px; border: 1px solid var(--nest-line); border-radius: 2px; background: var(--nest-field); font: 400 16px/1.35 var(--nest-text); color: var(--nest-ink);
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-photo-pin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .flow-photo-pin-actions [role="status"] { font: 400 13px/18px var(--nest-text); color: var(--nest-muted); }

/* ---------- one pinned main action at the bottom, a small text button above it (rule 1) ---------- */
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #nest-site-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--ph-nest-safe) + 62px);
  background: var(--nest-mist); border-top: 1px solid var(--nest-line); pointer-events: none;
}
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #nest-site-bar.ph-nest-bar-aux { height: calc(var(--ph-nest-safe) + 102px); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-primary="upload"] [data-site-plan-choose],
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-primary="confirm"] .ph-nest-confirm,
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-primary="next"] #site-next {
  position: fixed; z-index: 21; left: var(--ph-nest-side); right: var(--ph-nest-edge-r); bottom: var(--ph-nest-safe); display: flex;
  align-self: auto; width: auto; height: 52px; min-height: 52px; margin: 0; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--nest-teal); color: #fff; font: 600 17px/1 var(--nest-text); white-space: nowrap;
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-primary="upload"] [data-site-plan-choose] .ph-nest-icon,
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-primary="confirm"] .ph-nest-confirm .ph-nest-icon,
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-primary="next"] #site-next .ph-nest-icon { width: 20px; height: 20px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-primary="confirm"] .ph-nest-confirm:disabled { background: #8FB0AB; color: #fff; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-primary="upload"] #site-next,
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-primary="confirm"] #site-next,
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-primary="next"][data-nest-confirmed="yes"] .ph-nest-confirm {
  position: fixed; z-index: 21; right: var(--ph-nest-edge-r); bottom: calc(var(--ph-nest-safe) + 60px); display: inline-flex;
  width: auto; height: 32px; min-height: 32px; margin: 0; padding: 0 8px; border: 0; background: none; color: var(--nest-teal); font: 600 14px/1 var(--nest-text);
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-primary="upload"] #site-next::before,
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-primary="confirm"] #site-next::before { content: " ›" / ""; order: 2; }
/* the static picture finder (phone_site_snapshot): its own filled button, Make the picture here or Use this as the site
   plan, is the pinned main action while it shows; Next: property details drops to the small text button above it (rule 1).
   Owner fix, 9 Nov: Use this as the site plan sat behind the pinned Next bar. Two ids, to outweigh the in-page pill above. */
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-first[data-nest-primary="snap"] #site-map-controls button.ph-nest-snapmain {
  position: fixed; z-index: 21; left: var(--ph-nest-side); right: var(--ph-nest-edge-r); bottom: var(--ph-nest-safe); display: flex;
  align-self: auto; width: auto; height: 52px; min-height: 52px; margin: 0; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--nest-teal); color: #fff; font: 600 17px/1 var(--nest-text); white-space: nowrap;
}
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-first[data-nest-primary="snap"] #site-map-controls button.ph-nest-snapmain:disabled { background: #8FB0AB; color: #fff; }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-first[data-nest-primary="snap"] #site-next {
  position: fixed; z-index: 21; right: var(--ph-nest-edge-r); bottom: calc(var(--ph-nest-safe) + 60px); display: inline-flex;
  width: auto; height: 32px; min-height: 32px; margin: 0; padding: 0 8px; border: 0; background: none; color: var(--nest-teal); font: 600 14px/1 var(--nest-text);
}
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"] body #site-first[data-nest-primary="snap"] #site-next::before { content: " ›" / ""; order: 2; }
/* the Confirm position button lives in the finder: off the screen while the row is folded */
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan)[data-nest-finder="closed"] .ph-nest-confirm { display: none; }

/* phone_compact_layout (on at the test server) gives every button a 48 px minimum with !important. Under Nest the drawn
   sizes stand (34 px chips, 36 px zoom, 32 px text buttons, 42 px tabs), each with a 44 pt hit area (::after above). */
html.phone-compact-layout[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) button,
html.phone-compact-layout[data-phone-nest][data-app-design="flow"] body .ph-sticky #tabs button { min-width: 0 !important; min-height: 0 !important; }
html.phone-compact-layout[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) button.ph-nest-disc { min-height: 52px !important; }

/* phone.css gives every button var(--sn-button-radius) through a selector that names an id (#new-survey-close), so it
   outweighs the rules above: buttons here are pills (rule 6), and the three kinds of row button keep their own corners. */
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) { --sn-button-radius: 999px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan):is(#site-first, #site-plan) .ph-nest-disc { border-radius: 2px; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan):is(#site-first, #site-plan) .ph-nest-disc[aria-expanded="true"] { border-radius: 2px 2px 0 0; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan):is(#site-first, #site-plan) :is(.flow-photo-row, .site-address-option) { border-radius: 0; }

/* MapLibre's own credit and attribution toggle, as a slim bar along the bottom of the map (24) */
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .maplibregl-ctrl-bottom-right { left: 0; right: 0; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .maplibregl-ctrl-attrib {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 4px 8px; min-height: 0;
  border-radius: 0; background: rgba(248, 249, 246, .92); font: 400 10px/14px var(--nest-text); color: var(--nest-soft);
}
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .maplibregl-ctrl-attrib a { color: var(--nest-soft); }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-map-controls, #nest-building-finder) .maplibregl-ctrl-attrib-button {
  position: static; order: 2; flex: none; width: 22px !important; min-width: 0 !important; height: 22px !important; min-height: 0 !important;
  margin: 0; padding: 0; border: 0; border-radius: 50%; background-color: transparent; background-repeat: no-repeat; background-position: center; background-size: 18px;
}

/* Android: an arrow back instead of the iPhone chevron (HANDOVER rule 12); the button's own "Back" label is unchanged */
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"][data-nest-os="android"] body .ph-top:has(#back) #back { font-size: 0; }
html[data-phone-nest][data-app-design="flow"][data-phone-screen="site-first"][data-nest-os="android"] body .ph-top:has(#back) #back::before { content: "←" / ""; font: 400 24px/1 var(--nest-text); }

/* ---------- Review photos (the part's photo review sheet, opened from Review photos): owner fix, 9 Nov ----------
   It is drawn over the whole screen from any part (roof or building) and removed when it closes; these rules match only
   while it is open and Nest is on. Tags, Close, Previous photo and Next photo are pills (rule 6, 999 px; they were Flow's
   12 px boxes), pale secondary pills (Notice, Teal words) with the chosen tag and Next filled Teal; every button 44 pt.
   The note box is a Nest field with the microphone inside it on the right, in the middle of the box's height (it sat on
   the box's bottom edge). phone_compact_layout's 48 px !important minimum is replaced by the drawn sizes. The sheet's
   contrast helper (app-design.js photoContrast) writes an inline black or white on every button for photos behind them;
   here the colours are Nest's, so they are !important (Teal on Notice and white on Teal both pass AA). */
/* phone.css gives every button var(--sn-button-radius) through a selector that names an id (#new-survey-close), which outweighs
   the rules here: the sheet sets that variable to a pill, as the Site plan does */
html[data-phone-nest][data-app-design="flow"] body > .ph-photo-review { --sn-button-radius: 999px; background: var(--nest-mist); color: var(--nest-ink); font: 400 16px/1.4 var(--nest-text); }
html[data-phone-nest][data-app-design="flow"] body > .ph-photo-review .ph-photo-review-actions { background: var(--nest-mist); }
html[data-phone-nest][data-app-design="flow"] body > .ph-photo-review button:not(.ph-mic) {
  position: relative; min-width: 44px !important; min-height: 44px !important; height: 44px; margin: 0; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--nest-notice); color: var(--nest-teal) !important; box-shadow: none; font: 600 15px/1 var(--nest-text); letter-spacing: 0; white-space: nowrap;
}
html[data-phone-nest][data-app-design="flow"] body > .ph-photo-review .ph-premium-review-tags { gap: 8px; }
html[data-phone-nest][data-app-design="flow"] body > .ph-photo-review .ph-premium-review-tags button[aria-pressed="true"] { background: var(--nest-teal); color: #fff !important; }
html[data-phone-nest][data-app-design="flow"] body > .ph-photo-review .ph-photo-review-actions button { height: 52px; font-size: 17px; }
html[data-phone-nest][data-app-design="flow"] body > .ph-photo-review .ph-photo-review-actions button.ph-primary { background: var(--nest-teal); color: #fff !important; }
html[data-phone-nest][data-app-design="flow"] body > .ph-photo-review button:not(.ph-mic):disabled { background: var(--nest-notice); color: #8FB0AB !important; opacity: 1; cursor: default; }
html[data-phone-nest][data-app-design="flow"] body > .ph-photo-review button:focus-visible { outline: 2px solid var(--nest-teal); outline-offset: 2px; }
html[data-phone-nest][data-app-design="flow"] body > .ph-photo-review .ph-flow-voice-field { position: relative; display: block; min-width: 0; width: 100%; }
html[data-phone-nest][data-app-design="flow"] body > .ph-photo-review .ph-flow-voice-field > :is(textarea, input) {
  display: block; box-sizing: border-box; width: 100%; min-height: 64px; margin: 0; padding: 12px 56px 12px 12px;
  border: 1px solid var(--nest-line); border-radius: 2px; background: var(--nest-field); color: var(--nest-ink); font: 400 16px/1.35 var(--nest-text);
}
html[data-phone-nest][data-app-design="flow"] body > .ph-photo-review .ph-flow-voice-field > :is(textarea, input):focus { outline: 0; border-color: var(--nest-teal); box-shadow: 0 0 0 1px var(--nest-teal); }
html[data-phone-nest][data-app-design="flow"] body > .ph-photo-review .ph-flow-voice-field > .ph-mic {
  position: absolute; top: 50%; right: 8px; bottom: auto; z-index: 2; transform: translateY(-50%); display: grid; place-items: center;
  width: 36px; height: 36px; min-width: 36px !important; min-height: 36px !important; margin: 0; padding: 0; border: 0; border-radius: 999px;
  background: var(--nest-notice); color: var(--nest-teal); box-shadow: none;
}
html[data-phone-nest][data-app-design="flow"] body > .ph-photo-review .ph-flow-voice-field > .ph-mic::after { content: ""; position: absolute; inset: -4px; }
html[data-phone-nest][data-app-design="flow"] body > .ph-photo-review .ph-flow-voice-field > .ph-mic svg { width: 18px; height: 18px; }
html[data-phone-nest][data-app-design="flow"] body > .ph-photo-review .ph-flow-voice-field > .ph-mic:is(.listening, [aria-pressed="true"]) { background: var(--nest-teal); color: #fff; }

/* #905: Fit joins the round zoom buttons (an icon, assets/phone-nest-site.js) and the zoom level sits under them. The zoom
   row's flex sizing (assets/phone.css) is for the unstyled row only. Written for the roof survey's Site plan and, once the
   whole-building survey's Nest screen (#901) arranges its plan the same way, for #site-plan too. */
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-zoom button { flex: none; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-zoom button:disabled { opacity: .45; }
html[data-phone-nest][data-app-design="flow"]:is([data-phone-screen="site-first"], [data-nest-site-plan]) body :is(#site-first, #site-plan) .ph-nest-zoom .site-plan-zoom-level {
  min-width: 36px; padding: 2px 0; background: rgba(248, 249, 246, .95); border: 1px solid var(--nest-line); border-radius: 2px; font: 600 12px/1.35 var(--nest-text); color: var(--nest-ink); text-align: center;
}
