/* Keep the XHTML editor inside the renderer's 30/46-unit foreignObject.
 * Scoped to this adapter: original planner/theme payloads remain unchanged. */
#cobra-planner #floor-canvas .wall-input {
 box-sizing:border-box!important;
 width:100%!important;
 height:30px!important;
 min-height:30px!important;
 max-height:30px!important;
 margin:0!important;
 padding:3px 2px 3px 13px!important;
 font-size:14px!important;
 line-height:20px!important;
 border:1px solid #8b9d83!important;
 border-radius:2px;
 box-shadow:none!important;
}
#cobra-planner #floor-canvas .active-dimension .wall-input {
 height:46px!important;
 min-height:46px!important;
 max-height:46px!important;
 padding:7px 5px 7px 14px!important;
 font-size:16px!important;
 line-height:24px!important;
}
#cobra-planner .dimension-actions {
 position:fixed;
 inset:auto 8px var(--dimension-bottom,0px);
 z-index:80;
 flex:0 0 auto;
 align-self:center;
 margin:0 auto;
 background:var(--paper,#f5f6ee);
 border:1px solid #8b9d83;
 padding:6px 10px;
 box-shadow:none;
}
#cobra-planner #floor-canvas .wall-input:focus {
 outline:2px solid #315540!important;
 outline-offset:-3px!important;
}
/* The estimate, warnings and edit rail must never consume the drawing's height.
 * Short webviews use an honest scrolling workspace, including full-screen mode. */
@media(max-width:1000px) and (pointer:coarse), (max-height:500px) {
 #cobra-planner.floor-planner:not(.floor-fullscreen) {
  height:auto!important;
  min-height:calc(100svh - 116px - var(--cgxmn-reserve,0px));
 }
 #cobra-planner.floor-fullscreen {
  height:100dvh!important;
  display:block;
  overflow-y:auto;
  overscroll-behavior-y:contain;
  padding-bottom:env(safe-area-inset-bottom,0px);
 }
 #cobra-planner .floor-workspace,
 #cobra-planner.floor-fullscreen .floor-workspace {
  height:auto!important;
  flex:none;
  display:block;
 }
 #cobra-planner .floor-stage,
 #cobra-planner.floor-fullscreen .floor-stage {
  display:flex!important;
  flex-direction:column;
  height:auto!important;
  min-height:0;
  flex:none;
 }
 #cobra-planner #floor-canvas {
  display:block;
  flex:0 0 auto;
  height:clamp(340px,50svh,520px)!important;
  min-height:340px!important;
 }
 #cobra-planner .canvas-toolbar {gap:3px;padding:3px;}
 #cobra-planner .canvas-toolbar button {flex:1 0 auto;min-height:44px;}
 #cobra-planner .floor-stage>.floor-result {flex:0 0 auto;}
}
/* Inline settings are ordinary content, never an overlay or a fixed sidebar. */
#cobra-planner.floor-planner:not(.floor-fullscreen) {height:auto!important;min-height:0;}
#cobra-planner.floor-fullscreen {display:block;height:100dvh!important;overflow-y:auto;overscroll-behavior:contain;}
#cobra-planner .floor-workspace {flex:0 0 auto;height:auto!important;}
#cobra-planner #floor-settings.planner-options {
 position:static!important;inset:auto!important;width:100%!important;
 max-width:none!important;max-height:none!important;min-height:0;
 flex:0 0 auto;overflow:visible!important;box-shadow:none!important;
 border:0;border-top:1px solid var(--line,#cbd0c6);margin:0;
 background:var(--paper,#f5f6ee);
}
#cobra-planner #floor-settings>.floor-controls {display:flex;flex-direction:column;padding:16px;gap:12px;}
#cobra-planner #floor-settings details {width:100%;}
#cobra-planner #reserve-options {margin:0;}
#cobra-planner #floor-canvas {min-height:340px!important;}
#cobra-planner .floor-stage {min-height:0;}
@media(min-width:1001px) and (min-height:501px) {
 #cobra-planner #floor-canvas {height:clamp(440px,58svh,680px)!important;flex:none;}
}
@media(max-width:1000px) and (pointer:coarse), (max-height:500px) {
 #cobra-planner #floor-canvas:has(#corner-7) {height:clamp(440px,60svh,640px)!important;min-height:440px!important;}
}


/* Drawing-first wall rail: all split actions remain exposed, never piled on the room. */
#cobra-planner .wall-rail {padding:10px 12px;background:#f5f5ee;border-top:1px solid #cbd1c4;}
#cobra-planner .wall-rail h3 {margin:0 0 4px;font-size:16px;}
#cobra-planner .wall-rail p {margin:0 0 8px;}
#cobra-planner .wall-rows {list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:4px 12px;}
#cobra-planner .wall-rows li {display:grid;grid-template-columns:minmax(78px,1fr) minmax(100px,1fr) 48px;align-items:center;gap:6px;border-bottom:1px solid #d8ddcf;padding:3px 0;}
#cobra-planner .wall-rows li.selected {background:#e2ead9;}
#cobra-planner .wall-row-id {padding-left:6px;font-size:14px;font-weight:600;}
#cobra-planner .wall-rows button {min-height:44px;margin:0;font-size:16px;touch-action:manipulation;}
#cobra-planner .wall-rows [data-split] {font-size:24px;line-height:1;color:#315540;font-weight:600;}
#cobra-planner .dimension-actions {width:auto;max-width:calc(100% - 16px);flex-wrap:wrap;}
#cobra-planner #floor-canvas .wall-input {text-align:center;}
#cobra-planner[data-mode="scroll"] #floor-canvas {touch-action:pan-y!important;}
#cobra-planner[data-mode="scroll"] #floor-canvas > * {pointer-events:none!important;}
#cobra-planner .canvas-toolbar #scroll-mode {background:#e2ead9;}
