/* Owner-selected Codex app foundations, 7 Nov 2026. Every rule is explicitly gated.
   Controls are compact rounded rectangles; content surfaces have softer corners.
   This is application chrome, never report content or a replacement data model. */
html[data-app-design] {
  --flow-bg: #f2f5f2;
  --flow-ink: #182e2d;
  --flow-muted: #586b65;
  --flow-paper: #fff;
  --flow-panel: #e7eee9;
  --flow-line: #ccd8d0;
  --flow-accent: #166052;
  --flow-ring: #087966;
  --flow-danger: #a83232;
  --flow-control: 12px;
  --flow-surface: 16px;
  --flow-sheet: 20px;
  --flow-target: 48px;
  --flow-shadow: 0 10px 30px #163e2e0d;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-display: 'Archivo', 'IBM Plex Sans', system-ui, sans-serif;
  --bg: var(--flow-bg);
  --surface-card: var(--flow-paper);
  --surface-inset: var(--flow-panel);
  --line-card: var(--flow-line);
  --line-bright: var(--flow-line);
  --text-strong: var(--flow-ink);
  --text-body: var(--flow-muted);
  --text-muted: var(--flow-muted);
  --accent: var(--flow-accent);
  --sn-button-radius: var(--flow-control);
  --sn-radius-pill: var(--flow-control);
  --sn-radius: var(--flow-surface);
  color-scheme: light;
  scroll-padding-block: 5rem 2rem;
}
html[data-app-design] body {
  background: var(--flow-bg);
  color: var(--flow-ink);
  -webkit-text-size-adjust: 100%;
}
html[data-app-design] :is(button, a, input, textarea, select, summary) {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
html[data-app-design] :focus-visible {
  outline: 2px solid var(--flow-ring);
  outline-offset: 3px;
}
html[data-app-design] :is(input, textarea, select) {
  font-size: max(1rem, 16px);
  caret-color: var(--flow-accent);
  scroll-margin-block: 5rem 2rem;
}
html[data-app-design] :is(h1, h2, h3) { overflow-wrap: anywhere; }
html[data-app-design] .sn-flow-surface {
  padding: 20px;
  border: 1px solid var(--flow-line);
  border-radius: var(--flow-surface);
  background: var(--flow-paper);
  min-width: 0;
}
html[data-app-design] .sn-flow-split { display: grid; gap: 24px; min-width: 0; }
html[data-app-design] .sn-flow-stack { display: grid; gap: 20px; min-width: 0; }
html[data-app-design] .sn-flow-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Phone shared pieces. Existing screen-specific behaviour and feature gates remain. */
html[data-brand="surveynest"][data-app-design="flow"] {
  --phone-premium-mist: var(--flow-bg);
  --phone-premium-card: var(--flow-paper);
  --phone-premium-ink: var(--flow-ink);
  --phone-premium-muted: var(--flow-muted);
  --phone-premium-line: var(--flow-line);
  --phone-premium-teal: var(--flow-accent);
}
html[data-brand="surveynest"][data-app-design="flow"] .ph-main {
  max-width: 760px;
  padding-inline: max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right));
}
html[data-brand="surveynest"][data-app-design="flow"] :is(.ph-primary, .ph-secondary, .ph-danger, .ph-premium-button, .ph-voice-undo, .ph-voice-clear) {
  min-height: var(--flow-target);
  border-radius: var(--flow-control);
  padding: 11px 16px;
  line-height: 1.3;
  white-space: normal;
}
html[data-brand="surveynest"][data-app-design="flow"] :is(.ph-primary, .ph-premium-button--primary) {
  background: var(--flow-accent);
  color: #fff;
}
html[data-brand="surveynest"][data-app-design="flow"] :is(.ph-secondary, .ph-premium-button--secondary) {
  background: var(--flow-panel);
  color: var(--flow-ink);
  border: 1px solid transparent;
}
html[data-brand="surveynest"][data-app-design="flow"] :is(.ph-card, .ph-block, .ph-premium-card, .ph-premium-empty) {
  border-radius: var(--flow-surface);
  background: var(--flow-paper);
  border-color: var(--flow-line);
}
html[data-brand="surveynest"][data-app-design="flow"] .ph-premium-sheet { border-radius: var(--flow-sheet); }
html[data-brand="surveynest"][data-app-design="flow"] :is(.ph-form, .ph-more) :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
  min-height: var(--flow-target);
  border: 1px solid var(--flow-line);
  border-radius: var(--flow-control);
  padding: 11px 13px;
  background: var(--flow-paper);
  color: var(--flow-ink);
  font-size: max(1rem, 16px);
}
html[data-brand="surveynest"][data-app-design="flow"] :is(.ph-choice button, .ph-mic, .ph-back, .ph-tabs button, .ph-roof-subtabs button) {
  min-height: var(--flow-target);
  min-width: var(--flow-target);
  border-radius: var(--flow-control);
}
html[data-brand="surveynest"][data-app-design="flow"] .ph-choice button[aria-pressed="true"] {
  border-color: var(--flow-accent);
  box-shadow: inset 0 0 0 1px var(--flow-accent);
}
html[data-brand="surveynest"][data-app-design="flow"] .ph-form { gap: 20px; }
html[data-brand="surveynest"][data-app-design="flow"] :is(.ph-new-sheet-body, .ph-element-overlay) {
  border-start-start-radius: var(--flow-sheet);
  border-start-end-radius: var(--flow-sheet);
}

