/* HomeBase V11: the scene has one stable rectangle; every tool is an overlay. */
:root {
  --tray-gap: 12px;
  --workbench-edit-height: 68px;
  --workbench-panel-height: min(350px, 43dvh);
  --catalog-tray-height: 294px;
}

body#homebase-app .viewport #stage {
  inset: 0 !important;
  width: auto;
  height: auto;
  transition: none;
}
body#homebase-app .viewport,
body#homebase-app .experience,
body#homebase-app #stage canvas {
  transition: none;
}

/* One quiet scene toolbar and two distinct movement zones. */
body#homebase-app .view-bar {
  top: 16px;
  left: 20px;
  right: 20px;
  transition: none;
}
body#homebase-app .hint {
  top: 78px;
  left: 174px;
  max-width: calc(100% - 450px);
  transition: none;
}
body#homebase-app .scene-edit-furniture {
  position: absolute;
  top: 80px;
  left: 20px;
  z-index: 4;
  min-height: 44px;
  padding: 9px 13px;
  color: var(--night);
  background: var(--paper);
  border-color: #18271c42;
  border-radius: 7px;
  box-shadow: 0 3px 15px #0a0e0c1a;
  font-size: 12px;
  font-weight: 600;
}
body#homebase-app .scene-edit-furniture .icon {
  width: 18px;
  height: 18px;
}
body#homebase-app .scene-edit-furniture:hover:not(:disabled) {
  background: var(--white);
  border-color: var(--night);
}
body#homebase-app .navigation-feel-controls {
  top: 132px;
  left: 20px;
  right: auto;
}
body#homebase-app .tools {
  display: flex;
  top: 80px;
  right: 20px;
  bottom: auto;
  flex-direction: row;
  gap: 6px;
}
body#homebase-app .tools #reset {
  min-width: 44px;
  width: 44px;
  padding: 8px;
}
body#homebase-app .tools #reset span {
  display: none;
}
body#homebase-app .tools #reset .icon {
  width: 18px;
  height: 18px;
}
body#homebase-app .quality {
  top: 135px;
  right: 22px;
  bottom: auto;
}
body#homebase-app.inside .walk-controls {
  display: grid;
  top: auto;
  left: auto;
  right: 20px;
  bottom: 20px;
  grid-template-columns: repeat(3, 44px);
  gap: 4px;
}
body#homebase-app[data-panel]:not([data-panel=""]).inside .walk-controls {
  bottom: calc(var(--sheet-height, 280px) + 32px);
}
body#homebase-app[data-editing="true"].inside .walk-controls {
  display: none;
}
body#homebase-app .caption {
  left: 22px;
  bottom: 22px;
  max-width: min(460px, calc(100% - 205px));
  transition: none;
}
body#homebase-app[data-panel]:not([data-panel=""]) .caption,
body#homebase-app[data-editing="true"] .caption {
  display: none;
}
body#homebase-app[data-editing="true"] .hint,
body#homebase-app[data-panel]:not([data-panel=""]) .hint {
  display: none;
}

/* Cream headers sit on dark cards, carrying the arrival's material palette. */
body#homebase-app .workspace-panel,
body#homebase-app[data-editing="true"] .workspace-panel {
  position: absolute;
  top: auto;
  bottom: 16px;
  left: calc(var(--rail-width) + 16px);
  right: auto;
  width: min(450px, calc(100% - var(--rail-width) - 32px));
  height: var(--workbench-panel-height);
  max-height: calc(100% - 100px);
  z-index: 6;
  border: 1px solid #667466;
  border-radius: 12px;
  background: var(--soft);
  box-shadow: 0 8px 28px #08120c38;
}
body#homebase-app .workspace-panel[data-sheet="expanded"],
body#homebase-app[data-editing="true"] .workspace-panel[data-sheet="expanded"] {
  height: min(680px, 76dvh);
}
body#homebase-app[data-panel="furnish"] .workspace-panel {
  width: auto;
  right: 16px;
  height: var(--catalog-tray-height);
}
body#homebase-app[data-editing="true"][data-panel="furnish"] .workspace-panel {
  bottom: calc(var(--workbench-edit-height) + 24px);
}
body#homebase-app[data-panel="furnish"]
  .workspace-panel[data-sheet="expanded"] {
  height: min(480px, 63dvh);
}
body#homebase-app .panel-header {
  flex: 0 0 52px;
  min-height: 52px;
  padding: 4px 6px 4px 16px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--night);
  background: var(--paper);
  border-bottom: 1px solid #d1d1c4;
}
body#homebase-app .panel-header > div:first-child {
  min-width: 0;
  margin-right: auto;
}
body#homebase-app .panel-header h2 {
  font-size: 19px;
  font-weight: 570;
  letter-spacing: -0.55px;
  margin: 0;
}
body#homebase-app .panel-header .eyebrow {
  display: none;
}
body#homebase-app .panel-header .icon-button {
  align-self: center;
  min-width: 44px;
  width: 44px;
  height: 44px;
  margin: 0;
  color: #394c3e;
  border: 0;
}
body#homebase-app .sheet-grip {
  position: static;
  display: inline-flex;
  flex: none;
  width: auto;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 6px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #394c3e;
  font-size: 11px;
}
body#homebase-app .sheet-handle {
  display: none;
}
body#homebase-app .panel-header button:hover:not(:disabled) {
  background: #0a0e0c0a;
  border-color: transparent;
}
body#homebase-app .panel-scroll {
  flex: 1;
  min-height: 0;
  padding: 13px 16px 16px;
  scrollbar-gutter: auto;
  scroll-padding: 12px;
}
body#homebase-app .panel-scroll-hint {
  display: none;
}
body#homebase-app .panel-intro {
  display: none;
}
body#homebase-app .panel-description {
  margin-bottom: 12px;
  font-size: 12px;
  line-height: 1.45;
}
body#homebase-app .panel-section {
  margin-top: 15px;
  padding-top: 14px;
}
body#homebase-app .section-heading {
  margin-bottom: 9px;
}
body#homebase-app .tour-link {
  min-height: 58px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
