/* Scoped viewer additions; the quarter-plan dialog keeps its existing UI. */
.house-view-toolbar { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: .7rem 1.2rem; margin-top: 1.3rem; }
.house-view-switch { display: flex; border: 1px solid var(--line); }
.house-view-switch button { min-width: 3.3rem; min-height: 42px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font: 600 .82rem var(--sans); }
.house-view-switch button[aria-pressed="true"] { background: var(--navy-900); color: var(--white); }
.house-view-switch button:disabled { cursor: default; opacity: .45; }
.house-furniture { display: flex; align-items: center; gap: .45rem; min-height: 42px; font-size: .77rem; cursor: pointer; }
.house-furniture input { accent-color: var(--navy-900); width: 1rem; height: 1rem; }
.house-three-expand, .house-view-reset, .house-three-dialog-head button { background: transparent; color: var(--ink); border: 0; padding: .6rem .2rem; min-height: 42px; cursor: pointer; font: .77rem var(--sans); }
.house-view-reset { display: inline-flex; align-items: center; gap: .4rem; }
.house-view-reset svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.house-three-expand { margin-left: auto; }
.house-viewer-shell [hidden] { display: none !important; }
.house-viewer-shell .house-floor-tabs { display: none; }
.house-viewer-shell .house-floor-tabs { margin: 0; border: 1px solid var(--line); }
.house-viewer-shell .house-floor-tabs button { min-width: 3.3rem; min-height: 42px; padding: .6rem .8rem; border: 0; background: transparent; color: var(--muted); cursor: pointer; font: 600 .82rem var(--sans); }
.house-viewer-shell .house-floor-tabs button[aria-pressed="true"] { background: var(--navy-900); color: var(--white); }
.house-viewer-shell .floor-label-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.house-viewer-shell { --house-plan-height: clamp(440px, 39vw, 660px); }
.house-viewer-shell .house-floor figcaption { min-height: 42px; margin-bottom: .6rem; }
.house-viewer-shell .house-floor-grid { margin-top: .3rem; }
.house-viewer-shell [data-floor-drawing], .house-three-host { height: var(--house-plan-height); background: var(--warm-50); }
.house-viewer-shell .house-floor [data-floor-drawing] > svg { height: 100%; max-height: none; }
.house-viewer-shell[data-mode="3d"] [data-enlarge] { display: none; }
.house-three-host { width: 100%; min-width: 0; }
.house-three-host canvas { display: block; width: 100%; height: 100%; }
.house-viewer-shell button:focus-visible, .house-three-host canvas:focus-visible, .house-furniture input:focus-visible, .house-three-dialog button:focus-visible { outline: 2px solid var(--navy-900); outline-offset: 3px; }
.house-three-footer { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .35rem 1.5rem; padding: .85rem 0; }
.house-three-footer p, .house-three-status { font-size: .72rem; line-height: 1.55; color: var(--muted); margin: 0; }
.house-three-footer .house-three-note { text-align: right; max-width: 40em; }
.house-three-status { flex-basis: 100%; }
/* Loading occupies the existing control row; it never adds layout height.
   Persistent error messages remain in flow so their full text stays readable. */
