#room-dialog {
  width: min(1010px, calc(100vw - 28px));
  max-width: none;
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: auto;
}
.room-heading {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel, #fff);
}
.room-heading h2 { flex: 1; }
.room-heading .tool { flex: 0 0 44px; height: 44px; }
.room-heading .dialog-icon {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  color: #214531;
  background: #def593;
  border-radius: 12px;
}
.room-heading .dialog-icon svg { width: 19px; height: 19px; }
.room-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(285px, 340px);
  gap: 12px;
  padding: 12px;
  align-items: start;
}
.room-stage {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(320px, 62dvh, 640px);
  overflow: hidden;
  border: 1px solid #d4ded1;
  border-radius: 16px;
  background-color: #eaf0e7;
  background-image: radial-gradient(#c0d0bd 1px, transparent 1px);
  background-size: 16px 16px;
}
.room-stage[data-ready="true"] { background: #1b2923; }
.room-stage[data-ready="true"] .room-empty { display: none; }
.room-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 16px;
  color: #254736;
  text-align: center;
}
.room-empty i {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 4px;
  border: 1px solid #c9d6c4;
  border-radius: 16px;
  background: #f9fcf6;
}
.room-empty i svg { width: 25px; height: 25px; }
.room-empty strong { font-size: clamp(17px, 3vw, 20px); }
.room-empty span { color: #526954; font-size: 14px; }
.room-image-frame { position: relative; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.room-stage[data-loading="true"] .room-image-frame { pointer-events: none; }
.room-layout:has(.room-stage[data-loading="true"]) #room-photo-tools { opacity: .5; pointer-events: none; }
.room-image-frame > * { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.room-image-frame img { object-fit: fill; }
#room-stage-note {
  position: absolute;
  inset: 7px auto auto;
  z-index: 1;
  max-width: calc(100% - 16px);
  padding: 4px 8px;
  border-radius: 8px;
  background: #173529e8;
  color: #f8ffed;
  font-size: 12px;
  font-weight: 750;
  pointer-events: none;
}
.room-controls { display: grid; align-content: start; gap: 11px; min-width: 0; }
.room-controls .button, .room-xr-controls .button { min-height: 44px; }
.room-sources { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.room-sources .button { justify-content: center; padding-inline: 7px; gap: 6px; }
.room-sources .room-live-button { grid-column: 1 / -1; }
.room-live-button img { width: 17px; height: 17px; border-radius: 4px; }
#room-quick-look::after { content: attr(aria-label); }
.room-live-help { margin: 0; color: #486454; font-size: 13px; line-height: 1.4; }
.room-field { display: grid; gap: 5px; min-width: 0; color: #345241; font-size: 13px; font-weight: 750; }
.room-field input, .room-field select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 43px;
  padding: 6px 10px;
  border: 1px solid #d2ddce;
  border-radius: 9px;
  background: #fff;
  color: #1d3328;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
}
.room-tabs { display: flex; padding: 3px; gap: 3px; border: 1px solid #dbe3d7; border-radius: 10px; background: #edf2e9; }
.room-tabs button {
  flex: 1;
  min-height: 44px;
  padding-inline: 6px;
  border: 0;
  border-radius: 7px;
  color: #2e4b3a;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.room-tabs button[aria-pressed="true"] { background: #204634; color: #fff; }
.room-photo-adjust { display: flex; align-items: end; gap: 9px; margin-top: 7px; }
.room-range { display: grid; flex: 1; gap: 3px; min-width: 0; font-size: 13px; font-weight: 700; color: #385644; }
.room-range input, .room-angle input { width: 100%; min-height: 23px; margin: 0; accent-color: #225238; }
.room-photo-adjust > button { margin-left: auto; }
.room-form {
  display: grid;
  gap: 9px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #d8e3d2;
  background: #f2f7ee;
}
.room-angle { color: #375846; font-size: 13px; }
.room-angle summary { min-height: 34px; cursor: pointer; padding-block: 6px; }
.room-form-note, .room-status { margin: 0; color: #365746; font-size: 13px; line-height: 1.4; }
.room-status:empty { display: none; }
.room-layout:has(#room-stage-note:not([hidden])) .room-status:not([data-error="true"]) { position: absolute; clip-path: inset(50%); }
.room-layout:has(.room-stage[data-ready="true"]) .room-status[data-result="true"] { position: absolute; clip-path: inset(50%); }
.room-status[data-error="true"] { color: #903e2d; }
.room-status[data-result="true"] { font-weight: 800; color: #234634; font-size: 15px; }
#room-project-fields { display: grid; gap: 7px; }
#room-project-fields .room-panel-size { margin: 0; font-size: 17px; font-weight: 800; }
.room-model-button {
  position: absolute;
  z-index: 1;
  right: 8px;
  top: 8px;
  min-height: 44px;
  background: #fcfff9f2;
}
.stage.is-plan .room-model-button { display: none; }
#room-xr-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  pointer-events: none;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  overflow: hidden;
}
.room-xr-tap-area {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  touch-action: manipulation;
}
.room-xr-header, .room-xr-controls {
  z-index: 1;
  justify-self: center;
  width: min(100%, 500px);
  pointer-events: auto;
  border-radius: 14px;
  border: 1px solid #b6ceab;
  background: #f6fcf2f5;
  color: #173b2b;
}
.room-xr-header { display: flex; align-items: center; justify-content: space-between; padding: 4px 5px 4px 12px; }
.room-xr-header .tool { width: 44px; height: 44px; }
.room-xr-cross {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 19px;
  height: 19px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
#room-xr-overlay[data-target="placed"] .room-xr-cross { visibility: hidden; }
#room-xr-overlay[data-aim="lower"] .room-xr-cross { visibility: hidden; }
.room-xr-cross::before, .room-xr-cross::after {
  position: absolute;
  content: "";
  inset: 50% auto auto 50%;
  height: 2px;
  width: 19px;
  transform: translate(-50%, -50%);
  background: white;
  box-shadow: 0 0 2px 1px #142f24;
}
.room-xr-cross::after { transform: translate(-50%, -50%) rotate(90deg); }
#room-xr-overlay[data-target="ready"] .room-xr-cross::before,
#room-xr-overlay[data-target="ready"] .room-xr-cross::after { background: #d9f68a; }
.room-xr-controls { display: grid; gap: 6px; grid-row: 2; align-self: start; margin-top: 8px; padding: 8px; }
.room-xr-controls output { min-height: 20px; padding-inline: 4px; font-size: 14px; font-weight: 750; }
.room-xr-buttons { display: flex; gap: 6px; }
.room-xr-buttons [data-xr-action="mark"] { flex: 1; }
@media (orientation: landscape) and (max-height: 500px) {
  #room-xr-overlay { grid-template-columns: 1fr minmax(230px, 44vw); gap: 10px; padding-bottom: 10px; }
  .room-xr-header { grid-column: 1; }
  .room-xr-controls { grid-column: 2; grid-row: 1; margin-top: 0; }
}
@media (max-width: 700px) {
  #room-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  .room-layout { grid-template-columns: minmax(0, 1fr); padding: 8px; gap: 8px; }
  .room-stage { height: clamp(184px, 37dvh, 430px); }
  .room-controls { gap: 8px; }
  .room-sources { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .room-sources .room-live-button { grid-column: auto; }
  .room-sources .button { padding-inline: 4px; gap: 4px; font-size: 12px; }
  .room-sources .button svg { width: 15px; height: 15px; }
  .room-model-button { font-size: 12px; }
}
@media (max-width: 360px) {
  .room-sources .button { gap: 2px; font-size: 11px; }
}
