:root{font-family:"Segoe UI",Arial,sans-serif;color:#213c37;background:#f5f4ee;--paper:#faf9f4;--ink:#203e38;--rule:#c9cec4;--side:clamp(16px,3.3vw,52px)}
*{box-sizing:border-box}body{margin:0;height:100vh;height:100dvh;display:grid;grid-template-rows:auto 1fr auto;overflow:hidden}button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation}button:focus-visible,canvas:focus-visible{outline:3px solid #397c92;outline-offset:-3px}[hidden]{display:none!important}
header,nav{display:flex;align-items:center;padding:13px var(--side);gap:18px;background:var(--paper);z-index:2}header{justify-content:space-between;border-bottom:1px solid var(--rule)}
.identity{display:flex;align-items:center;gap:12px}.housemark{display:grid;place-items:center;width:43px;height:43px;background:var(--ink);border-radius:9px;color:var(--paper);font:36px/1 Georgia,serif;padding-bottom:5px}h1,h2,h3,p{margin:0}h1{font:600 21px/1.14 Georgia,serif;letter-spacing:-.6px}.identity p{font-size:12px;color:#5c6a61;margin-top:4px}#helpButton,#closeDrawer{width:42px;height:42px;background:transparent;border:1px solid var(--rule);border-radius:50%;font-size:17px}#closeDrawer{font-size:24px}
main{position:relative;overflow:hidden;min-height:0;background:#dedbd1}#scene{width:100%;height:100%;display:block;outline:none;touch-action:none;cursor:grab}#scene:active{cursor:grabbing}.readout{position:absolute;top:20px;left:var(--side);width:max-content;max-width:min(380px,calc(100% - 110px - 2 * var(--side) - 8px));pointer-events:none}.location{padding:12px 17px 13px;border:1px solid #d6d7cc;background:rgba(250,249,244,.96);border-radius:6px;pointer-events:none}.location span,.caption,.eye{color:#50635b;font-size:12px}.location span{text-transform:uppercase;font-size:10px;font-weight:700;letter-spacing:.12em}.location h2{font:normal clamp(21px,2.3vw,31px)/1.2 Georgia,serif;letter-spacing:-.5px}.location p{margin-top:3px;font-size:12px;line-height:1.3}#dimension{font-weight:600;white-space:pre-line}#roomSummary{color:#50635b}
#mini{position:absolute;right:var(--side);top:20px;background:var(--paper);border:1px solid var(--rule);border-radius:6px;width:110px;height:87px;padding:7px}svg{width:100%;height:100%;display:block}
#legend,#message,#measureBox{position:absolute;border-radius:6px;color:#fff;background:#213a34f5;padding:11px 14px;font-size:13px}#legend{position:static;width:fit-content;margin-top:6px;display:grid;gap:3px;padding:7px 10px;font-size:11px}#legend span:before{content:"";display:inline-block;width:9px;height:9px;margin-right:8px;border-radius:50%;border:1px solid #ffffff66}.measured:before{background:#427e73}.seen:before{background:#5d86b1}.guessed:before{background:#b88053}#legend small{font-size:10px;color:#e4e7df;margin-top:2px}#message,#measureBox{bottom:90px;left:50%;transform:translateX(-50%);width:max-content;max-width:min(440px,calc(100% - 26px));box-shadow:0 3px 15px #0002}#measureBox{display:flex;align-items:center;gap:16px}#measureText{font-size:12px;margin-top:3px}#resetMeasure{background:none;color:white;border:1px solid #a0b2aa;border-radius:4px;min-height:38px}
#joystick{width:84px;height:84px;position:absolute;bottom:20px;left:var(--side);border:1px solid #f9f9edc9;border-radius:50%;background:#233a334f;touch-action:none;user-select:none;cursor:move}#stick{position:absolute;left:calc(50% - 14px);top:calc(50% - 14px);width:28px;height:28px;background:#f7f6ebdb;border:1px solid #fff9;border-radius:50%}.arrow{position:absolute;left:calc(50% - 6px);color:white;font:16px Arial}.arrow.up{top:3px}.arrow.down{bottom:4px}.walkhint{position:absolute;right:var(--side);bottom:20px;border-radius:4px;padding:7px 10px;color:white;background:#233a33bf;font-size:12px;pointer-events:none}
nav{justify-content:center;border-top:1px solid var(--rule);padding-block:10px max(10px,env(safe-area-inset-bottom));gap:8px}nav button,.tabs button{display:flex;align-items:center;justify-content:center;gap:9px;border:1px solid var(--rule);border-radius:5px;background:transparent;min-height:44px;padding:8px 16px;font-size:14px;font-weight:600}nav button[aria-pressed=true],.tabs button[aria-pressed=true]{background:var(--ink);color:white;border-color:var(--ink)}.ic{font:22px/1 Georgia}.eye{margin-left:18px}.eye b{font-weight:600}
#drawer{position:fixed;inset:12px var(--side) 12px auto;margin:0;max-height:none;max-width:none;color:inherit;width:min(430px,calc(100% - 2 * var(--side)));background:var(--paper);border:1px solid var(--rule);border-radius:9px;box-shadow:0 10px 44px #253a303d;overflow:auto;overscroll-behavior:contain;padding:0 19px 18px}#drawer::backdrop{background:#17282240}.photoBtn{margin-top:8px;background:transparent;border:1px solid var(--rule);border-radius:5px;min-height:44px;padding:6px 12px;font-size:13px}.spanKey{font-size:12px;padding-bottom:8px;color:#50635b}.panelHead{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;background:var(--paper);z-index:1;padding:13px 0 10px}.panelHead h2{font:26px Georgia,serif}.tabs{display:flex;gap:6px}.tabs button{flex:1;font-size:13px;min-height:40px}#plan{margin:10px 0 0;height:clamp(145px,28vh,270px);background:#eeeee5;border:1px solid #dee0d6;border-radius:4px}.caption{display:flex;justify-content:space-between;gap:6px;padding:8px 0 12px}.caption span{white-space:nowrap}.roomBtn{display:flex;align-items:center;gap:10px;width:100%;background:none;border:0;border-top:1px solid #d8dcd0;text-align:left;min-height:44px;padding:7px 3px}.roomBtn b{border-radius:50%;background:#e3e7dc;min-width:24px;height:24px;display:grid;place-items:center;font-size:11px}.roomBtn span{margin-left:auto;text-align:right;color:#5f6b60;font-size:11px}#helpPanel h3{font:20px Georgia;margin:16px 0 7px}#helpPanel p{font-size:14px;line-height:1.55;margin-bottom:10px}#failure{position:absolute;inset:35% 5% auto;padding:20px;background:var(--paper)}
@media(max-width:560px){header{padding-block:9px}.housemark{width:34px;height:34px;font-size:28px}h1{font-size:18px}.identity{gap:9px}.identity p{font-size:11px}#mini{width:70px;height:61px;top:13px}.readout{top:13px;max-width:calc(100% - 70px - 2 * var(--side) - 8px)}.location{padding:7px 10px}.location h2{font-size:20px}#roomSummary{font-size:11px}nav{justify-content:space-evenly;gap:3px;padding-inline:8px}.eye{display:none}nav button{font-size:13px;padding:7px 9px;gap:6px}.ic{font-size:18px}#joystick{bottom:15px;width:75px;height:75px}.walkhint{font-size:11px;bottom:16px}#drawer{inset:7px 8px;width:auto;padding-inline:15px}#message,#measureBox{bottom:100px}}
@media(max-height:470px){header{padding-block:4px}.identity p{display:none}#mini{height:50px}.readout{top:8px}.location h2{font-size:18px}.location p{margin-top:2px}nav{padding-block:3px}.walkhint{display:none}#joystick{height:56px;width:56px;bottom:8px}}
@media(min-height:600px){#plan{height:clamp(270px,42vh,360px)}}
body{padding-inline:env(safe-area-inset-left) env(safe-area-inset-right)}
header,nav{--bar-padding:10px}
header{--bar-padding:13px;padding-top:max(var(--bar-padding),env(safe-area-inset-top))}
nav{padding-bottom:max(var(--bar-padding),env(safe-area-inset-bottom))}
/* Keep the native dialog scrollport inside the safe area in either orientation. */
#drawer{--drawer-gap:12px;--drawer-top:max(var(--drawer-gap),env(safe-area-inset-top));--drawer-bottom:max(var(--drawer-gap),env(safe-area-inset-bottom));top:var(--drawer-top);bottom:var(--drawer-bottom);right:max(var(--side),env(safe-area-inset-right));max-height:calc(100vh - var(--drawer-top) - var(--drawer-bottom));max-height:calc(100dvh - var(--drawer-top) - var(--drawer-bottom))}
@media(max-width:560px){header{--bar-padding:9px}#drawer{--drawer-gap:7px;left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right))}}
@media(max-height:470px){header{--bar-padding:4px}nav{--bar-padding:3px}}
@media(pointer:coarse){#helpButton,#closeDrawer{width:44px;height:44px;flex:none}.tabs button,#resetMeasure{min-height:44px}#resetMeasure{min-width:44px}}
@media(max-width:340px){nav button{padding-inline:6px;gap:4px}}
#showerDoorButton{pointer-events:auto;min-height:44px;margin-top:4px;font-size:12px}
#roomDetails{pointer-events:auto;font-size:12px;color:#50635b;margin-top:4px}#roomDetails summary{cursor:pointer;line-height:1.6}#roomDetails[open]{max-width:29em}.evidenceAxis{display:flex;gap:4px;pointer-events:auto;margin-bottom:5px}.evidenceAxis button{border:1px solid #91a29a;border-radius:4px;background:transparent;color:#fff;min-height:44px;padding:5px 12px}.evidenceAxis [aria-pressed=true]{background:#edf1e9;color:#203e38}#message{white-space:pre-line;line-height:1.45;max-height:48%;overflow:auto}
@media(pointer:coarse) and (max-width:560px){nav button{flex:1;flex-direction:column;min-width:0;gap:3px;padding:5px 1px;font-size:12px}.location{min-width:138px}.walkhint{max-width:calc(100% - 125px);text-align:center}}
@media(max-height:470px){.readout{max-width:48%}.location{padding:4px 9px}#roomDetails:not([open]){font-size:11px;margin-top:0}}
.personIcon{width:18px;height:20px;flex:none}#figureKey{color:#56655e;font-size:12px}
.headerTools{display:flex;align-items:center;gap:8px;flex:none}
#daylightButton{display:flex;align-items:center;gap:6px;min-height:44px;padding:5px 10px;border:1px solid var(--rule);border-radius:5px;background:#edf1e7;font-size:12px;font-weight:600}
#daylightButton>span:first-child{font-size:17px;color:#705d29}
.sunCaption{display:grid;text-align:left;gap:1px}.sunCaption small{font-size:10px;font-weight:500;color:#536359}
#daylightPanel{padding-top:5px}
#daylightPanel p{font-size:14px;line-height:1.45;color:#50635b}
#daylightPanel h3{font:22px Georgia,serif;margin:19px 0 9px}
#lightPresets{display:flex;flex-wrap:wrap;gap:6px;margin:13px 0}
#lightPresets button,#windowViews button,.primaryBtn{background:transparent;border:1px solid var(--rule);border-radius:5px;min-height:44px;padding:7px 12px;font-size:13px}
#windowViews{display:grid;gap:6px}#windowViews button{text-align:left}
.timeFields{display:grid;grid-template-columns:3fr 2fr;gap:9px}
.timeFields label{display:grid;gap:4px;font-size:12px;color:#50635b;font-weight:600}
.timeFields input{box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:6px 8px;border:1px solid var(--rule);border-radius:5px;background:white;color:var(--ink);font:inherit;font-size:16px}
#daylightPanel #sunReadout{font-size:12px;margin:9px 0}
#daylightPanel .sunCaveat{font-size:12px;margin:0 0 10px}
.primaryBtn{background:var(--ink);color:white;font-weight:600}
#neutralLight{margin-top:9px}
.outlookNotes{margin:14px 0 0}.outlookNotes summary{font-size:13px;line-height:44px;cursor:pointer}
.outlookNotes p{margin:5px 0 10px}
.glassOption{display:flex;align-items:center;gap:6px;min-height:36px;cursor:pointer;pointer-events:auto}.glassOption input{accent-color:#406f60}
.evidenceKeys{display:grid;gap:3px}.evidenceKeys i{font-style:normal}
.proposed:before{background:#a66eb8}
@media(max-width:430px){.readout:has(#legend:not([hidden])) #primaryStagingButton{display:none}}
@media(pointer:coarse){.glassOption{min-height:44px}}
@media(max-width:430px){.evidenceKeys{display:flex;flex-wrap:wrap;gap:6px}.evidenceKeys i{display:none}#legend .evidenceKeys span:before{width:7px;height:7px;margin-right:3px}}
@media(max-width:430px){header{gap:7px}.headerTools{gap:5px}#daylightButton{gap:3px;padding-inline:6px;font-size:11px}.identity{min-width:0}.identity h1{font-size:16px}}
@media(max-width:350px){.housemark{display:none}.headerTools{gap:4px}}
#guestFitButton{pointer-events:auto;min-height:44px;margin-top:4px;padding:4px 10px;border:1px solid var(--rule);border-radius:5px;background:#edf1e7;font-size:12px;font-weight:600}
@media(max-width:430px){.readout:has(#legend:not([hidden])) #guestFitButton{display:none}}
#guestFitPanel p{font-size:13px;line-height:1.45;color:#50635b;margin-bottom:9px}
#guestPrintedSize{font-weight:600}
#guestFitPanel .tabs{margin:12px 0 8px}
#guestFitPanel .tabs button{min-height:44px}
#guestFitDiagram{height:auto;background:#f2f0e8;border:1px solid #dee0d6;border-radius:5px}
#guestFitDiagram text{font-size:.23px;fill:var(--ink)}
#guestFitDiagram .guestBedLabel{font-weight:600}
.guestFloor{fill:#e6dfd1}
.guestHeadroom{fill:#d1e1d2}
.guestWalls{fill:none;stroke:#586458;stroke-width:.035}
.guestEntry,.guestAttic,.guestWindow{stroke-width:.085}
.guestEntry,.guestAttic{stroke:#9e653e}
.guestWindow{stroke:#5a8793}
.guestFrame{fill:#356054}
.guestMattress{fill:#f8f6ef}
.guestFootLine{stroke:var(--ink);stroke-width:.026}
.guestFitKey{display:flex;align-items:center;gap:6px;margin-top:8px}
.guestFitKey span{width:14px;height:12px;background:#d1e1d2;border:1px solid #829989}
.guestFitNumbers{margin:9px 0 12px;border-block:1px solid var(--rule);padding:8px 0;display:grid;gap:5px;font-size:13px}
.guestFitNumbers div{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 10px}
.guestFitNumbers dd{margin:0;font-weight:600}
#primaryStagingButton{pointer-events:auto;min-height:44px;margin-top:4px;padding:4px 10px;border:1px solid var(--rule);border-radius:5px;background:#edf1e7;font-size:12px;font-weight:600}
/* Short phone screens leave room beside the location card for the evidence controls. */
@media (orientation:landscape) and (max-height:470px) {
  .readout:has(#legend:not([hidden])) {
    display:grid;
    grid-template-columns:minmax(0,max-content) minmax(0,max-content);
    align-items:start;
    gap:6px;
    right:calc(var(--side) + 116px);
    bottom:8px;
    width:auto;
    max-width:none;
  }
  .readout:has(#legend:not([hidden])) .location {
    max-width:clamp(142px,27vw,260px);
    max-height:calc(100% - 62px);
    overflow:auto;
    pointer-events:auto;
  }
  #legend {margin-top:0;max-height:100%;overflow:auto;pointer-events:auto}
  #legend .evidenceKeys {grid-template-columns:repeat(2,max-content);gap:3px 8px}
  #legend .evidenceKeys i {display:none}
}
@media (orientation:landscape) and (max-height:350px) {
  .readout:has(#legend:not([hidden])) #primaryStagingButton {display:none}
}
