/* Shared Models work surface. app.js adds this marker only around a project
   workspace that uses the compact task frame; all other Control pages retain
   their existing layout. */
.project-tab-content[data-models-presentation] { gap: 8px; }
.project-tab-content[data-models-presentation] > .models-project-workspace-nav {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 2px 8px;
  gap: 12px;
  box-shadow: none;
  background: var(--surface-raised);
}
.project-tab-content[data-models-presentation] .models-project-task-title {
  flex: 1;
  margin: 0;
  color: var(--heading);
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: normal;
  text-transform: none;
}
.project-tab-content[data-models-presentation] [data-models-project-reference] {
  flex: 0 0 auto; order: 4; white-space: nowrap; color: var(--muted); font-size: 12px;
}
.project-tab-content[data-models-presentation] .models-task-menu { position: relative; order: 5; margin-left: auto; }
.project-tab-content[data-models-presentation] > .models-project-workspace-nav:has(> .models-project-return) {
  flex-wrap: wrap;
  gap: 6px 12px;
}
.project-tab-content[data-models-presentation] > .models-project-workspace-nav > .models-project-return {
  flex: none;
  margin: 0;
}
.project-tab-content[data-models-presentation] .models-project-return > .act {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
  font-weight: 650;
}
.project-tab-content[data-models-presentation] .models-project-return > .act:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.project-tab-content[data-models-presentation] .models-task-menu > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}
.project-tab-content[data-models-presentation] .models-task-menu > summary::after { content: '⌄'; }
.project-tab-content[data-models-presentation] .models-task-menu[open] > summary::after { content: '⌃'; }
.project-tab-content[data-models-presentation] .models-task-menu > div {
  position: absolute;
  right: 0;
  z-index: 13;
  display: grid;
  min-width: 250px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: 0 4px 12px var(--shadow);
}
.project-tab-content[data-models-presentation] .models-task-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
}
.project-tab-content[data-models-presentation] .models-task-menu a[aria-current="page"] {
  border-color: var(--focus);
  color: var(--on-action,#fff);
  background: var(--action);
  font-weight: 700;
}
.project-tab-content[data-models-presentation] .models-task-menu > summary:focus-visible,
.project-tab-content[data-models-presentation] .models-task-menu a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.project-header.models-project-context[data-models-project-context] {
  position: relative;
  z-index: 15;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 8px 12px;
}
.project-header.models-project-context[data-models-project-context] .models-project-context-row {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}
.project-header.models-project-context[data-models-project-context] .models-project-context-identity {
  flex: 1;
  min-width: 0;
}
.project-header.models-project-context[data-models-project-context] .models-project-context-identity > h1 {
  margin: 0;
  overflow: hidden;
  color: var(--heading);
  font-size: 18px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-header.models-project-context[data-models-project-context] .models-project-context-identity > span {
  color: var(--muted);
  font-size: 12px;
}
.project-header.models-project-context[data-models-project-context] .models-project-context-row > .act,
.project-header.models-project-context[data-models-project-context] .models-project-context-row > details { flex: none; }
.project-header.models-project-context[data-models-project-context] .models-project-context-row details { position: relative; }
.project-header.models-project-context[data-models-project-context] .models-project-context-row details > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  cursor: pointer;
}
.project-header.models-project-context[data-models-project-context] .models-project-context-row details[open] > :not(summary) {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  z-index: 14;
  min-width: 240px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: 0 4px 12px var(--shadow);
}
.project-header.models-project-context[data-models-project-context] .models-project-context-row .project-tabs {
  display: grid;
  gap: 4px;
}
.project-header.models-project-context[data-models-project-context] .models-project-context-row .project-tabs a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 8px;
}
.project-header.models-project-context[data-models-project-context] .models-project-context-row :is(details > summary, .project-tabs a):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.project-tab-content[data-models-presentation] > .portal-panel { padding: 12px 16px; gap: 8px; }
.project-tab-content[data-models-presentation] > .portal-panel :is(button, .act, [role="button"]) { min-height: 44px; }
.project-tab-content[data-models-presentation] > .portal-panel > .verb-back > .act {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}
.project-tab-content[data-models-presentation] :is(.models-task-guidance, .models-usage-guidance, .models-weather-guidance) > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
}
.project-tab-content[data-models-presentation] :is(.models-task-guidance, .models-usage-guidance, .models-weather-guidance, .lidar-report-reading > details:not(.roof-printable-report)) > summary::after {
  content: '⌄';
  margin-left: auto;
}
.project-tab-content[data-models-presentation] :is(.models-task-guidance, .models-usage-guidance, .models-weather-guidance, .lidar-report-reading > details:not(.roof-printable-report))[open] > summary::after { content: '⌃'; }
.project-tab-content[data-models-presentation] :is(.roof-source-chooser > details, .roof-source-saved details) > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
}
.project-tab-content[data-models-presentation] :is(.roof-source-chooser, .roof-source-saved) button,
.project-tab-content[data-models-presentation] .roof-source-chooser .act { min-height: 44px; }

