/* #913 Journey lane 3 (P2), part of #910: the roof module's Site plan page (assets/phone-journey-site.js). Every rule starts
   with html[data-pj="on"] (set by lane 1's assets/phone-journey.js only while phone_journey, phone_ui_nest and phone_ui_flow are
   on) and reaches only #pj-site (inside lane 1's #journey screen), which exists only while the page shows, so with the switch off nothing here applies.
   Look: records/JOURNEY-PLAN-2026-11-09/prototype/index.html (.card, .banner, .plan, .zoom, .dropbtn, .btn, .choice, .pin-bar);
   tokens --nest-* (assets/phone-nest.css). Nest rules: pills 999 px, every other edge 2 px, Archivo / Plex, 44 pt targets.
   Priority colours: lane 1's PhoneJourney.PRIORITY_COLOURS (the catalogue's roof_details, #916; Tim's P3 #2E6DB4, not rated #6E7A78). */

html[data-pj="on"] body #journey #pj-site { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0 0 8px; font: 400 16px/1.45 var(--nest-text); color: var(--nest-ink); }
html[data-pj="on"] body #journey #pj-site [hidden],
html[data-pj="on"] body #journey #pj-site .pj-site-hide { display: none !important; }
html[data-pj="on"] body #journey #pj-site :is(p, h2, h3, ul, label) { margin: 0; }
html[data-pj="on"] body #journey #pj-site .pj-vh,
html[data-pj="on"] body #journey #pj-site .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; }

/* ---------- the instruction line, and the dark banner while framing or placing a label ---------- */
html[data-pj="on"] body #journey #pj-site .pj-site-instr { margin: 0; color: var(--nest-soft); font: 400 16px/1.45 var(--nest-text); }
html[data-pj="on"] body #journey #pj-site .pj-site-instr.pj-site-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 10px 14px;
  background: var(--nest-deep); color: #FFFFFF; border-radius: 2px;
}
html[data-pj="on"] body #journey #pj-site .pj-site-instr b { font-weight: 700; }
html[data-pj="on"] body #journey #pj-site .pj-site-banner .pj-site-cancel { color: #2DD4BF; }   /* the prototype's bright Cancel; beats .pj-site-text */

/* ---------- buttons: pills (main, plain, pale, danger, small), dashed drop buttons, text buttons ---------- */
html[data-pj="on"] body #journey #pj-site .pj-site-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
html[data-pj="on"] body #journey #pj-site :is(.pj-site-btn, .pj-site-drop, .pj-site-text, .pj-site-choice) { -webkit-tap-highlight-color: transparent; cursor: pointer; font-family: var(--nest-text); }
html[data-pj="on"] body #journey #pj-site .pj-site-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; width: auto; margin: 0; padding: 0 18px;
  border: 1px solid var(--nest-line); border-radius: 999px; background: var(--nest-card); color: var(--nest-teal);
  font: 600 16px/1.2 var(--nest-text); box-shadow: none; text-decoration: none;
}
html[data-pj="on"] body #journey #pj-site .pj-site-btn.pj-site-sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
html[data-pj="on"] body #journey #pj-site .pj-site-btn.pj-site-main { background: var(--nest-teal); border-color: var(--nest-teal); color: #FFFFFF; }
html[data-pj="on"] body #journey #pj-site .pj-site-btn.pj-site-pale { background: var(--nest-notice); border-color: var(--nest-notice); }
html[data-pj="on"] body #journey #pj-site .pj-site-btn.pj-site-danger { color: #C2412D; }
html[data-pj="on"] body #journey #pj-site .pj-site-btn:disabled { opacity: .45; cursor: default; }
html[data-pj="on"] body #journey #pj-site .pj-site-drop {
  flex: 1 1 0; min-width: 0; min-height: 52px; margin: 0; padding: 6px 10px; border: 1.5px dashed var(--nest-line); border-radius: 2px;
  background: none; color: var(--nest-teal); font: 600 16px/1.25 var(--nest-text); box-shadow: none;
}
html[data-pj="on"] body #journey #pj-site .pj-site-text { min-height: 44px; margin: 0; padding: 0 4px; border: 0; background: none; color: var(--nest-teal); font: 600 16px/1.2 var(--nest-text); box-shadow: none; }
html[data-pj="on"] body #journey #pj-site :is(.pj-site-btn, .pj-site-drop, .pj-site-text, .pj-site-choice):focus-visible { outline: 2px solid var(--nest-teal); outline-offset: 2px; }
html[data-pj="on"] body #journey #pj-site .pj-site-said { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--nest-soft); font: 400 14px/1.4 var(--nest-text); }

