:root{font-family:-apple-system,BlinkMacSystemFont,'PingFang SC',sans-serif;color:#f8f3dc;background:#10130f;color-scheme:dark}*{box-sizing:border-box}body{margin:0;overflow:hidden}button,a,input,select{-webkit-tap-highlight-color:transparent}button,input,select{font:inherit}button{cursor:pointer;color:inherit}button:disabled{opacity:.5}button:focus-visible,a:focus-visible{outline:2px solid #e8c46a;outline-offset:4px}[hidden]{display:none!important}#camera,#render{position:fixed;inset:0;width:100%;height:100dvh}#camera{object-fit:cover}#render{pointer-events:none}#render canvas{display:block;width:100%;height:100%}header{position:fixed;top:0;left:0;right:0;z-index:5;display:flex;align-items:center;gap:15px;padding:calc(22px + env(safe-area-inset-top)) 24px 18px;background:linear-gradient(#0b100cca,transparent)}.title{font-size:14px;letter-spacing:2px}#status{font-size:10px;color:#ded8bcaa;margin-left:auto}#stop{border:0;background:#0004;border-radius:50%;width:32px;height:32px;font-size:24px}#start-screen{position:fixed;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:25px;background:radial-gradient(ellipse at 50% 62%,#5343192a,transparent 55%),#10130f}.mark-icon{font-size:56px;color:#dfbb69;font-weight:200}h1{font-size:23px;font-weight:400;letter-spacing:2px;margin:25px 0 10px}#start-screen p{font-size:13px;color:#999d8b;line-height:1.9;margin-bottom:30px}.primary{color:#1b2119;background:#e4c475;border:0;border-radius:5px;padding:15px 45px;font-size:14px}#start-screen a{color:#c4b888;text-underline-offset:5px;font-size:11px;margin-top:24px}#error{font-size:12px!important;color:#efaf84!important;max-width:350px;margin-bottom:0!important}#bottom{position:fixed;bottom:0;left:0;right:0;padding:30px 24px calc(24px + env(safe-area-inset-bottom));z-index:5;text-align:center;background:linear-gradient(transparent,#0b100caa)}#hint{font-size:12px;color:#f9edc0;text-shadow:0 1px 8px #000;margin:0 0 20px;letter-spacing:1px}.toolbar{display:flex;gap:14px;justify-content:center}.toolbar button{border:1px solid #f8e3a03f;background:#1720156b;backdrop-filter:blur(8px);border-radius:5px;padding:10px 22px;font-size:11px}#scan-guide{position:fixed;top:50%;left:50%;width:min(50vw,240px);aspect-ratio:1;transform:translate(-50%,-50%);pointer-events:none;opacity:.6}#scan-guide span{position:absolute;width:25px;height:25px;border-color:#d1c49a;border-style:solid;border-width:0}#scan-guide span:nth-child(1){left:0;top:0;border-left-width:1px;border-top-width:1px}#scan-guide span:nth-child(2){right:0;top:0;border-right-width:1px;border-top-width:1px}#scan-guide span:nth-child(3){right:0;bottom:0;border-right-width:1px;border-bottom-width:1px}#scan-guide span:nth-child(4){left:0;bottom:0;border-left-width:1px;border-bottom-width:1px}dialog{position:fixed;inset:auto 0 0;margin:0 auto;max-width:470px;width:100%;padding:25px 28px calc(28px + env(safe-area-inset-bottom));border:1px solid #a1946e44;border-radius:18px 18px 0 0;background:#171e18f5;color:#ded9bf;max-height:85dvh;overflow:auto}dialog::backdrop{background:#0005}.sheet-header{display:flex;align-items:center;justify-content:space-between}.sheet-header strong{font-size:14px;font-weight:500}.sheet-header button{border:0;background:none;font-size:25px;color:#a8aa96;padding:0}.small{font-size:11px;color:#979e85;margin:8px 0 25px}label{display:block;font-size:12px;margin-top:20px}input{display:block;width:100%;margin-top:13px;accent-color:#e0bd68}select{float:right;background:#202b21;border:1px solid #777d5b;border-radius:3px;color:#ded9bf;padding:4px;font-size:11px}#reset{width:100%;margin-top:24px;padding:11px;border:1px solid #777d5b66;background:none;color:#b9bd9b;border-radius:4px;font-size:11px}body.inspect #start-screen{display:none}

.toolbar{gap:8px}.toolbar button{padding:10px 16px}#pick-floor{position:fixed;inset:0;z-index:8;touch-action:none;cursor:crosshair}.pick-instructions{position:absolute;top:calc(85px + env(safe-area-inset-top));left:20px;right:20px;padding:15px;background:#142015d9;border:1px solid #e4c47555;border-radius:7px;text-align:center;pointer-events:none}.pick-instructions strong{font-size:14px;font-weight:500;color:#f4d88c}.pick-instructions p{font-size:11px;line-height:1.8;color:#cad0ba;margin:10px 0 0}#pick-cancel{position:absolute;bottom:calc(28px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);padding:12px 30px;border:1px solid #d6c58d88;border-radius:6px;background:#16251adc;backdrop-filter:blur(8px);font-size:12px}body.placing #bottom{visibility:hidden}#place-floor{border-color:#e5c26a99;color:#f6db8b}#pick-from-settings{display:block;width:100%;padding:12px 16px;border:1px solid #d7be7255;background:#d3b65b1f;color:#e7cb80;border-radius:5px;font-size:12px}

.toolbar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;max-width:470px;margin:auto}.toolbar button{padding:11px 5px;white-space:nowrap;font-size:10px}/* A single active slider keeps the house visible during calibration. */
.house-settings.compact-dock{z-index:12;inset:auto 8px calc(8px + env(safe-area-inset-bottom));margin:0 auto;width:calc(100% - 16px);max-width:440px;padding:8px 12px;border-radius:11px;max-height:38dvh;background:#142019db;backdrop-filter:blur(9px);box-shadow:0 5px 24px #0003;overflow:auto}
.dock-head{display:flex;align-items:center;gap:8px;min-height:34px}.dock-head strong{font-size:12px;font-weight:500;white-space:nowrap}.dock-head select{float:none;min-width:64px;max-width:92px;font-size:12px;padding:6px 18px 6px 7px;border:1px solid #93ad7844;background:#223025;border-radius:5px;margin:0}.dock-head output{flex:1;min-width:49px;color:#b8e2c8;font-size:11px;white-space:nowrap}.dock-head button{border:0;background:none;padding:8px 3px;font-size:11px;color:#a9b99e;white-space:nowrap}.dock-head #house-done{background:#d2b65f22;border:1px solid #d7b76355;border-radius:5px;color:#f0d286;padding:7px 10px}
.dock-slider{display:flex;align-items:center;gap:9px;height:41px}.dock-slider>button{width:30px;height:32px;flex:0 0 30px;border:1px solid #9caf8055;background:#15271b66;border-radius:5px;font-size:19px;line-height:1;color:#dce4c8;padding:0}.house-grid{display:block;flex:1;min-width:0;margin:0}.house-grid label{margin:0}.house-grid input{width:100%;margin:0;height:30px;accent-color:#e0bd68;cursor:ew-resize}.dock-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:30px}.dock-actions>button{background:none;border:0;color:#a7d9be;font-size:10px;padding:7px 0;white-space:nowrap}.dock-actions #house-options{color:#b3b99e;margin-left:auto}.dock-actions label{display:flex;align-items:center;gap:5px;font-size:10px;margin:0;white-space:nowrap}.dock-actions input{display:inline-block;width:14px;height:14px;margin:0;accent-color:#dfc26a}.compact-dock #house-extra{border-top:1px solid #9ca98133;padding-top:8px;margin-top:6px}.compact-dock .small{margin:0 0 8px;font-size:10px;line-height:1.7}.fit-button{display:block;width:100%;padding:9px;border:1px solid #86c6aa55;background:#2e6b512f;border-radius:5px;font-size:10px;color:#b8f3d9}.secondary-fit{background:none;color:#d8c489;border-color:#a48d4e55}.house-footnote{font-size:9px;color:#85947d;line-height:1.7;margin:8px 0 0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:350px){.house-settings.compact-dock{padding:7px 9px}.dock-head{gap:6px}.dock-head strong{font-size:11px}.dock-head select{min-width:59px;max-width:70px;padding-left:5px;font-size:11px}.dock-head output{font-size:10px;min-width:43px}.dock-head #house-done{padding:7px 8px}.dock-actions{gap:8px}}
body.house-adjusting #bottom{visibility:hidden}.inspect-tools{position:fixed;top:75px;right:16px;z-index:7;display:flex;gap:7px}.inspect-tools button{font-size:10px;padding:8px 11px;border:1px solid #bcdda855;background:#15251bba;border-radius:4px}

.backup-actions{display:flex;gap:8px;margin:8px 0}.backup-actions button{flex:1;padding:8px;border:1px solid #86c6aa55;background:none;border-radius:5px;color:#b8e2c8;font-size:10px}.compact-dock #calibration-status{margin-bottom:6px}

.roof-editor{position:fixed;inset:0;z-index:11;pointer-events:none}#roof-guides{position:absolute;inset:0;width:100%;height:100%;overflow:visible}#roof-handle-lines{fill:none;stroke:#e4c47599;stroke-width:1;stroke-dasharray:5 5}.roof-handle{position:absolute;transform:translate(-50%,-50%);width:27px;height:27px;padding:0;border:2px solid #e4c475;border-radius:50%;background:#142019db;color:#fff3c7;font-size:11px;pointer-events:auto;touch-action:none;cursor:grab;box-shadow:0 0 0 5px #0002;user-select:none}.roof-handle[data-index="0"],.roof-handle[data-index="3"],.roof-handle[data-index="6"]{background:#dfbd68;color:#172218}.roof-handle:active{cursor:grabbing;background:#f8d679;color:#172218}.roof-edit-bar{position:absolute;bottom:calc(10px + env(safe-area-inset-bottom));left:8px;right:8px;margin:auto;max-width:440px;display:flex;gap:8px;align-items:center;padding:9px 12px;border:1px solid #d1ba6744;border-radius:9px;background:#132019e6;pointer-events:auto;backdrop-filter:blur(9px)}.roof-edit-bar>div{flex:1;min-width:0}.roof-edit-bar strong{display:block;font-size:12px;font-weight:500}.roof-edit-bar span{display:block;margin-top:5px;font-size:10px;color:#b0c4ad}.roof-edit-bar button{font-size:11px;padding:8px;border:1px solid #e4c47555;border-radius:4px;background:none;color:#e4c475;white-space:nowrap}body.roof-editing #bottom,body.roof-editing .inspect-tools{visibility:hidden}#roof-edit-open{margin-bottom:8px}

.character-toggle{display:flex;gap:6px;align-items:center;font-size:11px;margin:0 0 7px}.character-toggle input{width:14px;height:14px;margin:0}

.story-confirm{display:block;margin:0 auto 13px;padding:10px 26px;border:1px solid #edd19988;border-radius:22px;background:#3a3425e8;color:#ffe8b1;font-size:13px;box-shadow:0 3px 18px #0002}.story-confirm:disabled{opacity:.4}#bottom[data-story-phase="window"] #hint{margin-bottom:12px}
.sound-toggle{flex-shrink:0;border:1px solid #e5cd8755;background:#18211999;border-radius:16px;padding:7px 10px;color:#ead59a;font-size:10px}.sound-toggle[aria-pressed="false"]{color:#aeb3a0}
header{gap:8px}.title,#stop{flex-shrink:0}#status{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right}

/* The window confirmation is the primary action in step two. */
.story-open-help{display:none;margin:0 auto 13px;max-width:340px;color:#f4e9c8;font-size:12px;line-height:1.5;text-shadow:0 1px 6px #000}
#bottom[data-story-phase="window"] .story-open-help{display:block}
#bottom[data-story-phase="window"] #hint{font-size:14px;line-height:1.5;letter-spacing:.2px;margin-bottom:7px}
.story-confirm{display:flex;align-items:center;justify-content:center;gap:12px;width:min(100%,360px);min-height:58px;margin:0 auto 18px;padding:15px 19px;border:1px solid #fff0b3;border-radius:15px;background:linear-gradient(135deg,#fff0b3,#e6bf62);color:#28301b;font-size:16px;font-weight:650;box-shadow:0 4px 24px #e7c15a55,0 2px 6px #0005;animation:window-ready 2.8s ease-in-out infinite}
.story-check{display:grid;place-items:center;flex:0 0 25px;width:25px;height:25px;border:1px solid #3d482b80;border-radius:50%;font-size:15px}.story-next{font-size:21px;margin-left:auto}.story-confirm:active{background:#fff0bd;transform:translateY(1px)}
#bottom[data-story-phase="window"] .toolbar button{background:#14201899;color:#d4d6be;border-color:#f8e3a02a}
@keyframes window-ready{0%,100%{box-shadow:0 4px 20px #e7c15a40,0 2px 6px #0005}50%{box-shadow:0 4px 30px #e7c15a80,0 0 0 4px #e7c15a14}}
.dock-head strong{display:none}.dock-head select{flex:1;min-width:0;max-width:none}.dock-head output{flex:0 0 auto;min-width:57px}.dock-head{gap:7px}
@media(max-width:350px){.story-confirm{font-size:14px;gap:8px;padding:14px 13px}.dock-head select{min-width:0;max-width:none}.dock-head button{font-size:10px}.dock-head output{min-width:49px}}
@media(prefers-reduced-motion:reduce){.story-confirm{animation:none;transition:none}}

.marker-preview{width:168px;height:110px;object-fit:cover;object-position:50% 80%;border-radius:12px;border:1px solid #e4c47555;margin-top:14px}.flower-marker .mark-icon{display:none}.flower-marker #scan-guide{aspect-ratio:660/445;top:64%}#fence-width-value{float:right;color:#e4c475}#fence-measurement .small{display:block;margin:10px 0 0;line-height:1.5}

.photo-check-background{position:fixed;inset:0;width:100%;height:100dvh;object-fit:cover;z-index:0}body.photo-check #render{z-index:1}

.upright-controls{margin-top:18px;padding:14px;border:1px solid #e4c47555;border-radius:10px}.upright-controls button{width:100%;padding:12px;background:#ddbd70;color:#172014;border:0;border-radius:7px;font-size:13px}.upright-controls .small{margin:10px 0 0;line-height:1.6}

.upright-start{border:0;background:none;color:#c4b888;font-size:11px;text-decoration:underline;text-underline-offset:5px;margin-top:20px;padding:4px}

#performance-panel{position:fixed;z-index:30;top:76px;left:12px;width:min(330px,calc(100vw - 24px));max-height:54vh;overflow:auto;padding:12px;background:#101710ed;border:1px solid #b9ce9166;border-radius:10px;font:11px ui-monospace,monospace;color:#e8efdb}#performance-panel summary{cursor:pointer}#performance-panel p{line-height:1.5}#performance-panel button{border:1px solid #e2c57899;background:#25311f;border-radius:5px;padding:8px;font-size:11px}#performance-report{white-space:pre-wrap;line-height:1.45}
