/* Floor drawings share the editor's existing colors and type. */
.floors{max-height: min(34vh,320px);padding:8px;scrollbar-gutter:stable}
.floor-group+.floor-group{margin-top:4px}
.floor{gap:4px;padding:6px 4px;border-radius:9px;cursor:default}
.floor:hover{background:var(--surface2)}
.floor.active,.floor.contains-active{background:var(--primary-soft2);border-color:var(--primary-soft)}
.floor .fmain{gap:8px;align-self:stretch;border:0;background:transparent;color:inherit;text-align:left;font:inherit;cursor:pointer;padding:3px 0}
.floor .fthumb{width:30px;height:32px;border-radius:4px;object-fit:cover;background:var(--surface2)}
.floor .fcopy{min-width:0;flex:1}
.floor .fn{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:600}
.floor .fc{display:block;margin-top:3px;font-size:11px;color:var(--muted)}
.floor.active .fn{color:var(--primary)}
.floor-action{display:grid;place-items:center;width:28px;height:32px;flex:0 0 auto;border:0;border-radius:6px;background:transparent;color:var(--muted);cursor:pointer}
.floor-action svg{width:17px;height:17px;pointer-events:none}
.floor-action:hover{background:var(--primary-soft);color:var(--primary)}
.floor-action.fadd{color:var(--primary)}
.floor-action.fexpand{width:20px}
.floor-action.fexpand[aria-expanded="false"] svg{transform:rotate(-90deg)}
.floor-expand-space{width:20px;flex:0 0 auto}
.floor-children{padding-left:28px}
.floor-children[hidden]{display:none}
.floor-child .fn{font-weight:500}
.floor-menu{position:fixed;z-index:110;min-width:132px;padding:5px;border:1px solid var(--line2);border-radius:9px;background:var(--surface);color:var(--text)}
.floor-menu button{display:block;width:100%;min-height:38px;padding:8px 12px;border:0;border-radius:5px;background:transparent;font:inherit;text-align:left;color:inherit;cursor:pointer}
.floor-menu button:hover,.floor-menu button:focus-visible{background:var(--surface2)}
.floor-menu button.danger{color:#aa3434}
.floor-dialog{padding:20px;backdrop-filter:none;background:rgba(30,32,55,.36)}
.floor-dialog .modal{width:min(1060px,100%);max-height:calc(100dvh - 40px);display:flex;flex-direction:column;border-radius:14px;overflow:hidden}
.floor-dialog .mhead{padding:18px 24px;flex-shrink:0}
.floor-dialog h2{font-size:18px;font-weight:600}
.floor-dialog .x{width:36px;height:36px;border:0;border-radius:7px;background:transparent;display:grid;place-items:center;color:var(--muted);cursor:pointer}
.floor-dialog .x:hover{background:var(--surface2);color:var(--text)}
.floor-dialog .x svg{width:21px;height:21px}
.floor-dialog .mbody{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:24px;padding:24px;min-height:0;overflow:auto}
.drawing-preview{min-width:0;display:grid;gap:12px;align-content:start}
.drawing-preview-label{font-size:13px;font-weight:500}
.floor-dialog .drop{flex:none;width:100%;height:clamp(220px,49vh,490px);min-height:0;border:1px dashed var(--line2);border-radius:8px;background:var(--surface2);font-size:13px}
.floor-dialog .drop.has-image{border-style:solid;cursor:default}
.floor-dialog .drop.has-image>:not(img){display:none}
.floor-dialog .drop img.prev{inset:12px;width:calc(100% - 24px);height:calc(100% - 24px)}
.drawing-upload-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.drawing-upload-row>span{font-size:11px;color:var(--muted)}
.drawing-upload-row[hidden]{display:none}
.drawing-upload-row #mColorplan{color:#4545c4;border-color:#bcbcea;background:#f4f3ff}
.drawing-upload-row #mColorplan:disabled{color:#737385;border-color:var(--line);background:var(--surface2);cursor:default}
.layout-colorplan-dialog{margin:auto;width:min(1240px,calc(100vw - 40px));height:min(900px,calc(100dvh - 40px));max-width:none;max-height:none;padding:0;border:0;border-radius:14px;background:#fff;color:#242431;overflow:hidden}
.layout-colorplan-dialog::backdrop{background:rgba(30,32,55,.48)}
.layout-colorplan-dialog[open]{display:flex;flex-direction:column}
.layout-colorplan-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 24px;border-bottom:1px solid #e3e3ed}
.layout-colorplan-dialog h2{margin:0;font-size:18px;font-weight:600}
.layout-colorplan-dialog header p{margin:6px 0 0;color:#646473;font-size:12px;line-height:1.5}
.layout-colorplan-dialog header button{min-height:40px;padding:8px 16px;border:1px solid #dcdcE8;border-radius:8px;background:#fff;color:#424252;font:inherit;cursor:pointer;white-space:nowrap}
.layout-colorplan-dialog button:focus-visible{outline:2px solid #4545c4;outline-offset:3px}
.layout-colorplan-dialog iframe{flex:1;width:100%;min-height:0;border:0;background:#fff}
.layout-colorplan-dialog [hidden]{display:none!important}
.layout-colorplan-status{padding:24px;color:#555565;font-size:14px;line-height:1.6}
.layout-colorplan-status button{margin-top:12px;padding:8px 16px;min-height:40px;border:1px solid #dcdce8;border-radius:8px;background:#fff;color:#4545c4;font:inherit;cursor:pointer}
.floor-dialog .mside{width:auto;min-width:0;gap:24px;padding-left:24px;border-left:1px solid var(--line)}
.drawing-parent{display:grid;gap:8px;font-size:13px;overflow-wrap:anywhere}
.drawing-parent[hidden]{display:none}
.drawing-parent>span{color:var(--muted);font-size:12px}
.drawing-parent strong{font-weight:500}
.floor-dialog .fld label{font-size:13px;color:var(--text);margin-bottom:10px}
.drawing-name-field{position:relative}
.floor-dialog .fld input{height:42px;padding:0 52px 0 12px;border-radius:8px;font:inherit;caret-color:var(--primary)}
.drawing-name-field>span{position:absolute;right:10px;top:50%;transform:translateY(-50%);font-size:11px;font-variant-numeric:tabular-nums;color:var(--muted);pointer-events:none}
.drawing-help{color:var(--muted);font-size:12px;line-height:1.7;overflow-wrap:anywhere}
.drawing-error{color:#aa3434;min-height:20px;font-size:12px;line-height:1.6}
.floor-dialog .mfoot{flex-shrink:0;padding:16px 24px}
.floor-dialog .bn{min-height:40px;padding:8px 22px;border-radius:8px;font:inherit;white-space:nowrap}
.floor-dialog .bn.primary{background:var(--primary);color:#fff}
.floor-dialog .bn.primary:hover{background:#4545c4}
.floor-dialog .bn:disabled{opacity:.6;cursor:wait}
.floor-dialog :is(button,input,[role="button"]):focus-visible,.floor :is(button):focus-visible,.floor-menu button:focus-visible{outline:2px solid #4545c4;outline-offset:2px}
.floor-dialog input::selection{background:var(--primary-soft);color:var(--text)}
/* The generic icon-button width must not wrap this text action. */
#secondbar .bgroup b[data-v="arrange"]{width:auto;min-width:100px;padding:0 14px;white-space:nowrap;line-height:1.3}
@media(max-width:700px){
  .layout-colorplan-dialog{margin:auto;width:calc(100vw - 16px);height:calc(100dvh - 16px)}
  .layout-colorplan-dialog>header{padding:12px 16px;gap:10px;align-items:start}
  .layout-colorplan-dialog h2{font-size:16px}
  .layout-colorplan-dialog header button{padding:8px 10px;font-size:12px}
  .floor-action{width:36px;height:40px}
  .floor-dialog{padding:12px}
  .floor-dialog .modal{width:100%!important;max-height:calc(100dvh - 24px);overflow:hidden}
  .floor-dialog .mhead{padding:12px 16px}
  .floor-dialog .mbody{grid-template-columns:minmax(0,1fr);gap:20px;padding:16px}
  .floor-dialog .drop{height:clamp(160px,30vh,270px);min-height:0}
  .floor-dialog .mside{border-left:0;padding-left:0;gap:12px}
  .drawing-parent{display:flex;align-items:center;gap:12px}
  .floor-dialog .fld input{font-size:16px;min-height:44px}
  .floor-dialog .bn{min-height:44px}
  .floor-dialog .mfoot{padding:12px 16px}
  .floor-dialog .drawing-error:empty{display:none}
}
