@font-face {
  font-family: Switzer;
  src: url("../fonts/switzer-400.woff2");
}
@font-face {
  font-family: Switzer;
  src: url("../fonts/switzer-500.woff2");
  font-weight: 500;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Switzer, Arial, sans-serif;
  background: #e6e5df;
  color: #222923;
  font-size: 13px;
}
button,
select,
input {
  font: inherit;
}
button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid #834b36;
  outline-offset: 3px;
}
button:hover {
  color: #874331;
}
#viewport {
  position: absolute;
  inset: 0;
}
canvas {
  display: block;
  touch-action: none;
}
header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 65px;
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 0 28px;
  background: #faf9f3eb;
  border-bottom: 1px solid #2833221c;
  backdrop-filter: blur(10px);
}
.wordmark {
  font-size: 28px;
  letter-spacing: -1px;
  color: inherit;
  text-decoration: none;
}
.wordmark span {
  font-size: 10px;
  letter-spacing: 3px;
  margin-left: 6px;
}
.header-note {
  font-size: 11px;
  color: #6a6c63;
}
#scope {
  margin-left: auto;
  font-size: 11px;
}
#fullscreen {
  font-size: 24px;
}
.panel {
  position: absolute;
  top: 86px;
  left: 24px;
  width: 266px;
  max-height: calc(100% - 132px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 23px;
  background: #faf9f3f0;
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 36px #1525190a;
  border: 1px solid #fff8;
}
.panel-label {
  font-size: 9px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #6c6e63;
  margin-bottom: 12px;
}
.second {
  margin-top: 24px;
}
.segmented {
  display: flex;
  border: 1px solid #2223;
  padding: 3px;
  gap: 2px;
}
.segmented button {
  flex: 1;
  padding: 9px 6px;
  font-size: 11px;
}
.segmented button[aria-pressed="true"] {
  background: #26352b;
  color: #fff;
}
.select-label {
  display: block;
  margin-top: 20px;
  margin-bottom: 8px;
  font-size: 10px;
  color: #606357;
}
select {
  width: 100%;
  background: #fff8;
  border: 1px solid #25302030;
  border-radius: 0;
  padding: 10px 8px;
  color: #26352b;
  font-size: 11px;
}
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 21px 0;
  font-size: 11px;
}
.options label {
  display: flex;
  align-items: center;
  gap: 8px;
}
input[type="checkbox"] {
  accent-color: #26352b;
  width: 14px;
  height: 14px;
  margin: 0;
}
.panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-top: 1px solid #25302020;
  padding-top: 16px;
}
.panel-actions button {
  text-align: left;
  font-size: 11px;
  padding: 6px 0;
}
.panel-actions button[aria-pressed="true"] {
  color: #963c23;
}
#selection {
  font-size: 10px;
  color: #737568;
  line-height: 1.7;
  border-top: 1px solid #25302020;
  padding-top: 14px;
  margin-top: 14px;
  min-height: 58px;
}
.bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 24px;
  background: #faf9f3df;
  font-size: 10px;
  color: #6c6e63;
  border-top: 1px solid #26352b20;
}
#status {
  position: absolute;
  inset: 65px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  background: #e6e5df;
  z-index: 5;
  font-size: 18px;
  letter-spacing: -0.4px;
}
#status progress {
  width: 170px;
  height: 3px;
  accent-color: #26352b;
}
#status[hidden] {
  display: none;
}
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 22px;
  transform: translate(-50%, -50%);
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
}
#walk-controls {
  position: absolute;
  bottom: 64px;
  right: 24px;
  text-align: center;
  touch-action: none;
  user-select: none;
}
#walk-controls button {
  width: 44px;
  height: 44px;
  background: #faf9f3e8;
  margin: 2px;
  border: 1px solid #26352b33;
  font-size: 20px;
}
#stairs {
  position: absolute;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 22px;
  background: #26352b;
  color: #fff;
  font-size: 12px;
  box-shadow: 0 3px 24px #0003;
}
#toggle-panel {
  display: none;
}
dialog {
  border: 0;
  background: #faf9f3;
  color: #26352b;
  padding: 40px;
  max-width: 620px;
  width: calc(100% - 32px);
  max-height: 90%;
  box-shadow: 0 20px 100px #0003;
}
dialog::backdrop {
  background: #13231dc0;
  backdrop-filter: blur(5px);
}
.close-dialog {
  float: right;
  font-size: 11px;
  padding: 0 0 20px 20px;
}
.eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 0;
}
dialog h1 {
  font-size: 36px;
  letter-spacing: -1.5px;
  line-height: 1.1;
  font-weight: 400;
  margin: 40px 0 24px;
}
dialog h2 {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.3px;
  margin: 27px 0 10px;
}
dialog p,
dialog li {
  font-size: 12px;
  line-height: 1.8;
  color: #60665c;
}
dialog ul {
  padding-left: 18px;
}
#plan-dialog {
  max-width: 780px;
}
#plan-image {
  width: 100%;
  height: auto;
}
.measure-label {
  position: absolute;
  padding: 8px 12px;
  background: #26352b;
  color: #fff;
  font-size: 12px;
  pointer-events: none;
}
.error-link {
  color: #874331;
  text-decoration: underline;
}
@media (max-width: 700px) {
  header {
    height: 56px;
    padding: 0 16px;
    gap: 12px;
  }
  .wordmark {
    font-size: 23px;
  }
  .wordmark span {
    font-size: 8px;
    letter-spacing: 2px;
  }
  .header-note {
    display: none;
  }
  #scope {
    font-size: 10px;
  }
  .panel {
    top: 103px;
    left: 12px;
    width: 225px;
    padding: 17px;
    max-height: calc(100% - 152px);
    overflow: auto;
  }
  .panel-label {
    font-size: 8px;
    margin-bottom: 8px;
  }
  .second {
    margin-top: 16px;
  }
  .select-label {
    margin-top: 12px;
  }
  .options {
    margin: 16px 0;
    gap: 10px;
  }
  .panel-actions {
    padding-top: 10px;
  }
  #selection {
    font-size: 9px;
    padding-top: 10px;
    margin-top: 10px;
    min-height: 0;
  }
  .bottom-bar {
    padding: 10px 14px;
    font-size: 9px;
  }
  .bottom-bar #scale {
    display: none;
  }
  #toggle-panel {
    display: block;
    position: absolute;
    top: 68px;
    left: 12px;
    background: #faf9f3ed;
    padding: 10px 14px;
    font-size: 10px;
    border: 1px solid #25302030;
  }
  .panel.collapsed {
    display: none;
  }
  #walk-controls {
    right: 12px;
    bottom: 55px;
  }
  #stairs {
    bottom: 180px;
    left: auto;
    right: 16px;
    transform: none;
    font-size: 11px;
    padding: 12px 16px;
  }
  dialog {
    padding: 25px;
  }
  dialog h1 {
    font-size: 30px;
  }
  #status {
    inset: 56px 0 0;
    font-size: 16px;
  }
}

