:root {
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #242a27;
  background: #eeede7;
  font-size: 16px;
  line-height: 1.45;
  color-scheme: light;
  --line: #d7d9cf;
  --muted: #555e55;
  --ink: #242a27;
  --green: #405648;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled { cursor: default; }
:focus-visible { outline: 2px solid #477f62; outline-offset: 3px; }

.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner, .workspace { width: min(100% - 4rem, 88rem); margin-inline: auto; }
.masthead-inner { min-height: 4.15rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.project { display: flex; align-items: center; gap: .7rem; font-weight: 680; letter-spacing: -.02em; }
.project-mark {
  width: 1.6rem; height: 1.6rem; display: inline-block; position: relative;
  background: var(--green); border-radius: 3px; flex: none;
}
.project-mark::before {
  content: ""; position: absolute; inset: 5px; border: 1px solid #eef0e6;
  border-top: 0; transform: skewY(-9deg);
}
.project-mark::after {
  content: ""; position: absolute; left: 6px; top: 5px; width: 12px;
  border-top: 1px solid #eef0e6; transform: rotate(-12deg);
}
.revision { color: var(--muted); font-size: .875rem; text-align: right; font-variant-numeric: tabular-nums; }
.revision.ready::before { content: ""; display: inline-block; vertical-align: .12em; width: .45rem; height: .45rem; border-radius: 50%; background: #477859; margin-right: .5em; }
.workspace { padding-block: 1.8rem 2rem; }
.page-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1.2rem; }
h1 { font-size: clamp(1.85rem, 3.8vw, 3rem); line-height: 1.05; font-weight: 650; letter-spacing: -.055em; margin: 0; }
.view-picker { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; padding: 3px; background: #e5e6dd; gap: 3px; }
.view-picker button {
  border-radius: 4px; border: 1px solid transparent; background: transparent;
  padding: .48rem .86rem; font-size: .875rem; line-height: 1.3; color: var(--muted); white-space: nowrap;
}
.view-picker button[aria-pressed="true"] { color: var(--ink); background: #faf9f4; border-color: #d7dacf; font-weight: 650; }
.view-picker button:hover:not([aria-pressed="true"]) { background: #f0f0e7; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; align-items: start; gap: 1.5rem; }
.viewer { overflow: hidden; border-radius: 9px; background: #202a2b; color: #eef0e9; }
.viewport { position: relative; isolation: isolate; height: clamp(30rem, calc(100svh - 14rem), 54rem); background: #303c3d; }
.canvas-layer { position: absolute; inset: 0; }
canvas { width: 100%; height: 100%; display: block; cursor: grab; }
canvas:active { cursor: grabbing; }
.canvas-layer canvas:focus-visible { outline-offset: -3px; outline-color: #b4d4bd; }
.viewer-message {
  z-index: 1; position: absolute; inset: 0; padding: 2rem;
  display: grid; place-items: center; text-align: center; margin: 0; color: #f0f0e6;
  pointer-events: none;
}
.camera-tools { position: absolute; top: .75rem; left: .75rem; display: flex; gap: .35rem; }
.camera-tools button {
  border: 1px solid #687372; border-radius: 4px; background: #253133;
  padding: .41rem .7rem; color: #f1f2ed; font-size: .875rem; min-height: 2.4rem;
}
.camera-tools button:hover { background: #425052; }
.camera-tools button:focus-visible { outline-color: #b4d4bd; }
.viewer-footer {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap;
  min-height: 2.75rem; padding: .55rem .9rem; color: #ccd2cb; font-size: .875rem;
}
#view-label { font-weight: 650; color: #f1f2ee; }
.separator { padding-inline: .15rem; }
.controls { border-top: 1px solid #aab3a7; }
.control-section { padding-block: .9rem; border-bottom: 1px solid var(--line); }
.section-heading { display: block; font-size: .95rem; font-weight: 680; margin: 0 0 .55rem; letter-spacing: -.014em; }
select {
  width: 100%; padding: .56rem .65rem; min-height: 2.6rem;
  color: var(--ink); border: 1px solid #bec4b8; border-radius: 5px; background: #f7f6f0;
  font-size: .875rem;
}
.layer-list { display: grid; gap: .08rem; }
.layer-list label, .cut-toggle {
  display: grid; align-items: center; grid-template-columns: .6rem 1fr auto; gap: .55rem;
  min-height: 2rem; font-size: .875rem; cursor: pointer;
}
.layer-list input, .cut-toggle input { margin: 0; height: 1rem; width: 1rem; accent-color: var(--green); cursor: pointer; }
.swatch { width: .55rem; height: .55rem; border-radius: 2px; background: #aeb1a8; }
.shell { background: #747e72; }
.ceiling { background: #b0b4a5; }
.furnishings { background: #9c7861; }
.electrical { background: #a86123; }
.water { background: #527b97; }
.drainage { background: #557958; }
.fixtures { background: #887693; }
.references { background: #a89762; }
.gates { background: #3d4644; }
.cut-toggle { display: flex; justify-content: space-between; min-height: 1.5rem; margin-bottom: .5rem; }
.cut-toggle .section-heading { margin-bottom: 0; }
.range-label { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .875rem; color: var(--muted); }
output { color: var(--ink); font-variant-numeric: tabular-nums; }
input[type="range"] { accent-color: var(--green); display: block; width: 100%; margin: .45rem 0 0; min-height: 1.5rem; }
.trade-note { font-size: .875rem; color: var(--muted); margin: .8rem 0 0; }

@media (max-width: 800px) {
  .masthead-inner, .workspace { width: calc(100% - 2rem); }
  .layout { grid-template-columns: 1fr; gap: 1rem; }
  .viewport { height: clamp(22rem, 60svh, 40rem); }
  .controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; }
  .controls .control-section:nth-child(2) { grid-row: span 2; }
  .trade-note { grid-column: 1 / -1; }
}

@media (max-width: 460px) {
  .masthead-inner, .workspace { width: calc(100% - 1.5rem); }
  .masthead-inner { min-height: 3.55rem; }
  .revision { font-size: .78rem; max-width: 50%; }
  .workspace { padding-top: 1rem; }
  .page-heading { align-items: start; flex-direction: column; gap: .75rem; margin-bottom: .8rem; }
  .viewport { height: clamp(19rem, 54svh, 34rem); }
  .viewer-footer { font-size: .8rem; }
  .controls { display: block; }
  .layer-list label { min-height: 2.45rem; }
}

.camera-tools button[aria-pressed="true"] {
  background: #4a6956;
  border-color: #93ad9a;
}
.camera-tools button:disabled { opacity: .6; }
.walking canvas, .walking canvas:active { cursor: crosshair; }
.walk-pad {
  position: absolute; bottom: .85rem; left: .85rem;
  display: grid; grid-template-columns: repeat(3, 2.75rem); gap: .25rem;
  user-select: none; touch-action: none;
}
.walk-pad > svg { position: absolute; }
.walk-pad button {
  display: grid; place-items: center; min-width: 0; height: 2.75rem; padding: 0;
  color: #f1f2ed; background: #253133; border: 1px solid #687372; border-radius: 5px;
  touch-action: none;
}
.walk-pad button:hover { background: #425052; }
.walk-pad button:active { background: #4a6956; border-color: #93ad9a; }
.walk-pad button:focus-visible { outline-color: #b4d4bd; }
.walk-pad button svg { width: 1.25rem; height: 1.25rem; }
.walk-pad [data-move="forward"] { grid-column: 2; }
.walk-pad [data-move="left"] { grid-column: 1; grid-row: 2; }
.walk-pad [data-move="left"] svg { rotate: -90deg; }
.walk-pad [data-move="back"] { grid-column: 2; grid-row: 2; }
.walk-pad [data-move="back"] svg { rotate: 180deg; }
.walk-pad [data-move="right"] { grid-column: 3; grid-row: 2; }
.walk-pad [data-move="right"] svg { rotate: 90deg; }
.walk-touch { display: none; }
@media (pointer: coarse) {
  .walk-touch { display: inline; }
  .walk-keyboard { display: none; }
}