/* Models Home is a task chooser; retain the ordinary progress renderer and
   domain forms. Only the guide inside the shared project frame is composed. */
.project-tab-content[data-models-presentation] [data-models-home-guide] { gap: 8px; }
.project-tab-content[data-models-presentation] [data-models-home-guide] .models-journey-route {
  gap: 8px;
  padding: 12px;
}
.project-tab-content[data-models-presentation] [data-models-home-guide] > details {
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.project-tab-content[data-models-presentation] [data-models-home-guide] > details > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-weight: 650;
}
.project-tab-content[data-models-presentation] [data-models-home-guide] > details > summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.project-tab-content[data-models-presentation] [data-models-home-guide] > details > summary::after {
  content: '⌄';
  margin-left: auto;
}
.project-tab-content[data-models-presentation] [data-models-home-guide] > details[open] > summary::after { content: '⌃'; }
.project-tab-content[data-models-presentation] [data-models-home-guide] .models-journey-advanced-link { margin: 0; }

/* Home keeps unfinished Usage inputs and their review in its own disclosure.
   Promote that active task while open; its original Back parks it and restores the
   chooser without replacing any fields or changing the navigation guard. */
.project-tab-content[data-models-presentation]:has([data-models-current-step][open] :is(#usage-data-form,[data-usage-back])) > [data-models-journey],
.project-tab-content[data-models-presentation] [data-models-current-step][open]:has(#usage-data-form,[data-usage-back]) > :is(summary, h2) { display: none; }
.project-tab-content[data-models-presentation] [data-models-current-step][open]:has(#usage-data-form,[data-usage-back]) > p { margin: 4px 0 8px; }

/* Keep the actual inputs, unfinished-work warning and postcode privacy notice
   in normal document flow. These overrides change spacing, never disclosure. */
.project-tab-content[data-models-presentation] #usage-data-form > p { margin: 0 0 8px; }
.project-tab-content[data-models-presentation] #usage-data-form > h3 { margin: 8px 0 4px; }
.project-tab-content[data-models-presentation] #usage-data-form > .row { margin: 0; }
.project-tab-content[data-models-presentation] #usage-data-form > .row > .field { margin: 4px 0 8px; }
.project-tab-content[data-models-presentation] #usage-data-form .field input:not([type="checkbox"]):not([type="radio"]),
.project-tab-content[data-models-presentation] #usage-data-form .field select { min-height: 44px; }
.project-tab-content[data-models-presentation] .weather-gather-card { padding: 8px 12px; }
.project-tab-content[data-models-presentation] .weather-gather-card > h3 { margin: 0 0 6px; }
.project-tab-content[data-models-presentation] .weather-gather-card > .import-review { margin: 0 0 6px; gap: 6px; }
.project-tab-content[data-models-presentation] .weather-gather-card > .import-review > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 4px 8px;
}
.project-tab-content[data-models-presentation] .weather-gather-card > .import-review > div > dd { margin: 0; }
.project-tab-content[data-models-presentation] .weather-gather-card > .notice { margin: 6px 0 8px; }
.project-tab-content[data-models-presentation] .weather-gather-card > button { min-height: 44px; }

/* Loaded after the shared sheets. The remaining rules are confined to the
   validated embedded presentation and preserve unrelated Control pages. */
/* Hosted office Models has its own project context. Reclaim shell spacing
   here, without applying another shell inside the validated native host.
   The access sentence and facts stay visible and all navigation remains 44px. */
@media (min-width: 900px) {
  html:not([data-desktop-models-host="true"]):has([data-models-project-context]) .topbar {
    min-height: 56px;
    padding: 5px 16px;
    gap: 6px 12px;
  }
  html:not([data-desktop-models-host="true"]):has([data-models-project-context]) .topbar .wordmark {
    flex: none;
    font-size: 13px;
    letter-spacing: 1px;
  }
  html:not([data-desktop-models-host="true"]):has([data-models-project-context]) .topbar .omni {
    flex: 1 1 200px;
    min-width: 200px;
    margin-inline: 0;
  }
  html:not([data-desktop-models-host="true"]):has([data-models-project-context]) .topbar .who {
    flex: none;
    max-width: 100%;
    flex-wrap: wrap;
  }
  html:not([data-desktop-models-host="true"]):has([data-models-project-context]) .topbar :is(button, input) {
    min-height: 44px;
  }
  html:not([data-desktop-models-host="true"]):has([data-models-project-context]) .portal-switcher {
    padding-top: 0;
    padding-bottom: 0;
  }
  html:not([data-desktop-models-host="true"]):has([data-models-project-context]) .access-bar {
    padding-top: 0;
    padding-bottom: 0;
  }
  html:not([data-desktop-models-host="true"]):has([data-models-project-context]) #banner-extra {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    min-width: 0;
  }
  html:not([data-desktop-models-host="true"]):has([data-models-project-context]) #how-toggle {
    min-height: 44px;
  }
  html:not([data-desktop-models-host="true"]):has([data-models-project-context]) section#pane {
    padding-top: 8px;
    --pane-pad-top: 8px;
  }
  html:not([data-desktop-models-host="true"]) .project-header.models-project-context[data-models-project-context] {
    padding-top: 2px;
    padding-bottom: 2px;
  }
  html:not([data-desktop-models-host="true"]) .models-project-context-row > .act {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: var(--surface);
    text-decoration: none;
    font-weight: 650;
  }
  html:not([data-desktop-models-host="true"]) .models-project-context-row > .act:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
  }
  html:not([data-desktop-models-host="true"]) .project-tab-content[data-models-presentation] > .models-project-workspace-nav {
    min-height: 44px;
    padding-top: 0;
    padding-bottom: 0;
  }
}
html[data-desktop-models-host="true"] section#pane {
  padding: 8px 16px 24px;
  --pane-pad-top: 8px;
}
/* Reports and separate hot-water work have their own heading and return.
   The building-progress rail belongs to the hidden building draft; restore
   it automatically when that draft is shown again. */
