/* #911 Journey lane 1 (shell), part of #910: the Flat roof / Pitched roof rows on a roof survey's Elements and the roof-module
   screen (#journey). Every rule needs html[data-pj] (set by assets/phone-journey.js only while phone_journey, phone_ui_nest and
   phone_ui_flow are on), so with the switch off nothing here applies. Nest rules: pills 999 px, every other edge 2 px,
   Archivo / Plex, 44 pt targets. Look: records/JOURNEY-PLAN-2026-11-09/prototype/index.html (.list, .li, .chip, .open, .tabs). */

/* ---------- a roof survey's Elements: the two rows replace today's roof Elements content (kept in the page, hidden) ---------- */
html[data-pj="on"][data-pj-elements] body #elements > :not(#pj-elements):not(button.ph-primary[data-tab="report"]) { display: none !important; }
html[data-pj="on"][data-pj-elements] body #roof-subtabs,
html[data-pj="on"][data-pj-elements] body #nest-roof-instruction { display: none !important; }
/* the roof survey's tabs are Property · Elements · Report: the site plan lives in the module */
html[data-pj="on"][data-nest-kind="roof"] body #premium-site-tab,
html[data-pj="on"][data-pj-module] body #premium-site-tab { display: none !important; }

html[data-pj="on"][data-pj-elements] body .ph-top #nest-roof-search { display: none !important; }
html[data-pj="on"] body .pj-elements { display: block; margin: 4px 0 16px; }
html[data-pj="on"] body .pj-list { display: block; margin: 0; background: var(--nest-card); border: 1px solid var(--nest-line); border-radius: 2px; }
html[data-pj="on"] body #elements :is(#pj-elements, #sections) .pj-row {
  display: flex; align-items: center; gap: 12px; width: 100%; height: auto; max-height: none; min-height: 64px; margin: 0; padding: 12px 14px;
  border: 0; border-top: 1px solid var(--nest-line); border-radius: 0; background: none; box-shadow: none;
  color: var(--nest-ink); font: 400 15px/1.35 var(--nest-text); text-align: left; cursor: pointer;
}
html[data-pj="on"] body #elements :is(#pj-elements, #sections) .pj-row:first-child { border-top: 0; }
html[data-pj="on"] body #elements :is(#pj-elements, #sections) .pj-row:focus-visible { outline: 2px solid var(--nest-teal); outline-offset: -2px; }
html[data-pj="on"] body #elements :is(#pj-elements, #sections) .pj-chip {
  flex: none; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1.5px dashed var(--nest-line);
  border-radius: 2px; color: var(--nest-muted); font: 700 13px/1 var(--nest-text);
}
html[data-pj="on"] body #elements :is(#pj-elements, #sections) .pj-row-main { flex: 1 1 0; min-width: 0; display: block; white-space: normal; overflow-wrap: anywhere; }
html[data-pj="on"] body #elements :is(#pj-elements, #sections) .pj-row-title { display: block; font: 600 15px/1.3 var(--nest-text); color: var(--nest-ink); }
html[data-pj="on"] body #elements :is(#pj-elements, #sections) .pj-row-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; margin-top: 2px; font: 400 13px/1.35 var(--nest-text); color: var(--nest-muted); white-space: normal; }
/* the subtitle with no roofs is one long sentence: it wraps inside the text column, which shrinks; Open › keeps its own space */
html[data-pj="on"] body #elements :is(#pj-elements, #sections) .pj-row-sub > .pj-row-empty { display: block; min-width: 0; flex: 1 1 100%; }
html[data-pj="on"] body #elements :is(#pj-elements, #sections) .pj-dots { display: inline-flex; flex-wrap: wrap; gap: 4px; }
html[data-pj="on"] body #elements :is(#pj-elements, #sections) .pj-dot { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 999px; }
html[data-pj="on"] body #elements :is(#pj-elements, #sections) .pj-open { flex: none; color: var(--nest-teal); font: 700 15px/1 var(--nest-text); white-space: nowrap; }
html[data-pj="on"] body .pj-vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* inside the module only the module's own tabs: the survey's Property · Elements · Report bar (phone.js shows it on every survey
   screen, the module and a part open in place in it included) and the capture breadcrumb stay hidden; the survey's warnings
   (two versions, not sent, photos missing) show above the module as on every survey screen */