/* Controls and model occupy separate regions; the camera fits the model region. */
#viewport { inset: 65px 0 42px 310px; }
.panel { top: 65px; left: 0; bottom: 42px; width: 310px; max-height: none; box-shadow: none; border: 0; border-right: 1px solid #26352b20; }
.level-guide { font-size: 11px; line-height: 1.6; color: #535c52; margin: 18px 0 8px; }
.connected-level { display: block; text-align: left; font-size: 11px; line-height: 1.5; color: #874331; text-decoration: underline; text-underline-offset: 3px; }
.connected-level[hidden] { display: none; }
@media (min-width: 701px) { #stairs { left: calc(50% + 155px); } }
@media (max-width: 700px) {
  #viewport { inset: 56px 0 42px; }
  .panel { top: auto; bottom: 42px; left: 0; width: 100%; height: min(48vh, 330px); max-height: none; border-top: 1px solid #26352b30; padding: 16px 20px; }
  body:has(.panel:not(.collapsed)) #viewport { bottom: calc(min(48vh, 330px) + 42px); }
  #toggle-panel { z-index: 2; }
  .level-guide { font-size: 10px; }
}

.plan-room-labels{position:absolute;inset:0;z-index:2;pointer-events:none;overflow:hidden}
.plan-room-labels[hidden],.plan-room-label[hidden]{display:none}
.plan-leaders{position:absolute;inset:0;width:100%;height:100%;overflow:hidden}
.plan-leaders>path{fill:none;stroke:#526155;stroke-width:1;opacity:.8}
.plan-room-label{position:absolute;transform:translateY(-50%);padding:4px 0;color:#25332b;font-size:10px;line-height:1.3;font-weight:550;background:#e6e5dfee}
@media(max-width:700px){.plan-room-label{font-size:9px}}

#walk-controls button { display: inline-grid; place-items: center; touch-action: none; }
@media (max-width: 700px) {
  .panel button, .panel select, #toggle-panel { min-height: 44px; }
  .panel select { font-size: 16px; }
  .panel .segments button { font-size: 12px; }
  #walk-controls button { min-width: 44px; min-height: 44px; }
  .bottom-bar { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