.project-tab-content[data-models-presentation] [data-models-editor-compact="heat"]:has([data-heat-report-shelf-panel]:not([hidden]), [data-annual-hot-water-panel]:not([hidden])) :is([data-heat-step-title], .heat-step-rail) {
  display: none;
}
.project-tab-content[data-models-presentation] [data-models-editor-compact="heat"]:has([data-heat-report-shelf-panel]:not([hidden]), [data-annual-hot-water-panel]:not([hidden])) .models-heat-editor-toolbar {
  grid-template-columns: minmax(0, 1fr);
}
.project-tab-content[data-models-presentation] [data-heat-back] {
  min-width: 44px;
}
/* An opened annual report supplies its own source summary, limitations and
   return. The list introductions return with the actual shelf, rather than
   occupying another three heading rows above the current result. */
.project-tab-content[data-models-presentation] [data-models-results][open]:has(.lidar-report-reading) > :is(summary, p),
.project-tab-content[data-models-presentation] [data-models-roof-reports][open]:has(.lidar-report-reading) > summary,
.project-tab-content[data-models-presentation] .roof-source-chooser:has(> .lidar-report-reading) > :is(h3, .roof-shelf-heading, p:not([role="status"])) {
  display: none;
}
html[data-desktop-models-host="true"] .project-tab-content { gap: 8px; }
html[data-desktop-models-host="true"] .models-project-workspace-nav {
  position: sticky;
  top: -8px;
  z-index: 12;
  min-height: 44px;
  padding: 0 8px;
  gap: 12px;
  box-shadow: none;
  background: var(--surface-raised);
}
html[data-desktop-models-host="true"] [data-models-task-label] {
  flex: 1;
  font-weight: 650;
}
html[data-desktop-models-host="true"] .models-task-menu { position: relative; margin-left: auto; }
html[data-desktop-models-host="true"] .models-task-menu > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}
html[data-desktop-models-host="true"] .models-task-menu > summary::after { content: '⌄'; }
html[data-desktop-models-host="true"] .models-task-menu[open] > summary::after { content: '⌃'; }
html[data-desktop-models-host="true"] .models-task-menu > div {
  position: absolute;
  right: 0;
  z-index: 13;
  display: grid;
  min-width: 230px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: 0 4px 12px var(--shadow);
}
html[data-desktop-models-host="true"] .models-project-workspace-nav a { min-height: 44px; }
html[data-desktop-models-host="true"] .models-task-menu > summary:focus-visible,
html[data-desktop-models-host="true"] .roof-source-chooser > details > summary:focus-visible,
html[data-desktop-models-host="true"] .roof-source-saved summary:focus-visible,
html[data-desktop-models-host="true"] .roof-printable-report > summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
html[data-desktop-models-host="true"] .portal-panel { padding: 12px 16px; gap: 8px; }
html[data-desktop-models-host="true"] .project-tab-content:has(> .models-project-workspace-nav [data-models-task-label]) .geometry-studio > h2,
html[data-desktop-models-host="true"] .project-tab-content:has(> .models-project-workspace-nav [data-models-task-label]) .geometry-studio > [data-models-solar-next] { display: none; }
html[data-desktop-models-host="true"] .portal-panel .act,
html[data-desktop-models-host="true"] .models-usage-guidance > summary,
html[data-desktop-models-host="true"] .models-weather-guidance > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
html[data-desktop-models-host="true"] #usage-data-form [data-usage-home] {
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
html[data-desktop-models-host="true"] #usage-data-form [data-usage-home]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
html[data-desktop-models-host="true"] .roof-source-chooser { margin-top: 8px; }
html[data-desktop-models-host="true"] .roof-source-chooser > h3 { margin: 0 0 8px; }
html[data-desktop-models-host="true"] .roof-source-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 12px;
}
html[data-desktop-models-host="true"] .roof-source-cards .roof-source-card { padding: 12px; gap: 8px; }
html[data-desktop-models-host="true"] .roof-source-chooser button,
html[data-desktop-models-host="true"] .roof-source-chooser .act,
html[data-desktop-models-host="true"] .heat-editor button,
html[data-desktop-models-host="true"] .heat-start-card,
html[data-desktop-models-host="true"] .roof-source-chooser > details > summary,
html[data-desktop-models-host="true"] .roof-source-saved summary,
html[data-desktop-models-host="true"] .roof-printable-report > summary {
  min-height: 44px;
}
html[data-desktop-models-host="true"] .roof-source-saved { padding: 8px 12px; gap: 8px; }
html[data-desktop-models-host="true"] .roof-source-saved > h4 { flex-basis: auto; }
html[data-desktop-models-host="true"] .roof-source-saved details { flex-basis: 100%; }
html[data-desktop-models-host="true"] .roof-source-saved summary,
html[data-desktop-models-host="true"] .roof-source-chooser > details > summary,
html[data-desktop-models-host="true"] .roof-printable-report > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 650;
}
html[data-desktop-models-host="true"] .roof-source-saved summary::before,
html[data-desktop-models-host="true"] .roof-source-chooser > details > summary::before,
html[data-desktop-models-host="true"] .roof-printable-report > summary::before { content: '▸'; }
html[data-desktop-models-host="true"] .roof-source-saved details[open] > summary::before,
html[data-desktop-models-host="true"] .roof-source-chooser > details[open] > summary::before,
html[data-desktop-models-host="true"] .roof-printable-report[open] > summary::before { content: '▾'; }
html[data-desktop-models-host="true"] .roof-result-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
html[data-desktop-models-host="true"] .roof-result-heading h4 { margin: 0; }
html[data-desktop-models-host="true"] .roof-printable-report { border-top: 1px solid var(--line); }
html[data-desktop-models-host="true"] .roof-printable-report .roof-run-report-grid { margin-top: 8px; }
html[data-desktop-models-host="true"] .roof-shelf-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
html[data-desktop-models-host="true"] .roof-shelf-heading h3 { margin: 0; }
html[data-desktop-models-host="true"] .roof-shelf-heading > button,
html[data-desktop-models-host="true"] .roof-source-chooser [data-saved-report-search] {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--ink);
  font: inherit;
  padding: 8px 12px;
}
html[data-desktop-models-host="true"] .roof-source-chooser [data-saved-report-search] {
  display: block;
  box-sizing: border-box;
  width: min(100%, 34rem);
}
html[data-desktop-models-host="true"] .roof-source-chooser [data-saved-report-search]:focus-visible,
html[data-desktop-models-host="true"] .roof-shelf-heading > button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
html[data-desktop-models-host="true"] .roof-source-chooser .roof-source-card label {
  display: grid;
  gap: 6px;
}
html[data-desktop-models-host="true"] .heat-editor-heading { margin-bottom: 8px; }
html[data-desktop-models-host="true"] .heat-start-routes { gap: 8px; }
/* A view supplies the active header before it adopts the project menu.
   The original navigation and links remain intact inside that owner. */