/* ---------- the app's own site plan and finder, borrowed: the finder first, as a card ---------- */
html[data-pj="on"] body #journey #pj-site .pj-site-host { display: flex; flex-direction: column; gap: 10px; }
html[data-pj="on"] body #journey #pj-site .pj-site-host > #site-map-controls { order: -1; }
html[data-pj="on"] body #journey #pj-site #site-map-controls.pj-site-card,
html[data-pj="on"] body #journey #pj-site .pj-site-card { background: var(--nest-card); border: 1px solid var(--nest-line); border-radius: 2px; padding: 14px; }
html[data-pj="on"] body #journey #pj-site #site-map-controls { display: flex; flex-direction: column; gap: 10px; }
html[data-pj="on"] body #journey #pj-site #site-map-controls > div:not(.pj-site-row) { display: flex; flex-direction: column; gap: 10px; }
html[data-pj="on"] body #journey #pj-site #site-map-controls label { display: block; font: 600 14px/1.3 var(--nest-text); color: var(--nest-ink); }
html[data-pj="on"] body #journey #pj-site #site-map-controls input[type="text"] {
  display: block; width: 100%; min-height: 44px; margin: 4px 0 0; padding: 10px 12px; box-sizing: border-box;
  border: 1px solid var(--nest-line); border-radius: 2px; background: var(--nest-field); color: var(--nest-ink); font: 400 16px/1.3 var(--nest-text); box-shadow: none;
}
html[data-pj="on"] body #journey #pj-site #site-map-controls .site-map-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
html[data-pj="on"] body #journey #pj-site :is(#site-map-controls, #site-first-plan) :is(.ph-secondary, .ph-primary) {
  display: inline-flex; align-items: center; justify-content: center; width: auto; min-height: 44px; margin: 0; padding: 0 16px;
  border: 1px solid var(--nest-line); border-radius: 999px; background: var(--nest-card); color: var(--nest-teal); font: 600 15px/1.2 var(--nest-text); box-shadow: none;
}
html[data-pj="on"] body #journey #pj-site #site-map-controls .site-map-actions > button:first-child:not([hidden]) { background: var(--nest-teal); border-color: var(--nest-teal); color: #FFFFFF; }
html[data-pj="on"] body #journey #pj-site #site-map-controls .site-snapshot-arrows > button { width: 44px; padding: 0; background: var(--nest-deep); border-color: var(--nest-deep); color: #FFFFFF; }
html[data-pj="on"] body #journey #pj-site #site-map-controls :is(.ph-secondary, .ph-primary):disabled { opacity: .45; }
html[data-pj="on"] body #journey #pj-site #site-map-controls .site-address-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--nest-line); border-radius: 2px; background: var(--nest-field); }
html[data-pj="on"] body #journey #pj-site #site-map-controls .site-address-option {
  display: block; width: 100%; min-height: 44px; margin: 0; padding: 10px 12px; border: 0; border-top: 1px solid var(--nest-line); border-radius: 0;
  background: none; color: var(--nest-ink); font: 400 15px/1.35 var(--nest-text); text-align: left; box-shadow: none;
}
html[data-pj="on"] body #journey #pj-site #site-map-controls li:first-child > .site-address-option { border-top: 0; }
/* #954: choices that read the same carry a second line (street, town, postcode) to tell them apart */
html[data-pj="on"] body #journey #pj-site #site-map-controls .site-address-detail { display: block; margin-top: 2px; color: var(--nest-muted); font: 400 13px/1.35 var(--nest-text); }
html[data-pj="on"] body #journey #pj-site #site-map-controls :is(.site-map-frame, .site-snapshot-image) { display: block; width: 100%; border: 1px solid var(--nest-line); border-radius: 2px; overflow: hidden; }
html[data-pj="on"] body #journey #pj-site #site-map-controls .site-map-frame[hidden] { display: none; }
/* #946: the framing map is at most 60% of the screen height, with no band above or below it inside its frame, so the page
   can always be swiped above and below the map; a drag inside the box moves the map.
   #954: it is square where the screen allows (it was 320 px tall), because the saved picture is exactly the framed view and
   a square picture is the shape the picture service was measured on (engine/portal/site_snapshot.py) */
html[data-pj="on"] body #journey #pj-site #site-map-controls .site-map { height: auto; aspect-ratio: 1 / 1; max-height: 60vh; min-height: 0; margin: 0; }
html[data-pj="on"] body #journey #pj-site #site-map-controls .site-snapshot-image { max-height: 60vh; object-fit: cover; }
/* the picture's credit is shown once: the finder's own line under the map (always on screen with it). The map's own corner
   credit (the same words again, and an "i" button) is not drawn too, as on the app's own Site plan screen (phone-nest-site.css) */