html[data-pj="on"][data-pj-module] body #tabs,
html[data-pj="on"][data-pj-module] body #journey > .ph-capture-breadcrumb { display: none !important; }
/* (--pj-chrome: the module's own header bottom, measured by assets/phone-journey.js; the tabs stick under it, never over the page) */
/* ---------- the roof module: the app's top bar (Back, the title, the address under it, the save line under that), then the module
   tabs. The rules carry [data-app-design="flow"] so they outrank app-design.css's fixed Flow header rows: the title block and the
   save line each get their own row, sized to their content, so a long address and the save line never overlap. ---------- */
html[data-pj="on"][data-pj-module][data-app-design="flow"] body .ph-sticky { background: var(--nest-mist); border-bottom: 1px solid var(--nest-line); }
/* the prototype: the module tabs start right under the header's line (no gap above them at rest); the survey's warnings, when
   shown, keep their own spacing above the module */
html[data-pj="on"][data-pj-module][data-app-design="flow"] body .ph-main { padding-top: 0; }
html[data-pj="on"][data-pj-module][data-app-design="flow"] body .ph-main > :not(#journey):not([hidden]):first-child { margin-top: 16px; }
html[data-pj="on"][data-pj-module][data-app-design="flow"] body { background: var(--nest-mist); color: var(--nest-ink); }
html[data-pj="on"][data-pj-module][data-app-design="flow"] body .ph-top:has(#back) {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; grid-template-rows: auto auto; align-items: center; align-content: center; gap: 0;
  height: auto; min-height: 52px; padding: calc(env(safe-area-inset-top) + 6px) 6px 6px; background: var(--nest-mist); color: var(--nest-ink); border: 0; box-shadow: none;
}
html[data-pj="on"][data-pj-module][data-app-design="flow"] body .ph-top:has(#back) #back {
  grid-column: 1; grid-row: 1 / -1; align-self: center; 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;
}
/* the title, address and save line sit left, beside Back, on both platforms: the approved prototype (coordinator's decision, #917) */
html[data-pj="on"][data-pj-module][data-app-design="flow"] body .ph-top:has(#back) .ph-title { grid-column: 2; grid-row: 1; min-width: 0; height: auto; display: block; text-align: left; padding-left: 4px; }
html[data-pj="on"][data-pj-module][data-app-design="flow"] body .ph-top:has(#back) .ph-title > :not(#title):not(#pj-address) { display: none; }
html[data-pj="on"][data-pj-module][data-app-design="flow"] 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-pj="on"][data-pj-module][data-app-design="flow"] body .ph-top #pj-address {
  display: block; margin: 1px 0 0; font: 400 13px/1.3 var(--nest-text); color: var(--nest-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html[data-pj="on"][data-pj-module][data-app-design="flow"] body .ph-top #pj-address[hidden] { display: none; }
html[data-pj="on"][data-pj-module][data-app-design="flow"] body .ph-top:has(#back) #status {
  grid-column: 2; grid-row: 2; position: static; margin: 3px 0 0; padding-left: 4px; font: 500 11px/1.2 var(--nest-mono); letter-spacing: 0; text-transform: none; color: var(--nest-muted);
  text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html[data-pj="on"][data-pj-module][data-app-design="flow"] body .ph-top:has(#back) #status:empty { display: none; }
/* Android (HANDOVER rule 12): a 64 px bar, the title to the left, the arrow back */
html[data-pj="on"][data-pj-module][data-app-design="flow"][data-nest-os="android"] body .ph-top:has(#back) { min-height: 64px; padding: calc(env(safe-area-inset-top) + 6px) 8px 6px 4px; }
html[data-pj="on"][data-pj-module][data-app-design="flow"][data-nest-os="android"] body .ph-top:has(#back) .ph-title,
html[data-pj="on"][data-pj-module][data-app-design="flow"][data-nest-os="android"] body .ph-top:has(#back) #status { text-align: left; padding-left: 4px; }
html[data-pj="on"][data-pj-module][data-app-design="flow"][data-nest-os="android"] body .ph-top:has(#back) #title { font-size: 22px; }
html[data-pj="on"][data-pj-module][data-app-design="flow"][data-nest-os="android"] body .ph-top:has(#back) #back { font-size: 0; }
html[data-pj="on"][data-pj-module][data-app-design="flow"][data-nest-os="android"] body .ph-top:has(#back) #back::before { content: "\2190"; font: 400 26px/1 var(--nest-text); color: var(--nest-teal); }

html[data-pj="on"] body #journey { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
html[data-pj="on"] body #journey .pj-tabs {
  position: sticky; top: var(--pj-chrome, 52px); z-index: 15; display: flex; margin: 0 0 12px; background: var(--nest-mist);
  border-bottom: 1px solid var(--nest-line);
}
/* F6g: what scrolls under the sticky tabs fades into the page colour over the 12 px under their hairline, so a row is never
   cut hard against the active tab's underline */
html[data-pj="on"] body #journey .pj-tabs::after {
  content: ""; position: absolute; left: 0; right: 0; top: calc(100% + 1px); height: 12px; pointer-events: none;
  background: linear-gradient(var(--nest-mist), rgba(234, 238, 236, 0));
}
html[data-pj="on"] body #journey .pj-tab {
  flex: 1; min-height: 44px; margin: 0; padding: 12px 4px; border: 0; border-bottom: 3px solid transparent; border-radius: 0 !important;
  background: none; box-shadow: none; color: var(--nest-muted); font: 600 15px/1.2 var(--nest-text); cursor: pointer;
}
html[data-pj="on"] body #journey .pj-tab[aria-current="true"] { color: var(--nest-ink); border-bottom-color: var(--nest-teal); }
html[data-pj="on"] body #journey .pj-tab:focus-visible { outline: 2px solid var(--nest-teal); outline-offset: -2px; }
html[data-pj="on"] body #journey .pj-placeholder { margin: 8px 0; color: var(--nest-soft); font: 400 15px/1.45 var(--nest-text); }
/* P8 C2 (#794): a combined survey's Flat roof and Pitched roof rows sit in the building's list (#sections, phone_survey_scope):
   the same row as above; the chip carries the worst rating on that kind's roofs, coloured as a part's chip. */
html[data-pj="on"] body #elements #sections .pj-chip:is(.r3, .r2, .r1, .rni) { border: 0; }
html[data-pj="on"] body #elements #sections .pj-chip.r3 { background: var(--nest-urgent); color: #fff; }
html[data-pj="on"] body #elements #sections .pj-chip.r2 { background: var(--nest-repair); color: var(--nest-ink); }
html[data-pj="on"] body #elements #sections .pj-chip.r1 { background: var(--nest-norepair); color: #fff; }
html[data-pj="on"] body #elements #sections .pj-chip.rni { background: var(--nest-ni); color: #fff; font-size: 10px; }
html[data-pj="on"] body #elements #sections .ph-list > .pj-row[hidden] { display: none; }
html[data-pj="on"] body #elements #sections .pj-scope-hits[hidden] { display: none; }
/* the one-step New survey sheet has no way back to a type step */
html[data-survey-scope="on"] #flow-new-back { display: none !important; }
/* in the building's list the two roof rows take the list's own row size, chip and dividers (Nest's rows, phone-nest-roof.css) */
html[data-pj="on"] body #elements #sections .ph-section .pj-row { min-height: 56px; gap: 12px; padding: 10px 14px; }
html[data-pj="on"] body #elements #sections .ph-section .pj-chip { width: 24px; height: 24px; font: 700 13px/1 var(--nest-text); }
html[data-pj="on"] body #elements #sections .ph-section .pj-row-title { font: 600 16px/1.3 var(--nest-text); }
html[data-phone-nest][data-app-design="flow"][data-pj="on"] body #elements #sections .ph-section .pj-row + button.ph-item { border-top: 1px solid var(--nest-line); }