body#homebase-app .tour-link strong {
  font-size: 14px;
}
body#homebase-app .tour-link small {
  font-size: 11px;
}
body#homebase-app .explore-section {
  margin-top: 14px;
}
body#homebase-app .explore-suites {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
body#homebase-app .explore-suites button {
  grid-template-columns: 26px minmax(0, 1fr);
  min-height: 64px;
  gap: 8px;
  padding: 9px;
}
body#homebase-app .explore-suite-number {
  font-size: 22px;
}
body#homebase-app .explore-arrow {
  display: none;
}
body#homebase-app .explore-suites strong {
  font-size: 12px;
}
body#homebase-app .explore-suites small {
  font-size: 10px;
  line-height: 1.25;
}
body#homebase-app .shared-spaces button {
  min-height: 78px;
}
body#homebase-app .suite-picker {
  gap: 6px;
  margin-bottom: 12px;
}
body#homebase-app .suite-picker button {
  min-height: 47px;
  flex-direction: row;
  gap: 6px;
  padding: 7px;
}
body#homebase-app .suite-picker strong {
  font-size: 20px;
}
body#homebase-app .suite-heading {
  margin-bottom: 10px;
}
body#homebase-app .suite-heading h3 {
  font-size: 19px;
}
body#homebase-app .layout-card {
  padding-top: 12px;
}
body#homebase-app .layout-footer {
  margin-top: 10px;
  padding-top: 9px;
  padding-bottom: 9px;
}

/* A horizontal catalog: the whole card stays visible as the row scrolls. */
body#homebase-app[data-panel="furnish"] .panel-scroll {
  padding: 6px 12px 8px;
  touch-action: auto;
}
.catalog-search-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 150px 44px;
  gap: 7px;
  max-width: 680px;
}
body#homebase-app .catalog-search-row .search-field,
body#homebase-app .catalog-search-row .search-field input {
  margin: 0;
  min-height: 36px;
  height: 36px;
}
body#homebase-app .catalog-search-row .search-field {
  padding-left: 9px;
}
body#homebase-app .catalog-search-row .search-field input {
  width: 100%;
  padding-left: 4px;
  font-size: 13px;
}
.catalog-room {
  position: relative;
  min-width: 0;
}
.catalog-room > span {
  position: absolute;
  top: 2px;
  left: 9px;
  font-size: 8px;
  line-height: 10px;
  color: #aebead;
  pointer-events: none;
}
body#homebase-app .catalog-room select {
  padding-top: 11px;
}
body#homebase-app .catalog-room select {
  height: 36px;
  min-height: 36px;
  padding: 4px 22px 4px 9px;
  font-size: 12px;
}
body#homebase-app .catalog-more {
  min-height: 36px;
  height: 36px;
  padding: 5px;
  border-color: var(--line);
  font-size: 12px;
  letter-spacing: 1px;
}
body#homebase-app .catalog-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 4px 0 5px;
  padding: 0;
  scrollbar-width: none;
  touch-action: pan-x;
}
body#homebase-app .catalog-filters button {
  flex: none;
  min-width: 57px;
  min-height: 32px;
  padding: 6px 13px;
  border: 0;
  border-radius: 5px;
  font-size: 11px;
}
.catalog-carousel {
  position: relative;
  padding: 0 44px;
}
body#homebase-app .catalog-cards,
body#homebase-app .workspace-panel[data-sheet="expanded"] .catalog-cards {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  height: 129px;
  min-height: 129px;
  max-height: 129px;
  grid-auto-rows: auto;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0;
  padding: 2px 2px 4px;
  scroll-padding: 2px;
  scroll-snap-type: x proximity;
  scrollbar-gutter: auto;
  scrollbar-width: thin;
  touch-action: pan-x;
  overscroll-behavior: contain;
}
body#homebase-app .catalog-card {
  flex: 0 0 152px;
  height: 121px;
  min-height: 121px;
  padding: 0;
  gap: 0;
  scroll-snap-align: start;
  touch-action: pan-x;
  cursor: grab;
  border-color: #617163;
  border-radius: 7px;
  color: var(--white);
  background: #18231c;
}
body#homebase-app .catalog-card:hover:not(:disabled) {
  border-color: var(--paper);
  background: #223126;
}
body#homebase-app .catalog-card.active {
  color: var(--white);
  background: #223126;
  border-color: var(--paper);
  box-shadow: none;
}
body#homebase-app .catalog-art {
  height: 51px;
  min-height: 51px;
  background: #e7e3d8;
}
body#homebase-app .catalog-art img {
  object-fit: contain;
  pointer-events: none;
}
body#homebase-app .catalog-art svg {
  width: 62px;
  height: 50px;
  pointer-events: none;
}
body#homebase-app .catalog-art::after {
  display: none;
}
body#homebase-app .catalog-card-label {
  display: -webkit-box;
  min-height: 29px;
  max-height: 29px;
  padding: 4px 8px 0;
  -webkit-line-clamp: 2;
  font-size: 11px;
  font-weight: 560;
  line-height: 1.1;
}
body#homebase-app .catalog-card-size {
  flex: none;
  padding: 1px 8px 0;
  color: #b9c6b8;
  font-size: 9px;
  line-height: 12px;
}
.catalog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding: 0 8px 4px;
  min-height: 20px;
}
body#homebase-app .catalog-card-collection {
  padding: 0;
  margin: 0;
  border: 0;
  color: #adbaad;
  font-size: 8px;
}
.catalog-card-add {
  color: var(--paper);
  font-size: 10px;
  font-weight: 600;
}
body#homebase-app .catalog-card.is-dragging {
  opacity: 0.45;
  border-style: dashed;
}
body#homebase-app[data-catalog-dragging="true"] .workspace-panel {
  border-color: #e2ebce;
}
body#homebase-app[data-catalog-dragging="true"] .catalog-cards {
  scroll-snap-type: none;
}
.catalog-nav {
  position: absolute;
  top: 36px;
  width: 36px;
  min-width: 36px;
  height: 44px;
  padding: 6px;
  border-color: #617163;
  background: #233228;
  font-size: 18px;
}
.catalog-previous {
  left: 0;
}
.catalog-next {
  right: 0;
}
.catalog-browse-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  height: 19px;
}
body#homebase-app .catalog-browse-note .scroll-cue {
  padding: 2px 0;
  font-size: 10px;
  line-height: 15px;
  text-align: left;
}
body#homebase-app .catalog-browse-note .subtle {
  flex: none;
  font-size: 9px;
  letter-spacing: 0;
}
body#homebase-app .catalog-empty {
  align-self: center;
  padding: 15px;
}
body#homebase-app .catalog-refine,
body#homebase-app #staging-panel > .furnish-options {
  display: none;
}
body#homebase-app .workspace-panel[data-sheet="expanded"] .catalog-refine,
body#homebase-app
  .workspace-panel[data-sheet="expanded"]
  #staging-panel
  > .furnish-options {
  display: block;
}
body#homebase-app .catalog-refine {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 10px;
}
body#homebase-app .library-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
body#homebase-app .library-filters button {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 11px;
}
body#homebase-app .library-description {
  margin-bottom: 0;
}
body#homebase-app .edit-session {
  margin: 0 0 10px;
  padding: 0 0 10px;
}