html[data-pj="on"] body #journey #pj-site #site-map-controls .site-map .maplibregl-ctrl-attrib { display: none; }
/* the framing banner inside the finder's card, straight above the map or the picture */
html[data-pj="on"] body #journey #pj-site #site-map-controls .pj-site-instr { margin: 0; }
/* #954: while framing the banner says one of two lines in the same place ("Tap the building on the map, then drag and zoom
   to frame it." until the first tap, then "Drag and zoom to frame the site, then confirm."). The other line is drawn unseen
   in the same cell, so the banner is as tall as the taller of the two for both and the map under it never moves */
html[data-pj="on"] body #journey #pj-site .pj-site-words[data-pj-reserve] { display: grid; }
html[data-pj="on"] body #journey #pj-site .pj-site-words[data-pj-reserve] > span { grid-area: 1 / 1; }
html[data-pj="on"] body #journey #pj-site .pj-site-words[data-pj-reserve]::after { content: attr(data-pj-reserve); grid-area: 1 / 1; visibility: hidden; }
html[data-pj="on"] body #journey #pj-site :is(#site-map-controls, #site-first-plan) .ph-small { color: var(--nest-muted); font: 400 13px/1.4 var(--nest-text); }
html[data-pj="on"] body #journey #pj-site #site-map-controls p:empty { display: none; }
html[data-pj="on"] body #journey #pj-site .pj-site-finderbtns, html[data-pj="on"] body #journey #pj-site #site-map-controls > .pj-site-text { margin: 0; }

/* ---------- the plan: the picture with the zoom buttons on it; outlined while a label is being placed ---------- */
html[data-pj="on"] body #journey #pj-site #site-first-plan { display: flex; flex-direction: column; gap: 10px; }
html[data-pj="on"] body #journey #pj-site #site-first-plan [id$="-roofs"] { display: flex; flex-direction: column; gap: 10px; }
html[data-pj="on"] body #journey #pj-site #site-first-plan .flow-plan-tabs { display: flex; gap: 8px; margin: 0; }
html[data-pj="on"] body #journey #pj-site #site-first-plan .flow-plan-tabs > button[aria-pressed="true"] { background: var(--nest-deep); border-color: var(--nest-deep); color: #FFFFFF; }
html[data-pj="on"] body #journey #pj-site .pj-site-frame { position: relative; border: 1px solid var(--nest-line); border-radius: 2px; overflow: hidden; background: #CFD6D2; }
html[data-pj="on"] body #journey #pj-site .pj-site-placing .pj-site-frame { outline: 3px solid var(--nest-signal); outline-offset: -3px; }
html[data-pj="on"] body #journey #pj-site .pj-site-frame .site-picture-viewport { margin: 0; max-height: 55vh; }
html[data-pj="on"] body #journey #pj-site .pj-site-frame .site-plan-zoom {
  position: absolute; right: 8px; bottom: 8px; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0;
}
html[data-pj="on"] body #journey #pj-site #site-first-plan .pj-site-frame .site-plan-zoom > button {
  width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 999px; background: var(--nest-deep); color: #FFFFFF;
  display: inline-flex; align-items: center; justify-content: center;
}
html[data-pj="on"] body #journey #pj-site #site-first-plan .pj-site-frame .site-plan-zoom > button:disabled { opacity: .45; }
html[data-pj="on"] body #journey #pj-site .pj-site-frame .site-plan-zoom .ph-nest-icon { width: 22px; height: 22px; }
html[data-pj="on"] body #journey #pj-site .pj-site-frame .site-plan-zoom-level {
  min-width: 44px; padding: 2px 6px; border-radius: 999px; background: rgba(15, 46, 45, .8); color: #FFFFFF; font: 500 12px/1.4 var(--nest-mono); text-align: center;
}
html[data-pj="on"] body #journey #pj-site .pj-site-frame .roof-pin { border-radius: 2px; border: 2px solid #FFFFFF; font: 700 13px/1.2 var(--nest-text); }
html[data-pj="on"] body #journey #pj-site .pj-site-frame .roof-pin:not([data-pj-priority]):not(.needs-review) { background: #6E7A78; color: #FFFFFF; }
html[data-pj="on"] body #journey #pj-site #site-first-plan [data-site-plan-hint],
html[data-pj="on"] body #journey #pj-site #site-first-plan [data-site-plan-status] { color: var(--nest-muted); font: 400 13px/1.4 var(--nest-text); }