.house-viewer-shell[aria-busy="true"] .house-three-status { position: absolute; top: 0; left: calc(6.6rem + 1.2rem + 2px); right: 0; min-height: 42px; display: flex; align-items: center; white-space: nowrap; }
.house-viewer-shell[aria-busy="true"] .house-view-toolbar [data-three-control] { visibility: hidden; }
.house-plan-notes { max-width: none; margin-top: .5rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.house-plan-notes summary { font-size: .74rem; }
.house-three-status:empty { display: none; }
.house-three-open { overflow: hidden; }
.house-three-dialog, .house-plan-dialog.is-floor-plan { width: min(1200px, 94vw); max-width: 94vw; max-height: 94dvh; margin: auto; padding: 1.2rem 1.6rem; border: 1px solid var(--line); background: var(--warm-50); color: var(--ink); overscroll-behavior: contain; }
.house-three-dialog::backdrop, .house-plan-dialog.is-floor-plan::backdrop { background: rgba(7,24,43,.72); }
.house-three-dialog-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.house-three-dialog-head h3 { font: 400 1.7rem var(--serif); margin: 0; }
.house-three-dialog .house-viewer-shell { --house-plan-height: max(240px, calc(94dvh - 285px)); }
.house-three-dialog .house-floor-grid { grid-template-columns: 1fr; }
.house-viewer-shell[data-expanded-floor="eg"] [data-floor-panel="og"], .house-viewer-shell[data-expanded-floor="og"] [data-floor-panel="eg"] { display: none; }
.house-three-dialog .house-three-expand { display: none; }
.house-three-dialog .house-view-toolbar { margin-top: .5rem; }
/* Match the floor-plan SVG dialog to 3D without changing the shared map UI. */
.house-plan-dialog.is-floor-plan[open] { display: flex; }
.house-plan-dialog.is-floor-plan .house-dialog-head { padding: 0; border: 0; background: transparent; }
.house-plan-dialog.is-floor-plan .house-dialog-head h3 { font: 400 1.7rem var(--serif); }
.house-plan-dialog.is-floor-plan .house-dialog-head button { width: auto; min-height: 44px; padding: .6rem .2rem; border: 0; border-radius: 0; font: .77rem var(--sans); }
.house-plan-dialog.is-floor-plan .plan-close-label { display: inline; }
.house-plan-dialog.is-floor-plan .plan-controls { display: flex; padding: .5rem 0 .8rem; border: 0; background: transparent; }
.house-plan-dialog.is-floor-plan .plan-controls [data-zoom-out] { border: 1px solid var(--line); border-right: 0; border-radius: 0; background: transparent; }
.house-plan-dialog.is-floor-plan .plan-controls output { border-block: 1px solid var(--line); background: transparent; }
.house-plan-dialog.is-floor-plan .plan-controls [data-zoom-in] { border: 1px solid var(--line); border-left: 0; border-radius: 0; background: transparent; }
.house-plan-dialog.is-floor-plan .plan-controls [data-fit] { margin-left: auto; padding: 0 .45rem; font-size: .75rem; text-decoration: none; }
.house-plan-dialog.is-floor-plan .plan-fit-full { display: inline; }
.house-plan-dialog.is-floor-plan .plan-fit-compact { display: none; }
.house-plan-dialog.is-floor-plan .plan-viewport { background: var(--warm-50); }
.house-plan-dialog.is-floor-plan .plan-help { display: flex; flex-wrap: wrap; padding: .85rem 0 0; background: transparent; color: var(--muted); font-size: .72rem; line-height: 1.55; }
.house-plan-dialog.is-floor-plan .plan-help .plan-gesture-help { display: inline; }
.house-plan-dialog.is-floor-plan :focus-visible { outline: 2px solid var(--navy-900); outline-offset: -2px; }
@media (min-width: 601px) {
  /* Reserve optional controls' footprint in both modes, including wrapped rows
     on narrow desktops. Hidden controls stay unfocusable and absent from AX. */
  .house-viewer-shell .house-view-toolbar [data-three-control][hidden] { display: inline-flex !important; visibility: hidden; pointer-events: none; }
}

@media (max-width: 600px) {
  .house-viewer-shell[aria-busy="true"] .house-three-status { left: calc(6.6rem + .8rem + 2px); }
  .house-plan-dialog.is-floor-plan { padding: 1rem; }
  .house-plan-dialog.is-floor-plan .house-dialog-head h3 { font-size: 1.2rem; }
  .house-viewer-shell .house-floor figcaption { min-height: 42px; }
  .house-viewer-shell[data-mode="3d"] .house-floor figcaption { visibility: hidden; }
  .house-three-status:empty { display: none; }
  .house-viewer-shell .house-floor-tabs { display: flex; order: 5; flex-basis: 100%; border: 0; border-bottom: 1px solid var(--line); }
  .house-viewer-shell .house-floor-tabs button { flex: 1; padding: .8rem .5rem; border-bottom: 2px solid transparent; font-weight: 400; }
  .house-viewer-shell .house-floor-tabs button[aria-pressed="true"] { background: transparent; border-bottom-color: var(--navy-900); color: var(--ink); }
  .house-viewer-shell .floor-label-full { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .house-viewer-shell .floor-label-short { display: none; }
  /* Place reset in the caption row, so it cannot create a toolbar row. */
  .house-view-reset { position: absolute; top: calc(100% + .5rem); right: 0; z-index: 1; font-size: .73rem; padding-block: .35rem; }
  .house-viewer-shell .house-three-expand, .house-floor [data-enlarge] { display: none; }
  /* Small viewport height remains stable when mobile browser controls move. */
  .house-viewer-shell { --house-plan-height: min(610px, 143vw, max(300px, calc(100svh - var(--header-height) - 11rem))); }
  .house-viewer-shell .house-floor-grid { grid-template-columns: 1fr; margin-top: .5rem; }
  .house-viewer-shell .house-floor:not(.is-mobile-floor) { display: none; }
  .house-view-toolbar { gap: .5rem .8rem; }
  .house-furniture { font-size: .73rem; }
  .house-three-footer { flex-direction: column; gap: .45rem; padding-block: .8rem; }
  .house-three-footer .house-three-note { text-align: left; }
}