/* The edit bar has the same height with or without a selected piece. */
body#homebase-app .edit-dock,
body#homebase-app[data-panel]:not([data-panel=""]) .edit-dock {
  display: flex;
  align-items: center;
  gap: 14px;
  left: calc(var(--rail-width) + 16px);
  right: 16px;
  bottom: 16px;
  height: var(--workbench-edit-height);
  min-height: var(--workbench-edit-height);
  max-height: var(--workbench-edit-height);
  max-width: none;
  padding: 10px 14px;
  overflow: hidden;
  background: #111b16;
  border-color: #87977f;
  border-radius: 10px;
}
body#homebase-app .edit-dock-heading {
  flex: 1;
  min-width: 0;
}
body#homebase-app .edit-dock-heading .eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #bbcbb6;
  font-size: 8px;
}
body#homebase-app .edit-dock-heading strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 17px;
}
body#homebase-app .edit-dock-heading strong:empty {
  display: none;
}
body#homebase-app .edit-dock-heading p {
  margin: 0;
  max-width: none;
  color: #b6c3b2;
  font-size: 11px;
  line-height: 16px;
}
body#homebase-app .edit-dock[data-selected="true"] .edit-dock-heading p {
  display: none;
}
body#homebase-app .edit-dock-session-actions,
body#homebase-app .edit-dock .selection-tools,
body#homebase-app .edit-dock .selection-rotate {
  display: flex;
  flex: none;
  align-items: center;
  gap: 5px;
  position: static;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
body#homebase-app .edit-dock-session-actions button,
body#homebase-app .edit-dock .selection-rotate button,
body#homebase-app .edit-dock .remove-piece {
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  max-width: none;
  padding: 7px 10px;
  font-size: 11px;
  white-space: nowrap;
}
body#homebase-app .edit-dock .selection-rotate button {
  width: 44px;
  font-size: 20px;
}
body#homebase-app .edit-dock-session-actions .icon {
  display: block;
  width: 16px;
  height: 16px;
}
body#homebase-app .edit-dock .remove-piece {
  color: #ffd1d4;
}
body#homebase-app .ui-message,
body#homebase-app[data-panel]:not([data-panel=""]) .ui-message,
body#homebase-app[data-editing="true"] .ui-message,
body#homebase-app[data-editing="true"][data-panel]:not([data-panel=""])
  .ui-message {
  top: 16px;
  bottom: auto;
  left: calc(50% + var(--rail-width) / 2);
  max-width: min(440px, calc(100% - var(--rail-width) - 40px));
  z-index: 40;
  pointer-events: none;
}
body#homebase-app.view-only .scene-edit-furniture,
body#homebase-app.capture .scene-edit-furniture,
body#homebase-app.presentation .scene-edit-furniture,
body#homebase-app.arrival-active .scene-edit-furniture {
  display: none !important;
}