/* ---------- Change site plan, Take a photo, Delete site plan ---------- */
html[data-pj="on"] body #journey #pj-site .pj-site-planbtns { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
html[data-pj="on"] body #journey #pj-site .pj-site-planbtns > .pj-site-row { align-self: stretch; }

/* ---------- headings, inspection type cards, roof label cards ---------- */
html[data-pj="on"] body #journey #pj-site .pj-site-h { margin: 10px 0 0; font: 750 19px/1.25 var(--nest-disp); font-stretch: 118%; letter-spacing: -.01em; color: var(--nest-ink); }
html[data-pj="on"] body #journey #pj-site .pj-site-small { color: var(--nest-muted); font: 400 13px/1.4 var(--nest-text); }
html[data-pj="on"] body #journey #pj-site .pj-site-warn { color: #C2412D; font: 400 14px/1.4 var(--nest-text); }
html[data-pj="on"] body #journey #pj-site :is(.pj-site-insp, .pj-site-labels) { display: flex; flex-direction: column; gap: 10px; }
html[data-pj="on"] body #journey #pj-site .pj-site-cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
html[data-pj="on"] body #journey #pj-site .pj-site-choice {
  display: block; min-height: 96px; margin: 0; padding: 14px; border: 1px solid var(--nest-line); border-radius: 2px; background: var(--nest-card);
  color: var(--nest-ink); text-align: left; box-shadow: none; font: 400 15px/1.35 var(--nest-text);
}
html[data-pj="on"] body #journey #pj-site .pj-site-choice b { display: block; font-weight: 700; }
html[data-pj="on"] body #journey #pj-site .pj-site-choice small { display: block; margin-top: 4px; color: var(--nest-muted); font-size: 14px; }
html[data-pj="on"] body #journey #pj-site .pj-site-choice[aria-pressed="true"] { background: var(--nest-deep); border-color: var(--nest-deep); color: #FFFFFF; }
html[data-pj="on"] body #journey #pj-site .pj-site-choice[aria-pressed="true"] small { color: #B9D3CD; }
html[data-pj="on"] body #journey #pj-site .pj-site-roof { display: flex; flex-direction: column; gap: 10px; }
html[data-pj="on"] body #journey #pj-site .pj-site-roofhead { display: flex; align-items: center; gap: 10px; }
html[data-pj="on"] body #journey #pj-site .pj-site-roofhead input,
html[data-pj="on"] body #journey #pj-site .pj-site-roof select {
  flex: 1; min-width: 0; width: 100%; min-height: 44px; margin: 0; padding: 10px 12px; box-sizing: border-box; border: 1px solid var(--nest-line);
  border-radius: 2px; background: var(--nest-field); color: var(--nest-ink); font: 400 16px/1.3 var(--nest-text); box-shadow: none;
}
html[data-pj="on"] body #journey #pj-site .pj-site-dot { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 999px; vertical-align: -2px; }
html[data-pj="on"] body #journey #pj-site .pj-site-where { color: var(--nest-muted); font: 400 13px/1.3 var(--nest-text); }
html[data-pj="on"] body #journey #pj-site .pj-site-add { align-self: flex-start; }
html[data-pj="on"] body #journey #pj-site .pj-site-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }

/* ---------- pinned at the bottom: Next: the roofs (iPhone home indicator; Android's gesture bar is shorter) ---------- */
html[data-pj="on"] body #journey #pj-site .pj-site-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0 auto; max-width: 760px; box-sizing: border-box;
  padding: 10px 18px calc(10px + max(24px, env(safe-area-inset-bottom))); background: linear-gradient(rgba(234, 238, 236, 0), var(--nest-mist) 30%);
}
html[data-pj="on"][data-nest-os="android"] body #journey #pj-site .pj-site-bar { padding-bottom: calc(10px + max(8px, env(safe-area-inset-bottom))); }
html[data-pj="on"] body #journey #pj-site .pj-site-bar > .pj-site-btn { width: 100%; min-height: 52px; font-size: 17px; }
/* switched off (a tap or drag is still needed, or a confirm is under way) the pinned button looks off but stays solid: the same
   faded teal as a see-through one (45% teal on the page's mist), so the page scrolling behind never shows through it */
html[data-pj="on"] body #journey #pj-site .pj-site-bar > .pj-site-btn:disabled { opacity: 1; background: #8FACAB; border-color: #8FACAB; color: #FFFFFF; }
/* #946: while framing, Confirm site plan is the pinned button and Next: the roofs a small text button beside Upload instead */
html[data-pj="on"] body #journey #pj-site .pj-site-confirm { align-items: center; justify-content: space-between; }
html[data-pj="on"] body #journey #pj-site .pj-site-nextsmall { padding: 0 8px; }

