#referenceButton{display:inline-flex;align-items:center;gap:5px;min-height:44px;flex-shrink:0;color:var(--ui-476570,#476570);background:var(--ui-f3f4f1,#f3f4f1);border-color:var(--ui-d8dedb,#d8dedb)}#referenceButton .icon{width:18px;height:18px}#referenceButton small,.referenceBadge{font-size:10px;letter-spacing:.05em;font-weight:600;color:var(--ui-78664f,#78664f);background:var(--ui-ece6dc,#ece6dc);border-radius:4px;padding:3px 5px}
.referenceDialog{width:min(460px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow-y:auto;padding:24px}.referenceDialog h2{margin:8px 0 12px}.referenceDialog p{font-size:14px;line-height:1.65}.referenceHeading{display:flex;align-items:center;justify-content:space-between}.referenceImport{width:100%;margin-top:10px;min-height:48px}.referenceHint{color:var(--ui-6e7473,#6e7473);font-size:12px!important;line-height:1.65}.referenceDetails{border-top:1px solid var(--ui-deded7,#deded7);padding-top:18px;margin-top:18px}.referenceDetails>strong,.referenceDetails>small{display:block;overflow-wrap:anywhere}.referenceDetails>small{margin:7px 0 14px;color:var(--ui-697773,#697773)}.referenceActions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:18px}.referenceDialog label{display:block;font-size:13px;line-height:1.5;margin:10px 0}.referenceDialog input{width:100%;min-height:44px;box-sizing:border-box;margin-top:5px}.referenceDialog output{float:right}.referenceFields{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}.referenceFields label:last-child{grid-column:1/-1}.referenceDelete{margin-top:16px;width:100%;font-size:13px}.referenceDialog [role=status]{margin-bottom:0}.referenceDialog .error{color:var(--ui-9b5143,#9b5143)}.referenceIntro{background:var(--ui-f0f1ed,#f0f1ed);padding:14px;border-radius:10px}
#referencePickBar{position:absolute;z-index:15;top:10px;left:10px;right:10px;display:flex;justify-content:space-between;align-items:center;gap:8px;background:#fffef9f2;border:1px solid var(--ui-cdd8d9,#cdd8d9);border-radius:10px;padding:8px 10px;color:var(--ui-476570,#476570);box-shadow:0 4px 18px #39494a12;font-size:13px}#referencePickBar[hidden],#referenceWarning[hidden]{display:none}#referencePickBar button{min-height:44px}#referenceWarning{position:absolute;top:12px;left:12px;right:12px;font-size:12px;background:var(--ui-fff5e8,#fff5e8);padding:10px;color:var(--ui-805d3d,#805d3d);border-radius:8px;pointer-events:none}
.contextTools button,.canvasHistory button{display:inline-flex;align-items:center;justify-content:center;gap:5px}.contextTools .icon,.canvasHistory .icon{width:16px;height:16px;flex:none}.contextTools #quickDismiss .icon{width:18px;height:18px}[data-room-label]{cursor:pointer}[data-room-label]:focus{outline:none}[data-room-label]:focus text{fill:var(--ui-946d43,#946d43)}
@media(max-width:600px){.planPanel .panelHead h2{font-size:10px;flex:1}.planPanel .panelHead{gap:5px}.planPanel .panelHead>div{gap:3px}.planPanel .panelHead button{padding-left:8px;padding-right:8px}#referenceButton{gap:3px}#referenceButton span{font-size:12px}#referenceButton .icon{width:15px}.referenceDialog{padding:20px}}
@media(prefers-reduced-motion:reduce){.referenceDialog{scroll-behavior:auto}}

/* Keep every phone landscape action on the left, even in a short browser viewport. */
body.phoneLandscape #editorMain #referenceButton{position:static;width:44px;min-width:44px;max-width:44px;height:44px;min-height:44px;padding:10px;border:0;background:transparent}
body.phoneLandscape #referenceButton span,body.phoneLandscape #referenceButton small{display:none}
body.phoneLandscape #editorMain #referenceButton .icon{width:22px;height:22px}
body.phoneLandscape #editorMain>.toolbar{top:50%;bottom:auto;left:max(6px,env(safe-area-inset-left));right:auto;transform:translateY(-50%);flex-direction:column;justify-content:flex-start;width:48px;max-width:48px;height:auto;max-height:calc(var(--phone-visible-height,100dvh) - 60px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:none}
body.phoneLandscape #editorMain>.toolbar::-webkit-scrollbar{display:none}
body.phoneLandscapeShort[data-page=editor] #editorMain{padding-left:calc(max(8px,env(safe-area-inset-left)) + 54px);padding-bottom:max(6px,env(safe-area-inset-bottom))}
body.phoneLandscapeShort #editorMain>.furnitureCatalog{left:calc(max(8px,env(safe-area-inset-left)) + 54px);bottom:max(8px,env(safe-area-inset-bottom));max-height:calc(var(--phone-visible-height,100dvh) - 72px)}
body.phoneLandscape #referencePickBar{left:8px;right:64px}
@media(max-width:600px){.planPanel>.panelHead>h2{display:none}.planPanel>.panelHead{justify-content:space-between}}

#plan[data-reference-picking=true]{cursor:crosshair!important}
.compareLinework{position:absolute;z-index:14;right:10px;top:10px;min-height:44px;padding:8px 10px;font-size:12px;background:#fffef9ee}
.compareLinework[aria-pressed=true]{background:var(--ui-5b7884,#5b7884);color:var(--ui-ffffff,#fff)}
body.phoneLandscape .compareLinework{right:64px}