/* Studio shares the same identity. The wider frame leaves room for list + inspector. */
html[data-app-design="studio"] .pro-premium {
  --pro-teal: var(--flow-accent);
  --pro-mist: var(--flow-bg);
  --pro-card: var(--flow-paper);
  --pro-ink: var(--flow-ink);
  --pro-muted: var(--flow-muted);
  --pro-line: var(--flow-line);
  --pro-radius: var(--flow-surface);
  --pro-pill: var(--flow-control);
}
html[data-app-design="studio"] .pro-premium :is(.pro-button, .premium-nav a, .premium-menu-toggle) {
  min-height: var(--flow-target);
  min-width: var(--flow-target);
  border-radius: var(--flow-control);
}
html[data-app-design="studio"] .pro-premium .pro-button { padding-block: 10px; }
html[data-app-design="studio"] .premium-sidebar { background: #142c2b; }
html[data-app-design="studio"] .premium-header { background: var(--flow-bg); }
html[data-app-design="studio"] .pro-premium :is(.pro-card, .pro-empty) { border-radius: var(--flow-surface); }
html[data-app-design="studio"] .pro-premium .pro-table :is(th, td) { padding-block: 16px; }
html[data-app-design="studio"] .pro-premium .pro-table tbody tr { height: auto; min-height: 56px; }
@media (min-width: 900px) {
  html[data-app-design] .sn-flow-split { grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); align-items: start; }
  html[data-brand="surveynest"][data-app-design="flow"] .ph-main { padding-top: 24px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  html[data-brand="surveynest"][data-app-design="flow"] .ph-top { padding-top: max(8px, env(safe-area-inset-top)); }
  html[data-app-design] .sn-flow-surface { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-app-design] :is(.ph-push, .ph-pop, .ph-new-sheet-body, .ph-element-overlay, .premium-sidebar) {
    animation: none;
    transition: none;
  }
  html[data-app-design] { scroll-behavior: auto; }
}

/* Home and creation: one compact identity, visible drafts, an explicit keyboard-free entry. */
html[data-brand="surveynest"][data-app-design="flow"] .ph-flow-wordmark { display: block; width: 154px; height: 32px; object-fit: contain; }
html[data-brand="surveynest"][data-app-design="flow"] { background: var(--flow-bg); }
html[data-brand="surveynest"][data-app-design="flow"] body { min-height: 100dvh; background: var(--flow-bg); }
html[data-brand="surveynest"][data-app-design="flow"] .ph-flow-only { display: block; }
html[data-brand="surveynest"][data-app-design="flow"] :is(.ph-brand, .ph-login-brand, .ph-home-existing-intro) { display: none; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-top {
  background: var(--flow-bg); color: var(--flow-ink);
  padding: calc(10px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 10px max(18px, env(safe-area-inset-left));
}
html[data-brand="surveynest"][data-app-design="flow"] .ph-title strong { margin-top: 6px; font-size: 13px; color: var(--flow-muted); }
html[data-brand="surveynest"][data-app-design="flow"] .ph-status { color: var(--flow-muted); }
html[data-brand="surveynest"][data-app-design="flow"][data-phone-screen="login"] .ph-sticky { display: block; }
html[data-brand="surveynest"][data-app-design="flow"][data-phone-screen="login"] #title { display: none; }
html[data-brand="surveynest"][data-app-design="flow"] #login { padding-top: 28px; }
html[data-brand="surveynest"][data-app-design="flow"] #home > h1 { font-size: 30px; font-weight: 650; letter-spacing: -.025em; margin: 14px 0 8px; }
html[data-brand="surveynest"][data-app-design="flow"] #home .ph-lead { font-size: 15px; margin-bottom: 24px; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-home-group h2 { font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; margin: 0 0 10px; }
html[data-brand="surveynest"][data-app-design="flow"] #surveys { border: 0; display: grid; gap: 20px; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-home-rows { border: 0; padding: 0; overflow: hidden; border-radius: 16px; box-shadow: var(--flow-shadow); }
html[data-brand="surveynest"][data-app-design="flow"] #surveys .ph-item { padding: 16px; min-height: 76px; }
html[data-brand="surveynest"][data-app-design="flow"] #surveys .ph-item:last-child { border-bottom: 0; }
html[data-brand="surveynest"][data-app-design="flow"] #survey-search-open { width: 48px; height: 48px; border-radius: 12px; margin-top: -3px; float: right; background: transparent; border: 0; color: var(--flow-accent); }
html[data-brand="surveynest"][data-app-design="flow"] #survey-search-box:not([hidden]) { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
html[data-brand="surveynest"][data-app-design="flow"] #survey-search-box input { min-width: 0; flex: 1; }
html[data-brand="surveynest"][data-app-design="flow"] #survey-search-close { min-height: 48px; border-radius: 12px; }
html[data-brand="surveynest"][data-app-design="flow"] #new-survey-open { left: auto; width: auto; min-height: 52px; border-radius: 12px; bottom: calc(var(--ph-home-nav-height, 64px) + 28px + env(safe-area-inset-bottom)); right: max(18px, env(safe-area-inset-right)); }
html[data-brand="surveynest"][data-app-design="flow"] .ph-home-nav {
  left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom)); padding: 6px; gap: 4px;
  border: 0; border-radius: 18px; background: var(--flow-paper); box-shadow: var(--flow-shadow);
}
html[data-brand="surveynest"][data-app-design="flow"] .ph-home-nav :is(button, a) { min-height: 52px; border-radius: 12px; color: var(--flow-muted); font-size: 11px; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-home-nav [aria-current="page"] { box-shadow: none; color: var(--flow-accent); background: var(--flow-panel); }
html[data-brand="surveynest"][data-app-design="flow"] :is(#login, #details, #account) h1 { font-size: 30px; letter-spacing: -.025em; }
html[data-brand="surveynest"][data-app-design="flow"] #account .ph-account-group { border-radius: 16px; overflow: hidden; }
html[data-brand="surveynest"][data-app-design="flow"] #account .ph-premium-row { min-height: 56px; }
html[data-brand="surveynest"][data-app-design="flow"]:not([data-phone-premium="on"]) #account button.ph-account-terms { border: 0; border-radius: 16px; background: var(--flow-paper); box-shadow: var(--flow-shadow); color: var(--flow-ink, var(--sn-ink)); }

html[data-app-design="flow"].ph-flow-creating body { position: fixed; left: 0; right: 0; overflow: hidden; }
html[data-brand="surveynest"][data-app-design="flow"] #new-survey-sheet { align-items: stretch; background: var(--flow-bg); }
html[data-brand="surveynest"][data-app-design="flow"] .ph-new-sheet-body {
  height: 100dvh; max-height: 100dvh; border-radius: 0; width: 100%;
  padding: max(12px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: var(--flow-bg); overflow-y: auto; overscroll-behavior: contain;
}
html[data-brand="surveynest"][data-app-design="flow"] .ph-new-sheet-body .ph-grabber { display: none; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-sheet-heading { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 24px; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-sheet-heading h2 { font-size: 19px; min-height: 52px; display: flex; align-items: center; margin: 0; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-sheet-heading button { position: static; min-width: 64px; min-height: 48px; padding: 8px; border-radius: 12px; font-size: 14px; }
html[data-brand="surveynest"][data-app-design="flow"] #new-form { background: transparent; gap: 20px; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-kind-select { display: none; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-close-symbol { display: none; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-close-cancel { display: inline; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-kind-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border: 0; padding: 0; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-kind-choices label { display: block; position: relative; min-width: 0; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-kind-choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-kind-choices span { display: flex; flex-direction: column; background: var(--flow-paper); border: 1px solid var(--flow-line); min-height: 112px; border-radius: 12px; padding: 18px 12px; justify-content: center; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-kind-choices input:checked + span { border: 2px solid var(--flow-accent); background: var(--flow-panel); padding: 17px 11px; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-kind-choices input:focus-visible + span { outline: 2px solid var(--flow-ring); outline-offset: 3px; }
html[data-brand="surveynest"][data-app-design="flow"] #new-form :is(input[name="site"], button) { border-radius: 12px; min-height: 48px; }
html[data-brand="surveynest"][data-app-design="flow"] [data-flow-step="type"] :is(.ph-new-property, [type="submit"], #flow-new-back),
html[data-brand="surveynest"][data-app-design="flow"] [data-flow-step="property"] :is(.ph-kind-choices, #flow-new-next) { display: none; }
@media (min-width: 700px) {
  html[data-brand="surveynest"][data-app-design="flow"] #new-survey-sheet { align-items: center; justify-content: center; background: #102a2859; }
  html[data-brand="surveynest"][data-app-design="flow"] .ph-new-sheet-body { width: min(580px, calc(100% - 48px)); height: min(440px, calc(100dvh - 48px)); max-height: calc(100dvh - 48px); padding: 28px; border-radius: 20px; }
  html[data-brand="surveynest"][data-app-design="flow"] .ph-home-nav { max-width: 736px; margin-inline: auto; }
}
@media (max-height: 500px) and (orientation: landscape) {
  html[data-brand="surveynest"][data-app-design="flow"] .ph-new-sheet-body { max-height: 100dvh; height: 100dvh; width: 100%; padding-block: 8px 16px; border-radius: 0; }
  html[data-brand="surveynest"][data-app-design="flow"] .ph-sheet-heading { margin-bottom: 12px; }
}

/* Elements are recognisable compact tiles; a rating edit never replaces its focus target. */
html[data-brand="surveynest"][data-app-design="flow"] .ph-top:has(#back:not([hidden])) { display: grid; grid-template-columns: 48px minmax(0, 1fr); grid-template-rows: minmax(24px, auto) 18px; gap: 0 10px; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-top:has(#back:not([hidden])) .ph-flow-wordmark { display: none; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-top:has(#back:not([hidden])) #back { grid-row: 1 / span 2; color: var(--flow-ink); }
html[data-brand="surveynest"][data-app-design="flow"] .ph-top:has(#back:not([hidden])) .ph-title { grid-column: 2; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-top:has(#back:not([hidden])) #title { font-size: 18px; margin: 0; color: var(--flow-ink); }
html[data-brand="surveynest"][data-app-design="flow"] .ph-status { grid-column: 2; font: 400 12px/18px var(--font-body); letter-spacing: 0; text-transform: none; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-top :focus-visible { outline-color: var(--flow-ring); }
html[data-brand="surveynest"][data-app-design="flow"] #elements .ph-section { margin-block: 24px; }
html[data-brand="surveynest"][data-app-design="flow"] #elements .ph-section h2 { font-size: 16px; margin-bottom: 12px; }
html[data-brand="surveynest"][data-app-design="flow"] #elements .ph-section .ph-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr)); gap: 10px; border: 0;
}
html[data-brand="surveynest"][data-app-design="flow"] #elements .ph-section .ph-item {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
  gap: 8px; min-width: 0; min-height: 112px; padding: 14px 12px; margin: 0;
  border: 1px solid var(--flow-line); border-radius: 10px; background: var(--flow-paper); color: var(--flow-ink);
  text-align: left; overflow-wrap: anywhere;
}
html[data-brand="surveynest"][data-app-design="flow"] #elements .ph-section .ph-item[hidden] { display: none; }
html[data-brand="surveynest"][data-app-design="flow"] #elements .ph-section .ph-item[aria-current="true"] {
  background: var(--flow-panel); border-color: var(--flow-accent); box-shadow: inset 0 0 0 1px var(--flow-accent);
}
html[data-brand="surveynest"][data-app-design="flow"] #elements .ph-item b { font-size: 15px; font-weight: 600; padding-right: 26px; }
html[data-brand="surveynest"][data-app-design="flow"] #elements .ph-item small { display: block; margin-top: 8px; font-size: 13px; line-height: 1.45; color: var(--flow-muted); }
html[data-brand="surveynest"][data-app-design="flow"] #elements .ph-chip { position: absolute; right: 10px; top: 12px; width: 24px; min-width: 24px; height: 24px; border-radius: 6px; font-size: 11px; }
html[data-brand="surveynest"][data-app-design="flow"] #elements :is(.ph-go, .ph-roof-item::after) { display: none; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-part-search { margin-block: 12px 20px; padding-block: 8px; background: var(--flow-bg); }
html[data-brand="surveynest"][data-app-design="flow"] .ph-part-search input { min-height: 48px; border-radius: 12px; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-counts { font-size: 13px; line-height: 1.5; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-progress { height: 4px; border-radius: 2px; overflow: hidden; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-roof-details { padding: 16px; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-premium-roof-details { border-radius: 16px; background: var(--flow-paper); overflow: hidden; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-premium-roof-details > summary { min-height: 56px; padding: 16px; }
html[data-brand="surveynest"][data-app-design="flow"] #rating { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
html[data-brand="surveynest"][data-app-design="flow"] #rating legend { font-size: 16px; margin-bottom: 12px; }
html[data-brand="surveynest"][data-app-design="flow"] #rating button { min-height: 76px; min-width: 0; padding: 12px; border-radius: 10px; font-size: 15px; text-align: left; line-height: 1.4; }
html[data-brand="surveynest"][data-app-design="flow"] #rating button[aria-pressed="true"] { padding-right: 28px; }
html[data-brand="surveynest"][data-app-design="flow"] #rating button small { font-size: 12px; line-height: 1.4; }
html[data-brand="surveynest"][data-app-design="flow"] #rating .ph-premium-rating-help { grid-column: 1 / -1; }
html[data-brand="surveynest"][data-app-design="flow"] #element .ph-form > label { border: 0; background: transparent; padding: 0; }
html[data-brand="surveynest"][data-app-design="flow"] #element.ph-element-overlay { border-radius: 0; background: var(--flow-bg); padding-inline: max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right)); }
/* The retained sheet stylesheet uses !important for its old pill/zero-radius rules. */
html[data-brand="surveynest"][data-app-design="flow"] .ph-element-overlay button { border-radius: 12px !important; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-element-overlay #rating button { border-radius: 10px !important; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-element-overlay :is(input, textarea, select) { border-radius: 12px !important; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-element-overlay .ph-block { border-radius: 16px !important; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-overlay-heading { min-height: 56px; gap: 12px; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-overlay-heading h2 { font-size: 20px; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-overlay-heading button { width: 48px; height: 48px; border-radius: 12px; }
@media (min-width: 900px) {
  html[data-brand="surveynest"][data-app-design="flow"] #element.ph-element-overlay { inset: 24px max(24px, calc((100vw - 760px)/2)); width: auto; max-height: calc(100dvh - 48px); border-radius: 20px; box-shadow: 0 20px 80px #142c2b33; }
}

/* Plan evidence is a working view, with saved positions and a connected photo inspector. */
html[data-app-design="flow"] .flow-plan-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
html[data-app-design="flow"] .flow-plan-tabs button { flex: 1; min-width: 0; }
html[data-app-design="flow"] .flow-plan-tabs [aria-pressed="true"] { background: var(--flow-accent); color: white; }
html[data-app-design="flow"] .flow-plan-photos { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; min-width: 0; }
html[data-app-design="flow"] #property .ph-form > *,
html[data-app-design="flow"] .flow-photo-inspector,
html[data-app-design="flow"] .flow-photo-inspector :is(label,textarea) { min-width: 0; }
html[data-app-design="flow"] #property :is(input,textarea,select) { min-width: 0; max-width: 100%; }
html[data-app-design="flow"] .flow-photo-map-frame { padding: 24px; border: 1px solid var(--flow-line); border-radius: 16px; background: var(--flow-panel); overflow: hidden; }
html[data-app-design="flow"] .flow-photo-surface { position: relative; min-width: 0; }
html[data-app-design="flow"] .flow-photo-surface > img { display: block; width: 100%; height: auto; }
html[data-app-design="flow"] .flow-photo-surface[data-unavailable] { min-height: 120px; }
html[data-app-design="flow"] .flow-photo-surface[data-unavailable] .flow-map-pin { visibility: hidden; }
html[data-app-design="flow"] .flow-photo-map { position: absolute; inset: 0; }
html[data-brand="surveynest"][data-app-design="flow"] .flow-map-pin {
  position: absolute; width: 48px; height: 48px; min-height: 48px; min-width: 48px; padding: 8px;
  display: grid; place-items: center; transform: translate(-50%, -50%); border: 0; background: transparent;
}
html[data-app-design="flow"] .flow-map-pin span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 2px solid white; background: var(--flow-accent); color: white; font: 600 13px var(--font-body); box-shadow: 0 2px 8px #142c2b44; }
html[data-app-design="flow"] .flow-map-pin[aria-pressed="true"] span { outline: 2px solid var(--flow-ink); outline-offset: 2px; }
html[data-app-design="flow"] .flow-photo-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,200px),1fr)); gap: 8px; }
html[data-app-design="flow"] .flow-photo-row { display: grid; gap: 4px; width: 100%; min-height: 72px; padding: 12px; border: 1px solid var(--flow-line); border-radius: 12px; background: var(--flow-paper); color: var(--flow-ink); text-align: left; font: inherit; overflow-wrap: anywhere; }
html[data-app-design="flow"] .flow-photo-row small { color: var(--flow-muted); }
html[data-app-design="flow"] .flow-photo-row > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html[data-app-design="flow"] .flow-photo-row[aria-pressed="true"] { border-color: var(--flow-accent); background: var(--flow-panel); }
html[data-app-design="flow"] .flow-photo-inspector { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--flow-line); border-radius: 16px; background: var(--flow-paper); }
html[data-app-design="flow"] .flow-photo-inspector > img { width: 100%; max-height: 220px; object-fit: contain; border-radius: 10px; background: var(--flow-panel); }
html[data-app-design="flow"] .flow-photo-inspector :is(h3,p) { margin: 0; }
html[data-app-design="flow"] .flow-photo-inspector textarea { min-height: 48px; border-radius: 12px; }
html[data-app-design="flow"] .flow-photo-pin-actions { display: grid; gap: 8px; }
html[data-brand="surveynest"][data-app-design="flow"] .photo-plan-premium { padding: max(8px,env(safe-area-inset-top)) 18px max(20px,env(safe-area-inset-bottom)); background: var(--flow-bg); }
html[data-brand="surveynest"][data-app-design="flow"] .photo-plan-premium .ph-overlay-header { background: var(--flow-bg); }
html[data-brand="surveynest"][data-app-design="flow"] .photo-plan-premium .ph-overlay-heading { justify-content: space-between; }
html[data-brand="surveynest"][data-app-design="flow"] .photo-plan-premium .ph-overlay-heading button { position: static; width: auto; min-width: 64px; }
html[data-brand="surveynest"][data-app-design="flow"] .photo-plan-premium .ph-form { min-height: 0; gap: 16px; }
html[data-brand="surveynest"][data-app-design="flow"] .photo-plan-premium .photo-plan-surface { width: calc(100% - 64px); margin: 32px; }
html[data-brand="surveynest"][data-app-design="flow"] .photo-plan-premium .photo-plan-actions { background: var(--flow-bg); }
html[data-brand="surveynest"][data-app-design="flow"] :is(.photo-plan-hint, .photo-plan-empty, .ph-premium-defect-row, .ph-premium-priorities span) { border-radius: 12px; }
html[data-app-design="flow"] :is(.ph-burst, .ph-photo-review) { background: var(--flow-bg); color: var(--flow-ink); }
html[data-app-design="flow"] .ph-photo-review .ph-photo-review-actions { background: var(--flow-bg); }
html[data-app-design="flow"] :is(.ph-burst, .ph-photo-review) .ph-secondary { background: var(--flow-panel); color: var(--flow-ink); border-color: var(--flow-line); }
html[data-app-design="flow"] .ph-burst .ph-primary { background: var(--flow-accent); color: #fff; }
html[data-app-design="flow"] .ph-premium-priorities label span { color: var(--flow-ink); background: var(--flow-paper); }
html[data-app-design="flow"] .ph-premium-priorities input:checked + span { background: var(--flow-panel); }
html[data-app-design="flow"] .ph-premium-priorities input:checked + span::after { content: "✓"; margin-left: auto; font-weight: 700; }
html[data-app-design="flow"] .ph-premium-priorities { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }
html[data-app-design="flow"] .ph-premium-priorities input:checked + span::after { display: block; flex: none; }
html[data-app-design="flow"] .ph-premium-priorities label,
html[data-app-design="flow"] .ph-premium-priorities label span,
html[data-app-design="flow"] .ph-premium-priorities label small { min-width: 0; }
html[data-app-design="flow"] .ph-premium-priorities label small { overflow-wrap: anywhere; }
html[data-brand="surveynest"][data-app-design="flow"] :is(.ph-burst, .ph-photo-review, .ph-premium-photo-detail) button { border-radius: 12px; min-height: 48px; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-premium-photo-detail { width: min(680px,calc(100% - 24px)); max-height: calc(100dvh - 24px); border-radius: 20px; background: var(--flow-bg); }
html[data-brand="surveynest"][data-app-design="flow"] .ph-premium-photo-detail > img { max-height: 40dvh; width: 100%; object-fit: contain; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-premium-priorities span { min-height: 72px; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-premium-defect-row summary { min-height: 64px; }
@media (min-width: 700px) {
  html[data-app-design="flow"] .flow-plan-photos { grid-template-columns: minmax(0,1.2fr) minmax(240px,1fr); align-items: start; }
  html[data-app-design="flow"] .flow-plan-photos > :is(h2,p,label) { grid-column: 1 / -1; }
  html[data-app-design="flow"] .flow-photo-map-frame, html[data-app-design="flow"] .flow-photo-list { grid-column: 1; }
  html[data-app-design="flow"] .flow-photo-inspector { grid-column: 2; grid-row: 3 / span 5; }
}

/* Inline native dictation. The provisional layer never changes a draft's stored value. */
html[data-brand="surveynest"][data-app-design="flow"] .ph-flow-voice-field {
  display: block; position: relative; min-width: 0; width: 100%;
}
html[data-brand="surveynest"][data-app-design="flow"] .ph-form .ph-flow-voice-field :is(input, textarea)[data-dictation] {
  display: block; box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%;
  min-height: 60px; margin: 0; padding-right: 66px;
}
/* #1230 (iPhone walk 2, item 12): every box with the microphone keeps room for it (the progress report editor's boxes are not in a
   .ph-form, so their words ran under the button) */
html[data-brand="surveynest"][data-app-design="flow"] .ph-flow-voice-field :is(input, textarea)[data-dictation] { padding-right: 66px; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-flow-voice-field .ph-mic {
  position: absolute; right: 6px; bottom: 6px; z-index: 2;
  display: grid; place-items: center; width: 48px; height: 48px;
  min-width: 48px; min-height: 48px; padding: 0; margin: 0;
  background: var(--flow-panel); color: var(--flow-accent); border: 0; border-radius: 10px;
}
html[data-brand="surveynest"][data-app-design="flow"] .ph-flow-voice-field .ph-mic.listening { background: var(--flow-accent); color: white; }
html[data-app-design="flow"] .ph-flow-voice-field .ph-mic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[data-app-design="flow"] .ph-flow-voice-field .ph-mic[data-flow-voice="stop"] svg { fill: currentColor; stroke: none; }
html[data-app-design="flow"] .ph-flow-voice-preview {
  position: absolute; box-sizing: border-box; border-style: solid; border-color: transparent;
  pointer-events: none; overflow: hidden; overflow-wrap: break-word; color: var(--flow-ink);
}
html[data-brand="surveynest"][data-app-design="flow"] .ph-form .ph-flow-voice-field.has-partial :is(input, textarea)[data-dictation] { color: transparent; caret-color: transparent; }
html[data-app-design="flow"] .ph-flow-voice-field.has-partial :is(input, textarea)::placeholder { color: transparent; }
html[data-app-design="flow"] .ph-flow-voice-partial { text-decoration: underline dotted var(--flow-accent); text-underline-offset: 4px; }
html[data-app-design="flow"] .ph-flow-voice-status { display: block; margin-top: 6px; font-size: .875rem; font-weight: 400; color: var(--flow-muted); }
html[data-app-design="flow"] .ph-flow-voice-heard { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html[data-app-design="flow"] .ph-flow-voice-preview[hidden], html[data-app-design="flow"] .ph-flow-voice-status[hidden] { display: none; }

/* Survey navigation and the same existing property/measurement fields in focused groups. */
html[data-brand="surveynest"][data-app-design="flow"] .ph-sticky .ph-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 6px max(18px,env(safe-area-inset-right)) 12px max(18px,env(safe-area-inset-left));
  background: var(--flow-bg); border-bottom: 1px solid var(--flow-line);
}
html[data-brand="surveynest"][data-app-design="flow"] .ph-sticky .ph-tabs button {
  flex: 1 1 0; min-width: 48px; min-height: 48px; padding: 9px 5px; border: 1px solid transparent;
  border-radius: 10px; color: var(--flow-muted); background: transparent; font-size: .875rem;
  line-height: 1.3; white-space: normal; overflow-wrap: anywhere; box-shadow: none;
}
html[data-brand="surveynest"][data-app-design="flow"] .ph-sticky .ph-tabs button[aria-current="true"] { background: var(--flow-accent); color: white; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-sticky .ph-tabs button:focus-visible { outline-color: var(--flow-ring); }
html[data-brand="surveynest"][data-app-design="flow"] .ph-roof-subtabs { gap: 8px; padding: 6px; background: var(--flow-panel); border-radius: 12px; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-roof-subtabs button { min-height: 48px; border-radius: 10px; }
html[data-brand="surveynest"][data-app-design="flow"] .flow-screen-title { margin: 0; font-size: 1.75rem; line-height: 1.2; letter-spacing: -.035em; }
html[data-app-design="flow"] .flow-property-layout, html[data-app-design="flow"] .flow-moisture-layout { display: grid; gap: 20px; min-width: 0; align-items: start; }
html[data-app-design="flow"] :is(.flow-property-essential,.flow-property-photo,.flow-moisture-entry) { min-width: 0; }
html[data-brand="surveynest"][data-app-design="flow"] .flow-property-essential h2 { margin: 0; font-size: 1.125rem; }
html[data-brand="surveynest"][data-app-design="flow"] #property .flow-property-more > summary { min-height: 48px; cursor: pointer; font-weight: 600; padding: 12px 0; }
html[data-app-design="flow"] .flow-property-more[open] > .ph-form { margin-top: 12px; }
html[data-brand="surveynest"][data-app-design="flow"] .flow-property-photo .ph-property-cover { margin: 0; }
html[data-app-design="flow"] .flow-property-photo .ph-cover img { max-height: 300px; width: 100%; object-fit: cover; border-radius: 12px; }
html[data-brand="surveynest"][data-app-design="flow"] #moisture .ph-moisture-totals { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
html[data-brand="surveynest"][data-app-design="flow"] #moisture .ph-moisture-totals > div { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--flow-line); border-inline-start-width: 3px; }
html[data-app-design="flow"] #moisture .ph-moisture-totals strong { font-size: 1.375rem; }
html[data-app-design="flow"] #moisture .ph-moisture-totals :is(strong,span) { display: block; overflow-wrap: anywhere; }
html[data-brand="surveynest"][data-app-design="flow"] #moisture .ph-moisture-meter > summary { display: flex; justify-content: space-between; min-height: 48px; gap: 16px; padding: 12px; border-radius: 12px; background: var(--flow-paper); }
html[data-brand="surveynest"][data-app-design="flow"] #moisture .ph-moisture-entry > summary { min-height: 48px; border-radius: 12px; margin-top: 12px; }
html[data-brand="surveynest"][data-app-design="flow"] #moisture .ph-moisture-entry[open] > summary { display: flex; align-items: center; background: var(--flow-panel); color: var(--flow-ink); justify-content: start; padding-inline: 16px; }
html[data-brand="surveynest"][data-app-design="flow"] #moisture .ph-moisture-readings .ph-premium-row { display: grid; gap: 12px; margin-bottom: 10px; border-radius: 16px; }
html[data-brand="surveynest"][data-app-design="flow"] .ph-moisture-reading-content { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; }
html[data-app-design="flow"] .ph-moisture-result { width: fit-content; max-width: 100%; border-radius: 6px; }
html[data-brand="surveynest"][data-app-design="flow"] #moisture .ph-moisture-readings button { min-height: 48px; border-radius: 12px; justify-self: start; }
html[data-app-design="flow"] :is(.flow-measured-card,.flow-core-card) { min-width: 0; }
html[data-app-design="flow"] .flow-measure-field { min-width: 0; }
html[data-brand="surveynest"][data-app-design="flow"] :is(#photo-lost,#photo-recovery,#sync-conflict) { border: 1px solid var(--flow-line); border-inline-start: 4px solid var(--flow-danger); border-radius: 12px; padding: 16px; background: var(--flow-paper); overflow-wrap: anywhere; }
html[data-app-design="flow"] #sync-conflict h2 { font-size: 1.125rem; margin-top: 0; }
/* #846: a refused send is calm, not an alarm: the survey is safe and editable */
html[data-brand="surveynest"][data-app-design="flow"] #send-refused { border: 1px solid var(--flow-line); border-inline-start: 4px solid var(--flow-accent); border-radius: 12px; padding: 16px; background: var(--flow-paper); color: var(--flow-ink); overflow-wrap: anywhere; }
html[data-brand="surveynest"][data-app-design="flow"] #send-refused button { border-radius: 999px; min-height: 48px; }
@media(min-width:700px) {
 html[data-app-design="flow"] .flow-property-essential { grid-template-columns: repeat(2,minmax(0,1fr)); }
 html[data-app-design="flow"] .flow-property-essential > :is(h2,.ph-property-address) { grid-column: 1/-1; }
 html[data-app-design="flow"] .flow-property-more > .ph-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
 html[data-app-design="flow"] .flow-property-more #inspection-type { grid-column: 1/-1; }
 html[data-brand="surveynest"][data-app-design="flow"] #moisture .ph-moisture-totals { grid-template-columns: repeat(4,minmax(0,1fr)); }
 html[data-app-design="flow"] :is(.flow-measured-card,.flow-core-card) { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
 html[data-app-design="flow"] :is(.flow-measured-card,.flow-core-card) > * { grid-column: 1/-1; }
 html[data-app-design="flow"] :is(.flow-measured-card,.flow-core-card) > .flow-measure-field { grid-column: auto; }
}
@media(min-width:1000px) {
 html[data-brand="surveynest"][data-app-design="flow"]:is([data-phone-screen="property"],[data-phone-screen="moisture"]) .ph-main { max-width: 1120px; }
 html[data-app-design="flow"] .flow-property-layout { grid-template-columns: minmax(0,1.5fr) minmax(260px,1fr); }
 html[data-app-design="flow"] .flow-moisture-layout { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
}

html[data-brand="surveynest"][data-app-design="flow"] #property #inspection-type button { min-height:48px; border-radius:12px; }

html[data-brand="surveynest"][data-app-design="flow"] #elements :is(.flow-measured-card,.flow-core-card) :is(button,summary,input,select,textarea) { min-height:48px; }
html[data-brand="surveynest"][data-app-design="flow"] #elements :is(.flow-measured-card,.flow-core-card) button { min-width:48px; }


/* Flow report editing and progress. Existing wording, checks, generation and exports stay intact. */
html[data-brand="surveynest"][data-app-design="flow"] #report .ph-form { gap:16px; padding-bottom:24px; }
html[data-app-design="flow"] .flow-report-layout { display:grid; gap:24px; min-width:0; align-items:start; }
html[data-app-design="flow"] .flow-report-editor { display:grid; gap:12px; min-width:0; }
html[data-app-design="flow"] .flow-report-finish { display:flex; flex-direction:column; gap:12px; padding:20px; border:1px solid var(--flow-line); border-radius:var(--flow-surface); background:var(--flow-paper); min-width:0; }
html[data-app-design="flow"] .flow-report-finish h2 { margin:0 0 4px; font-size:1.125rem; }
html[data-app-design="flow"] .flow-report-finish > * { margin-block:0; min-width:0; }
html[data-brand="surveynest"][data-app-design="flow"] #report :is(.ph-report-section,.ph-report-limits) { display:block; order:initial; margin:0; padding:0 16px; border:1px solid var(--flow-line); border-radius:var(--flow-surface); background:var(--flow-paper); min-width:0; }
html[data-app-design="flow"] #report :is(.ph-report-condition,.ph-report-recs)::before { content:none; }
html[data-brand="surveynest"][data-app-design="flow"] #report :is(.ph-report-section,.ph-report-limits) > summary { display:block; min-height:56px; padding:16px 24px 16px 0; font-weight:600; position:relative; cursor:pointer; list-style:none; overflow-wrap:anywhere; }
html[data-app-design="flow"] #report summary::-webkit-details-marker { display:none; }
html[data-app-design="flow"] #report :is(.ph-report-section,.ph-report-limits) > summary::after { content:'+'; position:absolute; right:0; top:16px; font-size:1.125rem; line-height:1.4; color:var(--flow-muted); }
html[data-app-design="flow"] #report :is(.ph-report-section,.ph-report-limits)[open] > summary::after { content:'−'; }
html[data-app-design="flow"] #report :is(.ph-report-section,.ph-report-limits)[open] { padding-bottom:16px; }
html[data-app-design="flow"] #report .ph-report-value { display:block; color:var(--flow-muted); font-size:.875rem; line-height:1.4; font-weight:400; white-space:normal; overflow-wrap:anywhere; max-height:2.8em; overflow:hidden; }
html[data-app-design="flow"] #report details[open] > summary .ph-report-value { display:none; }
html[data-brand="surveynest"][data-app-design="flow"] #report :is(#full-report,#copy-text) { min-height:48px; padding:12px; margin:0; border:1px solid var(--flow-line); border-radius:var(--flow-control); background:var(--flow-paper); color:var(--flow-accent); text-align:left; white-space:normal; }
html[data-brand="surveynest"][data-app-design="flow"] #report #send-btn { position:static; margin:4px 0 0; min-height:48px; border-radius:var(--flow-control); }
html[data-brand="surveynest"][data-app-design="flow"] #report .ph-grade { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
html[data-brand="surveynest"][data-app-design="flow"] #report .ph-grade button { min-height:48px; min-width:0; border-radius:10px; white-space:normal; text-align:left; }
html[data-app-design="flow"] #report .ph-grade small { line-height:1.35; }
html[data-app-design="flow"] #report :is(#consistency-review,#report-inspection-warning,#send-error) { padding:12px; border:1px solid var(--flow-danger); border-radius:12px; background:#fff7f5; }
html[data-app-design="flow"] #report .ph-recs { min-width:0; }
html[data-app-design="flow"] #report .ph-recs :is(button,input,select) { min-height:48px; }
html[data-app-design="flow"] :is(#consent,#updated-terms,#text-checks) { max-width:680px; margin-inline:auto; }
html[data-app-design="flow"] :is(#consent,#updated-terms,#text-checks) :is(.ph-primary,.ph-secondary) { min-height:48px; margin-block:12px; width:100%; }
html[data-app-design="flow"] :is(#consent,#updated-terms,#text-checks) p { line-height:1.6; }
html[data-app-design="flow"] #view { max-width:760px; margin-inline:auto; }
html[data-brand="surveynest"][data-app-design="flow"] #view-title { font-size:clamp(1.5rem,3vw,2rem); line-height:1.2; margin:4px 0 16px; }
html[data-app-design="flow"] #view-premium-status:not([hidden]) { display:inline-block; padding:6px 10px; margin:0 0 12px; border-radius:8px; background:var(--flow-panel); color:var(--flow-accent); font-size:.875rem; font-weight:600; }
html[data-brand="surveynest"][data-app-design="flow"] #view-premium-cover:not([hidden]) { display:grid; grid-template-columns:32px 1fr; gap:4px 12px; align-items:center; width:100%; min-height:0; margin:20px 0; padding:20px; border:1px solid var(--flow-line); border-radius:var(--flow-surface); background:var(--flow-paper); color:var(--flow-ink); box-shadow:none; }
html[data-app-design="flow"] #view-premium-cover .ph-cover-mark { width:28px; height:28px; padding:4px; border-radius:8px; background:var(--flow-accent); grid-row:span 2; }
html[data-app-design="flow"] #view-premium-cover .ph-cover-line { display:none; }
html[data-app-design="flow"] #view-premium-cover strong { margin:0; font-size:1rem; }
html[data-app-design="flow"] #view-premium-cover-title { grid-column:2; font-size:.875rem; color:var(--flow-muted); }
html[data-brand="surveynest"][data-app-design="flow"] #view > :is(button,a), html[data-brand="surveynest"][data-app-design="flow"] #view-premium-help a { width:100%; min-height:48px; margin-block:8px; border-radius:var(--flow-control); white-space:normal; }
html[data-brand="surveynest"][data-app-design="flow"] #view:is([data-report-state="ready"],[data-report-state="attention"]):not([hidden]) { display:block; min-height:0; }
html[data-brand="surveynest"][data-app-design="flow"] #view #view-link:not([hidden]) { position:static; margin-top:12px; }
html[data-app-design="flow"] #view[data-report-state="attention"] #view-text { padding:16px; border-left:3px solid var(--flow-danger); background:#fff7f5; border-radius:0 12px 12px 0; }
@media(min-width:1000px) {
 html[data-app-design="flow"][data-phone-screen="report"] .ph-main { max-width:1120px; }
 html[data-app-design="flow"] .flow-report-layout { grid-template-columns:minmax(0,1.4fr) minmax(320px,1fr); }
}
@media(max-width:360px) {
 html[data-app-design="flow"] .flow-report-finish { padding:14px; }
 html[data-brand="surveynest"][data-app-design="flow"] #report .ph-grade { grid-template-columns:1fr; }
}
