/* Exact placement controls live in an explicitly opened dialog. */
.precision-panel {
  flex-shrink: 0;
  min-width: 0;
  margin: 0;
  padding: 13px 18px 15px;
  border: 0;
  border-top: 1px solid #abb7a9;
  color: var(--ink);
  background: #edf0e8;
  text-align: left;
}
.precision-panel[hidden] { display: none !important; }
.precision-panel *, .precision-panel *::before, .precision-panel *::after { box-sizing: border-box; }
.precision-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
#precision-title { font-size: 16px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.precision-panel button, .precision-panel input, .precision-panel select {
  min-width: 0;
  min-height: 42px;
  border: 1px solid #9cab98;
  border-radius: 3px;
  color: var(--ink);
  background: #fafbf6;
  padding: 9px 11px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.25;
}
.precision-panel button { cursor: pointer; }
.precision-panel button:disabled { opacity: .45; cursor: not-allowed; }
.precision-panel button:hover:not(:disabled) { background: #dce4d6; border-color: #5b745e; }
.precision-panel button:focus-visible, .precision-panel input:focus-visible, .precision-panel select:focus-visible, .precision-link:focus-visible { outline: 3px solid #6b865e; outline-offset: 3px; }
.precision-panel #precision-close { min-height: 32px; width: 32px; padding: 0; font-size: 23px; flex-shrink: 0; background: transparent; border-color: transparent; }
.precision-position-row { display: flex; align-items: flex-end; gap: 9px; flex-wrap: wrap; }
.precision-panel label { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 12px; font-weight: 500; line-height: 1.35; }
.precision-position-row > label:first-child { flex: 1 1 182px; max-width: 230px; }
#precision-position { width: 100%; font-size: 17px; font-variant-numeric: tabular-nums; }
.precision-panel .precision-apply { background: #354f3e; color: #f5f6ed; border-color: #354f3e; font-weight: 600; }
.precision-panel .precision-apply:hover:not(:disabled) { color: #f5f6ed; background: #253e2d; }
.precision-nudge { display: flex; align-items: flex-end; gap: 5px; margin-left: auto; }
.precision-nudge label { width: 91px; }
.precision-nudge button { width: 42px; padding: 6px; font-size: 23px; }
.precision-panel .precision-snap-label { flex: 0 1 158px; }
.precision-snap-label select { width: 100%; }
#precision-reference { display: block; margin-top: 10px; color: var(--ink); font-size: 12px; line-height: 1.5; }
#precision-measurements { margin: 6px 0 0; color: var(--ink); font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums; }
#precision-feedback { margin: 6px 0 0; color: #6f3e22; font-size: 13px; line-height: 1.5; }
#precision-measurements:empty, #precision-feedback:empty { display: none; }
.precision-link { padding: 5px 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: inherit; font: inherit; font-size: 16px; line-height: 1.5; cursor: pointer; }
.clean-config .config-viewer:has(.precision-panel:not([hidden])) { height: min(880px, calc(100dvh - 24px)); min-height: 740px; }
.clean-config .config-viewer:has(.precision-panel:not([hidden])) #trailer-canvas { min-height: 330px; }
@media (max-width: 700px) {
  .precision-panel { padding: 12px; }
  #precision-title { font-size: 15px; }
  .precision-position-row { gap: 10px 8px; }
  .precision-position-row > label:first-child { flex: 1 1 160px; max-width: none; }
  .precision-nudge { margin-left: 0; flex: 1 1 auto; }
  .precision-panel .precision-snap-label { flex: 1 1 135px; }
  .precision-panel input, .precision-panel select { font-size: 16px; }
  .precision-panel button { min-height: 44px; }
  .precision-nudge button { width: 44px; }
  .clean-config .config-viewer:has(.precision-panel:not([hidden])) { height: auto; min-height: 0; max-height: none; }
  .clean-config .config-viewer:has(.precision-panel:not([hidden])) #trailer-canvas { flex: none; height: 300px; min-height: 300px; }
  .clean-config .config-viewer:has(.precision-panel:not([hidden])) #floorplan-view { flex: none; height: 310px; }
}

@media (max-width: 700px) {
  body.clean-config .header-call .call-text { font-size: 16px; }
  body.clean-config .header-call .call-text::after { content: none; }
}
/* Height controls stay in a focused dialog to keep the 3D viewport quiet. */
.selected-height-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px;border-top:1px solid #bdc7b7;padding-top:10px;font-size:13px;line-height:1.4}
.selected-height-row button{flex-shrink:0}
.height-sheet{box-sizing:border-box;width:min(760px,calc(100vw - 28px));max-height:90dvh;overflow:auto;border:1px solid #9bab99;background:#eef0e7;color:var(--ink);padding:30px;font:inherit}
.height-sheet::backdrop{background:#12232099;backdrop-filter:blur(5px)}
.height-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.height-sheet h2{font-size:clamp(25px,4vw,34px);line-height:1.15;margin:8px 0 16px}
.height-sheet h3{font-size:21px;margin:0 0 16px}
.height-sheet p{font-size:16px;line-height:1.55}
.height-sheet form{border-top:1px solid #b1bda8;padding-top:22px;margin-top:24px}
.height-sheet label{display:flex;flex-direction:column;gap:7px;font-size:15px;line-height:1.4}
.height-inputs{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.height-sheet input,.height-sheet select,.height-sheet button{font:inherit;font-size:16px;min-height:46px;padding:10px 12px;border:1px solid #a0af99;background:#fffef6;color:inherit;border-radius:3px;box-sizing:border-box;max-width:100%}
.height-sheet input,.height-sheet select{width:100%;min-width:0}
.height-sheet button{cursor:pointer}
.height-sheet button:focus-visible,.height-sheet input:focus-visible,.height-sheet select:focus-visible{outline:3px solid #739355;outline-offset:3px}
.height-sheet fieldset{border:0;margin:16px 0 0;padding:0;min-width:0}
.height-sheet .height-checkbox{flex-direction:row;align-items:center;margin-top:18px;gap:10px}
.height-checkbox input{width:20px;height:20px;min-height:20px;flex-shrink:0;accent-color:#354f3e}
.height-sheet .height-primary{background:#354f3e;color:#fffef6;font-weight:600}
.height-sheet .height-text-button{background:transparent;border:0;border-bottom:1px solid currentColor;padding:6px 0;margin-top:10px}
.height-sheet .height-small{font-size:13px;line-height:1.5;color:var(--ink)}
.height-sheet .height-note{border-top:1px solid #b1bda8;padding-top:16px}
#height-close{font-size:26px;line-height:1;padding:4px 12px;background:transparent}
#height-tap-label{margin-top:16px;max-width:330px}
#height-tap-label[hidden]{display:none}
#height-feedback{color:#813a26;font-weight:600}
#height-feedback:empty{display:none}
.height-sheet :disabled{opacity:.55}
@media(max-width:700px){.height-sheet{padding:20px}.height-inputs{grid-template-columns:1fr}.selected-height-row{flex-wrap:wrap}}
.height-sheet .height-small{margin:10px 0 16px}
.height-heading{position:sticky;top:-30px;z-index:2;background:#eef0e7;padding:8px 0}
@media(max-width:700px){.height-heading{top:-20px}}
.config-fullscreen-bar{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;background:#edf0e8;border-bottom:1px solid #a9b3a5;color:var(--ink);flex-shrink:0;font-size:14px}
.config-fullscreen-bar button{padding:9px 15px;min-height:44px;border:1px solid #8d9f88;background:#354f3e;color:#fffef6;font:inherit;font-weight:600;cursor:pointer}
.config-fullscreen-bar button:focus-visible{outline:3px solid #a7ce57;outline-offset:3px}
body.config-fullscreen{overflow:hidden!important;overscroll-behavior:none}
.clean-config .configurator.is-fullscreen{position:fixed;inset:0;z-index:10000;width:100%;height:100dvh;max-height:100dvh;margin:0;border:0;display:grid;grid-template-columns:minmax(0,1fr) 280px;grid-template-rows:auto minmax(0,1fr);overflow:hidden;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);box-sizing:border-box}
.clean-config .is-fullscreen .config-viewer,.clean-config .is-fullscreen .config-viewer:has(.precision-panel:not([hidden])){height:100%;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain}
.clean-config .is-fullscreen .clean-panel{min-height:0;overflow-y:auto;overscroll-behavior:contain}
.clean-config .is-fullscreen .config-viewer #trailer-canvas{height:auto;min-height:240px;flex:1 0 240px}
.clean-config .is-fullscreen .config-viewer #floorplan-view{height:auto;flex:1 0 280px;min-height:280px}
.clean-config .is-fullscreen .config-viewer #floorplan-view svg{min-height:180px}
.clean-config .is-fullscreen .camera-toolbar,.clean-config .is-fullscreen .device-toolbar,.clean-config .is-fullscreen .model-note{flex-shrink:0}
@media(max-width:700px){
 .config-fullscreen-bar{font-size:13px;padding:8px 12px}
 .clean-config .configurator.is-fullscreen{display:flex;flex-direction:column;overflow-y:auto;overscroll-behavior:contain}
 .clean-config .is-fullscreen .config-fullscreen-bar{position:sticky;top:0;z-index:20}
 .clean-config .is-fullscreen .config-viewer,.clean-config .is-fullscreen .config-viewer:has(.precision-panel:not([hidden])){height:auto;min-height:calc(80dvh - 60px);overflow:visible;flex-shrink:0}
 .clean-config .is-fullscreen .config-viewer #trailer-canvas{height:50dvh;min-height:270px;flex:none}
 .clean-config .is-fullscreen .config-viewer #floorplan-view{height:50dvh;min-height:280px;flex:none}
 .clean-config .is-fullscreen .clean-panel{overflow:visible;flex-shrink:0}
 .clean-config .is-fullscreen .clean-actions{grid-template-columns:1fr 1fr}
}
body.config-fullscreen #toast{z-index:10050}
/* Free planning actions stay inside dialogs, leaving the viewport unchanged. */
.free-add{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}
.free-add button{min-height:46px;padding:10px 15px;border:1px solid #859980;background:#f3f4e9;color:var(--ink);font:inherit;font-size:16px;cursor:pointer}
.free-add button:hover{background:#dce6d4}
#planning-sheet .direct-area-grid{grid-template-columns:repeat(auto-fit,minmax(155px,1fr))}
#planning-sheet .direct-area small{white-space:normal;line-height:1.4}
#furniture-sheet{width:min(760px,calc(100vw - 28px))}
#furniture-close{font-size:25px}
#furniture-sheet .height-inputs{gap:18px}
#precision-form .precision-position-row>label{flex:1 1 180px;max-width:none}
#precision-form .precision-nudge{flex-wrap:wrap;margin-left:0}
#precision-form .precision-nudge label{width:110px}
.floor-layers{display:flex;flex-wrap:wrap;gap:7px;align-items:center;margin:0 0 12px;flex-shrink:0}
.floor-layers button{min-height:40px;border:1px solid #93a18b;border-radius:3px;background:#edf0e5;color:var(--ink);padding:8px 13px;font:inherit;font-size:14px;cursor:pointer}
.floor-layers button[aria-pressed="true"]{background:#354f3e;color:#fffef6;border-color:#354f3e}
.floor-layers button:focus-visible{outline:3px solid #a4bb6a;outline-offset:2px}
#furniture-body-label[hidden],#furniture-storage-label[hidden],#furniture-legs-label[hidden]{display:none!important}
#furniture-form .height-inputs>label{min-width:0}
@media(max-width:700px){.floor-layers button{min-height:44px;flex:1 1 auto}.floor-layers{gap:6px;margin-bottom:9px}}