@media (max-width: 760px) {
  :root {
    --workbench-edit-height: 78px;
    --workbench-panel-height: min(280px, 36dvh);
    --catalog-tray-height: 278px;
  }
  body#homebase-app .view-bar {
    top: 10px;
    left: 10px;
    right: 10px;
    gap: 7px;
  }
  body#homebase-app .view-bar .seg button {
    min-height: 44px;
    padding: 7px;
    font-size: 10px;
  }
  body#homebase-app .scene-edit-furniture {
    top: 70px;
    left: 10px;
    min-height: 44px;
    height: 44px;
    padding: 7px 10px;
    font-size: 11px;
  }
  body#homebase-app .tools {
    display: flex;
    top: 70px;
    right: 10px;
    bottom: auto;
    flex-direction: row;
    gap: 4px;
  }
  body#homebase-app .tools .zoom-controls button,
  body#homebase-app .tools #reset {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    height: 44px;
    padding: 6px;
  }
  body#homebase-app .tools #reset .icon {
    display: block;
    width: 18px;
    height: 18px;
  }
  body#homebase-app .navigation-feel-controls {
    top: 122px;
    left: 10px;
    right: auto;
  }
  body#homebase-app .navigation-feel-controls button {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 10px;
  }
  body#homebase-app .navigation-feel-controls .navigation-help {
    max-width: 230px;
  }
  body#homebase-app .workspace-panel,
  body#homebase-app[data-editing="true"] .workspace-panel {
    position: absolute;
    left: 7px;
    right: 7px;
    top: auto;
    bottom: calc(var(--nav-height) + 7px);
    width: auto;
    height: var(--workbench-panel-height);
    max-height: calc(100% - var(--nav-height) - 115px);
    border-radius: 11px;
  }
  body#homebase-app[data-panel="furnish"] .workspace-panel {
    left: 7px;
    right: 7px;
    width: auto;
    height: var(--catalog-tray-height);
  }
  body#homebase-app .workspace-panel[data-sheet="expanded"],
  body#homebase-app[data-editing="true"]
    .workspace-panel[data-sheet="expanded"] {
    height: min(65dvh, 580px);
  }
  body#homebase-app[data-editing="true"][data-panel="furnish"]
    .workspace-panel {
    bottom: calc(var(--nav-height) + var(--workbench-edit-height) + 14px);
    max-height: calc(
      100% - var(--nav-height) - var(--workbench-edit-height) - 125px
    );
  }
  body#homebase-app .panel-header {
    flex-basis: 44px;
    min-height: 44px;
    padding: 0 2px 0 12px;
    gap: 0;
  }
  body#homebase-app .panel-header h2 {
    font-size: 17px;
  }
  body#homebase-app .sheet-grip {
    padding: 6px 7px;
    font-size: 10px;
  }
  body#homebase-app .panel-header .icon-button {
    min-width: 44px;
    width: 44px;
  }
  body#homebase-app .panel-scroll {
    padding: 10px 12px 14px;
  }
  body#homebase-app[data-panel="furnish"] .panel-scroll {
    padding: 4px 8px 6px;
  }
  .catalog-search-row {
    grid-template-columns: minmax(80px, 1fr) 93px 44px;
    gap: 5px;
  }
  body#homebase-app .catalog-search-row .search-field,
  body#homebase-app .catalog-search-row .search-field input,
  body#homebase-app .catalog-room select,
  body#homebase-app .catalog-more {
    height: 44px;
    min-height: 44px;
  }
  body#homebase-app .catalog-search-row .search-field input {
    font-size: 16px;
  }
  body#homebase-app .catalog-room select {
    font-size: 16px;
    padding: 13px 15px 0 7px;
  }
  body#homebase-app .catalog-more {
    min-width: 44px;
  }
  body#homebase-app .catalog-filters {
    margin: 3px 0 4px;
    gap: 2px;
  }
  body#homebase-app .catalog-filters button {
    min-width: 48px;
    min-height: 32px;
    padding: 6px 9px;
    font-size: 10px;
  }
  .catalog-carousel {
    padding: 0;
  }
  .catalog-nav {
    display: none;
  }
  body#homebase-app .catalog-card {
    flex-basis: 136px;
    height: 112px;
    min-height: 112px;
  }
  body#homebase-app .catalog-art {
    height: 42px;
    min-height: 42px;
  }
  body#homebase-app .catalog-cards,
  body#homebase-app .workspace-panel[data-sheet="expanded"] .catalog-cards {
    height: 120px;
    min-height: 120px;
    max-height: 120px;
    scrollbar-width: none;
  }
  .catalog-browse-note {
    height: 17px;
  }
  body#homebase-app .catalog-browse-note .scroll-cue {
    font-size: 9px;
  }
  body#homebase-app .edit-dock,
  body#homebase-app[data-panel]:not([data-panel=""]) .edit-dock {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    left: 7px;
    right: 7px;
    bottom: calc(var(--nav-height) + 7px);
    padding: 6px 8px;
    border-radius: 9px;
  }
  body#homebase-app .edit-dock-heading {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 16px;
    height: 16px;
  }
  body#homebase-app .edit-dock-heading .eyebrow {
    flex: none;
    display: block;
    margin: 0;
    padding-right: 6px;
    border-right: 1px solid var(--line-strong);
    font-size: 7px;
    letter-spacing: 0.05em;
  }
  body#homebase-app .edit-dock-heading strong,
  body#homebase-app .edit-dock-heading p {
    margin: 0;
    font-size: 10px;
    line-height: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body#homebase-app .edit-dock-session-actions {
    width: 100%;
    justify-content: space-between;
    gap: 3px;
  }
  body#homebase-app .edit-dock .selection-tools,
  body#homebase-app .edit-dock .selection-rotate {
    gap: 3px;
  }
  body#homebase-app .edit-dock-session-actions button,
  body#homebase-app .edit-dock .selection-rotate button,
  body#homebase-app .edit-dock .remove-piece {
    min-width: 44px;
    width: 44px;
    height: 44px;
    min-height: 44px;
    max-width: none;
    padding: 5px 2px;
    font-size: 10px;
    gap: 3px;
    flex-direction: column;
  }
  body#homebase-app .edit-dock-session-actions > button {
    flex: 1;
  }
  body#homebase-app .edit-dock .selection-rotate button {
    font-size: 23px;
  }
  body#homebase-app .edit-dock-session-actions .icon {
    display: block;
    width: 14px;
    height: 14px;
  }
  body#homebase-app .edit-dock .remove-piece {
    width: 49px;
    font-size: 10px;
  }
  body#homebase-app.inside .walk-controls {
    display: grid;
    top: auto;
    right: 10px;
    left: auto;
    bottom: 12px;
    gap: 4px;
    grid-template-columns: repeat(3, 44px);
  }
  body#homebase-app.inside .walk-controls button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
  body#homebase-app[data-panel]:not([data-panel=""]).inside .walk-controls {
    bottom: calc(var(--sheet-height, 270px) + 20px);
  }
  body#homebase-app[data-editing="true"].inside .walk-controls {
    display: none;
  }
  body#homebase-app .caption {
    left: 14px;
    bottom: 15px;
    max-width: calc(100% - 160px);
  }
  body#homebase-app .ui-message,
  body#homebase-app[data-panel]:not([data-panel=""]) .ui-message,
  body#homebase-app[data-editing="true"] .ui-message,
  body#homebase-app[data-editing="true"][data-panel]:not([data-panel=""])
    .ui-message {
    top: 161px;
    bottom: auto;
    left: 50%;
    max-width: calc(100% - 28px);
    padding: 8px 12px;
    font-size: 11px;
  }
}