[data-models-presentation] .models-owned-task-header {
  display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px;
  min-height:44px;margin:0;padding:0;position:sticky;top:0;z-index:12;
  background:var(--surface);isolation:isolate;
}
[data-models-presentation] .models-owned-task-header .models-composed-navigation {
  display:contents;position:static;padding:0;margin:0;min-height:0;
}
[data-models-presentation] .models-owned-task-header [data-models-task-label] {
  flex:0 0 auto;order:1;margin:0;font-size:16px;line-height:1.3;
}
[data-models-presentation] .models-owned-task-header:has(> h2, > h3, > h4, .heat-editor-heading h3) [data-models-task-label]::after {content:" ·";}
[data-models-presentation] .models-owned-task-header .models-task-menu {order:5;margin-left:auto;position:relative;}
[data-models-presentation] .models-owned-task-header .models-project-return {order:0;margin:0;}
[data-models-presentation] .models-task-menu .models-project-return {display:block;margin:0;border-bottom:1px solid var(--line);}
[data-models-presentation] .models-task-menu .models-project-return > a {display:flex;align-items:center;min-height:44px;white-space:normal;}
[data-models-presentation] .models-owned-task-header :is(button,.act,summary) {min-height:44px;}
[data-models-presentation] .models-owned-task-header > :is(h2,h3,h4) {order:2;flex:1 1 180px;margin:0;}
[data-models-presentation] .models-owned-task-header .models-task-menu > div {z-index:30;}
html[data-desktop-models-host="true"] [data-models-presentation] .models-owned-task-header {top:-8px;}