/* ---------- − and + on the framing map (#909's zoom, as the prototype), the picture's credit, the More section ---------- */
html[data-pj="on"] body #journey #pj-site #site-map-controls .site-map-frame { position: relative; }
html[data-pj="on"] body #journey #pj-site .pj-site-mapzoom { position: absolute; right: 8px; bottom: 8px; z-index: 3; display: flex; flex-direction: column; gap: 8px; }
html[data-pj="on"] body #journey #pj-site .pj-site-zoombtn {
  width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: var(--nest-deep); color: #FFFFFF;
  font: 400 24px/1 var(--nest-text); display: inline-flex; align-items: center; justify-content: center; box-shadow: none; cursor: pointer;
}
html[data-pj="on"] body #journey #pj-site .pj-site-zoombtn:disabled { opacity: .45; cursor: default; }
html[data-pj="on"] body #journey #pj-site .pj-site-zoombtn:focus-visible { outline: 2px solid var(--nest-signal); outline-offset: 2px; }
html[data-pj="on"] body #journey #pj-site .pj-site-credit { color: var(--nest-muted); font: 400 13px/1.4 var(--nest-text); }
html[data-pj="on"] body #journey #pj-site .pj-site-more { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 6px; }
html[data-pj="on"] body #journey #pj-site .pj-site-line > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--nest-muted); font: 400 13px/1.4 var(--nest-text); }
html[data-pj="on"] body #journey #pj-site .pj-site-line :is(.ph-secondary, .ph-primary) {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 0; padding: 0 14px; border: 1px solid var(--nest-line);
  border-radius: 999px; background: var(--nest-card); color: var(--nest-teal); font: 600 14px/1.2 var(--nest-text); box-shadow: none;
}
html[data-pj="on"] body #journey #pj-site .pj-site-caution { color: var(--nest-muted); font: 400 13px/1.4 var(--nest-text); }
/* while a confirm is under way the page takes no other tap; the pinned bar holds Confirm site plan only, switched off (#946) */
html[data-pj="on"] body #journey #pj-site.pj-site-busy > :not(.pj-site-bar) { pointer-events: none; }
/* the short message near the bottom (the prototype's toast), over the pinned button's gradient, never covering it */
html[data-pj="on"] body #journey #pj-site .pj-site-toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 60; transform: translateX(-50%);
  width: max-content; max-width: min(400px, calc(100vw - 36px)); box-sizing: border-box; padding: 12px 16px; border-radius: 2px;
  background: var(--nest-deep); color: #FFFFFF; font: 400 14px/1.4 var(--nest-text); box-shadow: 0 6px 20px rgba(0, 0, 0, .2); pointer-events: none;
}

/* #975 P3a: numbered item pins on the site plan (phone_item_pins only); the legend shares the roof picture's look */
html[data-pj="on"] body #journey .sp-plan > .pj-item-pin { position: absolute; z-index: 2; box-sizing: border-box; min-width: 24px; height: 24px; margin: -12px 0 0 -12px; padding: 0 4px; border: 2px solid #fff; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; font: 700 12px/1 var(--nest-text); box-shadow: 0 1px 3px rgba(0,0,0,.4); pointer-events: none; }

/* #975 Z1c: a whole-building survey's numbered pins on the Property screen's site plan (phone_item_pins only), and their
   legend with "N of M placed"; the same look as the roof module's (above, and phone-journey-roofs.css) */
body #site-plan .sp-plan > .pj-item-pin { position: absolute; z-index: 2; box-sizing: border-box; min-width: 24px; height: 24px; margin: -12px 0 0 -12px; padding: 0 4px; border: 2px solid #fff; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; font: 700 12px/1 var(--nest-text, inherit); box-shadow: 0 1px 3px rgba(0,0,0,.4); pointer-events: none; }
body #site-plan .pj-item-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 0; font: 500 13px/1.3 var(--nest-text, inherit); color: var(--nest-muted, #5d6763); }
body #site-plan .pj-item-legend .pj-item-key { display: inline-flex; align-items: center; gap: 5px; }
body #site-plan .pj-item-legend .pj-item-key > i { display: inline-block; width: 12px; height: 12px; border-radius: 999px; border: 1px solid rgba(0,0,0,.15); }
body #site-plan .pj-item-legend .pj-item-count { flex-basis: 100%; font-weight: 700; color: var(--nest-ink, #1d2422); }