@media (max-width: 370px) {
  body#homebase-app .panel-header h2 {
    font-size: 15px;
  }
  body#homebase-app .sheet-grip {
    padding-left: 5px;
    padding-right: 5px;
  }
  body#homebase-app .edit-dock-heading .eyebrow {
    font-size: 6px;
  }
  body#homebase-app .edit-dock .selection-tools,
  body#homebase-app .edit-dock .selection-rotate,
  body#homebase-app .edit-dock-session-actions {
    gap: 2px;
  }
  body#homebase-app .edit-dock .remove-piece {
    width: 44px;
  }
}

@media (max-width: 760px) and (max-height: 720px) {
  :root {
    --catalog-tray-height: 268px;
    --workbench-panel-height: 238px;
  }
  body#homebase-app .catalog-cards,
  body#homebase-app .workspace-panel[data-sheet="expanded"] .catalog-cards {
    height: 110px;
    min-height: 110px;
    max-height: 110px;
  }
  body#homebase-app .catalog-card {
    height: 104px;
    min-height: 104px;
  }
  body#homebase-app .catalog-art {
    height: 37px;
    min-height: 37px;
  }
  body#homebase-app .catalog-art svg {
    height: 36px;
  }
  body#homebase-app .catalog-card-size {
    font-size: 8px;
    line-height: 11px;
  }
}

@media (max-width: 760px) and (max-height: 500px) {
  body#homebase-app .workspace-panel,
  body#homebase-app[data-editing="true"] .workspace-panel {
    left: 7px;
    right: auto;
    width: min(360px, 55vw);
    max-height: calc(100% - var(--nav-height) - 14px);
  }
  body#homebase-app[data-panel="furnish"] .workspace-panel {
    left: 7px;
    right: 7px;
    width: auto;
  }
  body#homebase-app .workspace-panel[data-sheet="expanded"] {
    height: calc(100% - var(--nav-height) - 14px);
  }
  body#homebase-app .scene-edit-furniture,
  body#homebase-app .tools {
    top: 59px;
  }
  body#homebase-app .navigation-feel-controls {
    display: none !important;
  }
  body#homebase-app[data-panel]:not([data-panel=""]).inside .walk-controls {
    bottom: 12px;
    right: 10px;
  }
}

/* Visual furniture cards: the object comes first, dimensions remain in its accessible label. */
body#homebase-app .catalog-card {
  position: relative;
  height: 121px;
  min-height: 121px;
}
body#homebase-app .catalog-art {
  height: 79px;
  min-height: 79px;
}
body#homebase-app .catalog-card-size,
body#homebase-app .catalog-card-collection {
  display: none;
}
body#homebase-app .catalog-card-label {
  min-height: 37px;
  max-height: 37px;
  padding: 7px 8px 3px;
}
.catalog-card-footer {
  position: absolute;
  top: 5px;
  right: 5px;
  bottom: auto;
  padding: 0;
  min-height: 0;
  margin: 0;
}
.catalog-card-add {
  background: var(--paper);
  color: var(--night);
  border: 1px solid #17201b2b;
  border-radius: 4px;
  padding: 3px 5px;
  font-size: 9px;
  box-shadow: 0 2px 5px #0001;
}
@media (max-width: 760px) {
  body#homebase-app .hint {
    display: none !important;
  }
  body#homebase-app .catalog-card {
    height: 112px;
    min-height: 112px;
  }
  body#homebase-app .catalog-art {
    height: 72px;
    min-height: 72px;
  }
  body#homebase-app .catalog-search-row {
    grid-template-columns: minmax(70px, 1fr) 116px 44px;
  }
  body#homebase-app .catalog-room select {
    padding-right: 5px;
  }
}
@media (max-width: 760px) and (max-height: 720px) {
  body#homebase-app .catalog-card {
    height: 104px;
    min-height: 104px;
  }
  body#homebase-app .catalog-art {
    height: 66px;
    min-height: 66px;
  }
}

/* Lift the library out of the way while a piece follows the pointer. */
body#homebase-app.catalog-dragging .workspace-panel {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
}
.catalog-drag-ghost {
  position: fixed;
  width: 72px;
  height: 68px;
  z-index: 80;
  overflow: hidden;
  border: 2px solid var(--paper);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 8px 24px #0004;
  pointer-events: none;
}
.catalog-drag-ghost img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
body[data-catalog-drop="clear"] .catalog-drag-ghost,
body[data-catalog-drop="blocked"] .catalog-drag-ghost {
  opacity: 0;
}

@media (max-width: 760px) {
  /* Editing replaces global navigation with the actions for the current piece. */
  body#homebase-app[data-editing="true"] .primary-navigation {
    visibility: hidden;
    pointer-events: none;
  }
  body#homebase-app[data-editing="true"][data-panel] .edit-dock {
    bottom: calc(7px + env(safe-area-inset-bottom, 0px));
  }
  body#homebase-app[data-editing="true"][data-panel="furnish"]
    .workspace-panel {
    bottom: calc(
      var(--workbench-edit-height) + 14px + env(safe-area-inset-bottom, 0px)
    );
    max-height: calc(100% - var(--workbench-edit-height) - 90px);
  }
}

body#homebase-app:has(.workspace-panel:not([hidden])[data-sheet="expanded"])
  .walk-controls {
  display: none;
}
@media (max-width: 760px) {
  body#homebase-app:not([data-panel="furnish"])
    .panel-scroll-hint:not([hidden]) {
    position: absolute;
    display: block;
    bottom: 4px;
    right: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    background: #0a0e0ced;
    color: var(--paper);
    font-size: 10px;
    line-height: 16px;
    pointer-events: none;
    z-index: 8;
    box-shadow: 0 -3px 10px #0a0e0c44;
  }
}

/* Short landscape screens use a side tray and a low navigation rail. */
@media (max-height: 500px) and (max-width: 1000px) {
  :root {
    --header-height: 48px;
    --rail-width: 0px;
    --nav-height: calc(50px + env(safe-area-inset-bottom, 0px));
  }
  body#homebase-app .app-header {
    height: 48px;
    padding: 0 14px;
  }
  body#homebase-app .brand-lockup img {
    width: 30px;
    height: 30px;
  }
  body#homebase-app .brand-lockup h1 {
    font-size: 14px;
  }
  body#homebase-app .brand-lockup p,
  body#homebase-app .header-note {
    display: none;
  }
  body#homebase-app .experience {
    height: calc(100dvh - 48px);
    overflow: clip;
  }
  body#homebase-app .viewport {
    inset: 0 0 var(--nav-height) 0;
  }
  body#homebase-app .primary-navigation {
    position: absolute;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: var(--nav-height);
    padding: 0 8px;
    display: flex;
    flex-direction: row;
    gap: 2px;
    border-top: 1px solid var(--line);
  }
  body#homebase-app .primary-navigation .nav-button {
    flex: 1;
    min-height: 44px;
    height: 44px;
    width: auto;
    padding: 5px;
    font-size: 10px;
    gap: 4px;
    flex-direction: row;
  }
  body#homebase-app .primary-navigation .nav-button .icon {
    width: 18px;
    height: 18px;
  }
  body#homebase-app .nav-footer {
    display: none;
  }
  body#homebase-app .view-bar {
    top: 7px;
    left: 8px;
    right: 8px;
  }
  body#homebase-app .view-bar .seg {
    width: auto;
  }
  body#homebase-app .view-bar .seg button {
    min-height: 34px;
    padding: 5px 10px;
    font-size: 10px;
  }
  body#homebase-app .scene-edit-furniture,
  body#homebase-app .tools {
    top: 49px;
  }
  body#homebase-app .navigation-feel-controls,
  body#homebase-app .hint,
  body#homebase-app .quality {
    display: none !important;
  }
  body#homebase-app .workspace-panel,
  body#homebase-app[data-editing="true"] .workspace-panel,
  body#homebase-app[data-panel="furnish"] .workspace-panel,
  body#homebase-app[data-editing="true"][data-panel="furnish"]
    .workspace-panel {
    left: 8px;
    right: auto;
    bottom: calc(var(--nav-height) + 6px);
    width: min(420px, 54vw);
    height: 225px;
    max-height: calc(100% - var(--nav-height) - 12px);
  }
  body#homebase-app .workspace-panel[data-sheet="expanded"],
  body#homebase-app[data-editing="true"]
    .workspace-panel[data-sheet="expanded"] {
    height: calc(100% - var(--nav-height) - 12px);
  }
  body#homebase-app .panel-header {
    flex-basis: 40px;
    min-height: 40px;
    padding: 0 4px 0 12px;
  }
  body#homebase-app .panel-header h2 {
    font-size: 16px;
  }
  body#homebase-app .catalog-search-row {
    grid-template-columns: minmax(70px, 1fr) 110px 40px;
  }
  body#homebase-app .catalog-carousel {
    padding: 0;
  }
  body#homebase-app .catalog-nav {
    display: none;
  }
  body#homebase-app .catalog-card {
    flex-basis: 126px;
    height: 100px;
    min-height: 100px;
  }
  body#homebase-app .catalog-art {
    height: 62px;
    min-height: 62px;
  }
  body#homebase-app .catalog-cards,
  body#homebase-app .workspace-panel[data-sheet="expanded"] .catalog-cards {
    height: 106px;
    min-height: 106px;
    max-height: 106px;
  }
  body#homebase-app .catalog-browse-note {
    display: none;
  }
  body#homebase-app .catalog-search-row input,
  body#homebase-app .catalog-room select {
    font-size: 16px;
  }
  body#homebase-app[data-editing="true"] .primary-navigation {
    visibility: hidden;
    pointer-events: none;
  }
  body#homebase-app[data-editing="true"][data-panel] .edit-dock {
    left: 8px;
    right: 8px;
    bottom: 6px;
    height: 60px;
    min-height: 60px;
    max-height: 60px;
    padding: 6px 10px;
    flex-direction: row;
    align-items: center;
  }
  body#homebase-app .edit-dock-heading {
    flex: 1;
    min-width: 0;
  }
  body#homebase-app .edit-dock-heading .eyebrow {
    display: none;
  }
  body#homebase-app .edit-dock-session-actions {
    width: auto;
    gap: 4px;
  }
  body#homebase-app[data-editing="true"][data-panel="furnish"]
    .workspace-panel {
    bottom: 72px;
    max-height: calc(100% - 82px);
  }
  body#homebase-app.inside .walk-controls,
  body#homebase-app[data-panel]:not([data-panel=""]).inside .walk-controls {
    top: auto;
    right: 10px;
    bottom: 10px;
  }
  body#homebase-app[data-editing="true"].inside .walk-controls {
    display: none;
  }
  body#homebase-app .ui-message {
    top: 105px;
    left: 72%;
    max-width: 40%;
  }
  body#homebase-app .caption {
    bottom: 12px;
    max-width: 50%;
  }
}

body#homebase-app .experience {
  overflow: clip;
}

/* Each compact tray starts with a complete task, with detail on request. */
@media (max-width: 760px), (max-width: 1000px) and (max-height: 500px) {
  body#homebase-app .compact-only {
    display: flex;
  }
  body#homebase-app:not([data-panel="furnish"])
    .workspace-panel[data-sheet="default"]
    .panel-scroll {
    padding: 8px 12px;
  }
  body#homebase-app[data-panel="explore"]
    .workspace-panel[data-sheet="default"] {
    height: 254px;
  }
  body#homebase-app[data-panel="building"]
    .workspace-panel[data-sheet="default"] {
    height: 242px;
  }
  body#homebase-app[data-panel="suites"] .workspace-panel[data-sheet="default"],
  body#homebase-app[data-panel="homebase"]
    .workspace-panel[data-sheet="default"] {
    height: 280px;
  }
  body#homebase-app .tray-segments {
    margin-bottom: 8px;
    flex: none;
  }
  body#homebase-app .tray-segments button {
    font-size: 11px;
  }
  body#homebase-app .building-category-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  body#homebase-app .explore-destination-tabs button {
    padding-inline: 12px;
  }
  body#homebase-app .workspace-panel[data-sheet="default"] .panel-scroll-hint {
    display: none;
  }

  /* A short arrival action and a browsable row of places. */
  body#homebase-app .tour-link {
    min-height: 44px;
    padding: 7px 10px;
    margin-bottom: 7px;
  }
  body#homebase-app .tour-link .feature-icon {
    width: 26px;
    height: 26px;
    border: 0;
  }
  body#homebase-app .tour-link small {
    display: none;
  }
  body#homebase-app .tour-link strong {
    font-size: 14px;
  }
  body#homebase-app .workspace-panel[data-sheet="default"] .explore-section {
    margin: 0;
  }
  body#homebase-app
    .workspace-panel[data-sheet="default"]
    .explore-section
    .section-heading,
  body#homebase-app
    .workspace-panel[data-sheet="default"]
    #panel-explore
    .navigation-feel,
  body#homebase-app
    .workspace-panel[data-sheet="default"]
    #panel-explore
    .view-options {
    display: none;
  }
  body#homebase-app .destination-strip {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    margin: 0 -2px;
    padding: 2px 2px 5px;
    scroll-padding-inline: 2px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: #5b675a transparent;
  }
  body#homebase-app .destination-strip button {
    flex: 0 0 132px;
    min-width: 0;
    height: 84px;
    min-height: 84px;
    padding: 10px;
    scroll-snap-align: start;
    background: var(--raised);
  }
  body#homebase-app .explore-suites button {
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 8px;
  }
  body#homebase-app .explore-suites strong,
  body#homebase-app .shared-spaces strong {
    font-size: 13px;
  }
  body#homebase-app .explore-suites small,
  body#homebase-app .shared-spaces small {
    font-size: 10px;
    line-height: 1.35;
    margin-top: 4px;
  }
  body#homebase-app .shared-spaces button {
    flex-basis: 151px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    padding-right: 22px;
  }
  body#homebase-app .shared-spaces button > span {
    right: 8px;
    bottom: 9px;
  }

  /* Suite selection stays above one complete, readable layout card. */
  body#homebase-app #panel-suites {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 100px;
    gap: 6px 8px;
    align-items: center;
  }
  body#homebase-app #panel-suites > .panel-description,
  body#homebase-app .suite-heading > div:first-child {
    display: none;
  }
  body#homebase-app .suite-picker {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    gap: 4px;
  }
  body#homebase-app .suite-picker button {
    gap: 3px;
    min-height: 44px;
    padding: 5px 2px;
    flex-direction: column;
  }
  body#homebase-app .suite-picker small {
    font-size: 7px;
  }
  body#homebase-app .suite-picker strong {
    font-size: 17px;
  }
  body#homebase-app .suite-heading {
    display: contents;
  }
  body#homebase-app #suite-step-inside {
    grid-column: 2;
    grid-row: 1;
    justify-content: center;
    min-height: 44px;
    font-size: 11px;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 7px;
  }
  body#homebase-app .suite-options {
    position: relative;
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 8px;
    margin: 0 -2px;
    padding: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 2px;
    scrollbar-width: none;
  }
  body#homebase-app .suite-options::-webkit-scrollbar {
    display: none;
  }
  body#homebase-app .layout-card {
    flex: 0 0 calc(100% - 24px);
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-rows: minmax(66px, 1fr) 28px;
    width: auto;
    min-width: 0;
    height: 114px;
    padding: 8px 10px 0;
    gap: 0 10px;
    scroll-snap-align: start;
  }
  body#homebase-app .layout-art {
    width: 64px;
    height: 64px;
    min-height: 64px;
  }
  body#homebase-app .layout-copy strong {
    margin: 4px 0 0;
    font-size: 14px;
    line-height: 1.2;
    letter-spacing: -0.2px;
  }
  body#homebase-app .layout-copy small {
    font-size: 8px;
    line-height: 1.25;
  }
  body#homebase-app .layout-copy .layout-description {
    display: none;
  }
  body#homebase-app .layout-footer {
    margin: 0;
    padding: 6px 0;
    gap: 6px;
    font-size: 10px;
  }
  body#homebase-app .layout-card.active {
    border-color: var(--paper);
    background: #25372c;
    box-shadow: inset 3px 0 0 var(--red);
  }
  body#homebase-app .layout-card.active .layout-state {
    color: var(--paper);
    font-weight: 650;
  }
  body#homebase-app .suite-layout-navigation {
    display: grid;
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
  }
  body#homebase-app .suite-layout-navigation button {
    min-height: 44px;
    padding: 6px;
    font-size: 18px;
  }
  body#homebase-app #suite-layout-count {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  body#homebase-app .suite-detail {
    grid-column: 1 / -1;
  }
  body#homebase-app .workspace-panel[data-sheet="default"] .suite-detail {
    display: none;
  }
  body#homebase-app .workspace-panel[data-sheet="expanded"] .layout-card {
    height: 158px;
    grid-template-rows: minmax(100px, 1fr) 30px;
  }
  body#homebase-app
    .workspace-panel[data-sheet="expanded"]
    .layout-description {
    display: block;
    margin-top: 6px;
    font-size: 11px;
  }

  /* Building controls are grouped by the job, not stacked as tall cards. */
  body#homebase-app
    .workspace-panel[data-sheet="default"]
    .building-section
    .section-heading,
  body#homebase-app .workspace-panel[data-sheet="default"] .building-section h3,
  body#homebase-app
    .workspace-panel[data-sheet="default"]
    .building-expanded-detail,
  body#homebase-app .workspace-panel[data-sheet="default"] .building-save {
    display: none;
  }
  body#homebase-app .building-section .panel-section {
    margin: 0;
    padding: 0;
    border: 0;
  }
  body#homebase-app .building-section .finish-options {
    gap: 7px;
  }
  body#homebase-app .building-section .finish-options button {
    padding: 5px 5px 7px;
    gap: 6px;
    font-size: 10px;
  }
  body#homebase-app .building-section .finish-swatch {
    height: 34px;
  }
  body#homebase-app .building-section .divider-link {
    min-height: 44px;
    padding: 7px 10px;
    margin: 7px 0 0;
    font-size: 12px;
  }
  body#homebase-app .building-section .daylight-control {
    padding: 0;
  }
  body#homebase-app .building-section .range-label {
    margin: 0;
    font-size: 12px;
  }
  body#homebase-app .building-section .door-toggle {
    min-height: 44px;
    margin-top: 5px;
  }
  body#homebase-app .building-toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  body#homebase-app .building-toggle-grid .toggle {
    min-width: 0;
    min-height: 47px;
    padding: 7px 9px;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--raised);
    color: var(--paper);
    font-size: 11px;
    line-height: 1.3;
  }
  body#homebase-app .building-toggle-grid .toggle input {
    inset: 0;
    width: 100%;
    height: 100%;
  }
  body#homebase-app .building-toggle-grid .switch {
    width: 28px;
    height: 16px;
  }
  body#homebase-app .building-toggle-grid .switch::after {
    width: 8px;
    height: 8px;
  }
  body#homebase-app .building-toggle-grid input:checked + .switch::after {
    transform: translateX(12px);
  }
  body#homebase-app #cutaway-note {
    margin: 7px 0 0;
    font-size: 10px;
    line-height: 1.3;
  }
  body#homebase-app .workspace-panel[data-sheet="expanded"] .building-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }
  body#homebase-app
    .workspace-panel[data-sheet="expanded"]
    .building-section
    h3 {
    margin-bottom: 10px;
  }
  body#homebase-app .workspace-panel[data-sheet="expanded"] .building-save,
  body#homebase-app
    .workspace-panel[data-sheet="expanded"]
    .building-expanded-detail {
    margin-top: 16px;
  }
  body#homebase-app
    .workspace-panel[data-sheet="default"]
    #panel-homebase
    > .presentation-button {
    display: none;
  }
}

@media (max-height: 500px) and (max-width: 1000px) {
  body#homebase-app[data-panel]:not([data-panel=""]) .view-bar {
    left: calc(min(420px, 54vw) + 24px);
  }
  body#homebase-app[data-panel]:not([data-panel=""]) .scene-edit-furniture {
    left: calc(min(420px, 54vw) + 24px);
  }
  body#homebase-app .rail-footer {
    display: none;
  }
}

@media (max-width: 760px), (max-width: 1000px) and (max-height: 500px) {
  body#homebase-app[data-panel="building"]
    .workspace-panel[data-sheet="default"]:has(#building-layers:not([hidden])) {
    height: 274px;
  }
  body#homebase-app .beam-opacity-control {
    margin-top: 8px;
  }
  body#homebase-app .beam-opacity-control .range-label {
    font-size: 10px;
    margin-bottom: 0;
  }
  body#homebase-app .beam-opacity-control input {
    height: 24px;
    margin: 2px 0 0;
  }
  body#homebase-app #building-layers #cutaway-note {
    display: none;
  }
}
