/* One responsive toolbar for the shared V5 engine. */
:root { --planner-toolbar-height:78px; --planner-footer-height:46px; --pt-paper:#fffefb; --pt-ink:#28392f; --pt-green:#345f48; --pt-soft:#e9efe3; --pt-line:#d5dbd0; --pt-clay:#a64f2c; }
html.planner-ui-v5 #app.planner-toolbar-layout { display:block; position:relative; overflow:hidden; background:#f2f1ec; }
html.planner-ui-v5 #app.planner-toolbar-layout #workspace { width:100%;height:100%;min-height:0; border:0; }
html.planner-ui-v5 #app.planner-toolbar-layout #workspace::before { display:none; }
html.planner-ui-v5 #plannerToolbar { position:absolute;inset:0 0 auto;display:flex;flex-direction:column;align-items:stretch;gap:0;width:auto;max-width:none;padding:4px max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left));margin:0;background:var(--pt-paper);border-bottom:1px solid var(--pt-line);box-shadow:0 4px 14px #28392f0a;z-index:20;overflow:visible;pointer-events:auto;color:var(--pt-ink); }
html.planner-ui-v5 #plannerToolbar [hidden], html.planner-ui-v5 .planner-utility-bar [hidden] { display:none!important; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail { position:static;display:flex;flex-flow:row wrap;align-items:center;justify-content:flex-start;gap:8px;min-height:64px;padding:0 0 5px;margin:0;border:0;box-shadow:none;background:transparent;overflow:visible; }
.planner-brand { color:var(--pt-green);font-size:25px;padding:0 14px 0 4px; }
.planner-command-group { display:flex;align-items:center;gap:3px;padding-right:8px;border-right:1px solid var(--pt-line); }
html.planner-ui-v5 #plannerToolbar .planner-command, html.planner-ui-v5 .planner-utility-bar .planner-command { position:relative;display:flex;flex:0 0 auto;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:54px;width:auto;height:58px;min-height:58px;padding:5px 9px;margin:0;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--pt-ink);font:400 12px/1.2 "Segoe UI",Arial,sans-serif;text-align:center;text-transform:none;letter-spacing:0;box-shadow:none;white-space:normal;transform:none;cursor:pointer;touch-action:manipulation; }
.planner-toolbar-icon { width:27px;height:27px;flex:0 0 27px;display:block; }
html.planner-ui-v5 #plannerToolbar .planner-command > .planner-toolbar-icon { width:27px!important;height:27px!important;stroke:currentColor; }
html.planner-ui-v5 #plannerToolbar .planner-command .planner-command-label { display:block;position:static;width:auto;height:auto;clip:auto;clip-path:none;overflow:visible;white-space:normal; }
html.planner-ui-v5 #plannerToolbar .planner-command:hover, html.planner-ui-v5 .planner-utility-bar .planner-command:hover { background:#f2f4ed;border-color:var(--pt-line);transform:none; }
html.planner-ui-v5 #plannerToolbar .planner-command.active, html.planner-ui-v5 #plannerToolbar .planner-command[aria-pressed="true"], html.planner-ui-v5 .planner-utility-bar .planner-command.active { color:var(--pt-green);background:var(--pt-soft);border-color:var(--pt-green);box-shadow:inset 0 -2px var(--pt-green); }
html.planner-ui-v5 #plannerToolbar .planner-command:disabled { opacity:.36;cursor:default;box-shadow:none; }
html.planner-ui-v5 #plannerToolbar .planner-command.planner-primary { min-width:112px;color:#fff;background:var(--pt-clay);border-color:var(--pt-clay);font-weight:600;box-shadow:none; }
html.planner-ui-v5 #plannerToolbar .planner-command.planner-generate { min-width:136px;background:var(--pt-soft);border-color:var(--pt-line);color:var(--pt-ink);font-weight:500;box-shadow:none; }
.planner-design-actions { margin-left:auto; }
html.planner-ui-v5 #plannerToolbar .layout-history-controls { display:flex;padding:0 8px 0 0;background:transparent;border:0;border-right:1px solid var(--pt-line);box-shadow:none;border-radius:0;gap:3px; }
html.planner-ui-v5 #plannerToolbar .layout-history-btn svg { width:27px;height:27px;stroke:currentColor; }
html.planner-ui-v5 #plannerToolbar .planner-view-switch { display:flex;gap:3px;background:transparent;border:0;box-shadow:none;padding:0; }
html.planner-ui-v5 #plannerToolbar .view-mode-btn { width:42px;min-width:42px;min-height:42px;height:42px;padding:0;background:var(--pt-soft);color:var(--pt-ink);border:1px solid transparent;box-shadow:none;font-size:13px; }
html.planner-ui-v5 #plannerToolbar .view-mode-btn.active { background:var(--pt-ink);color:white; }
html.planner-ui-v5 #plannerToolbar .planner-file-actions { border-right:0;gap:3px;padding:0; }
html.planner-ui-v5 #plannerToolbar #v5FileMenu { position:relative;display:block;min-width:0;width:auto;flex:0 0 auto; }
html.planner-ui-v5 #plannerToolbar #v5FileMenu summary { list-style:none; }
html.planner-ui-v5 #plannerToolbar #v5FileMenu summary::-webkit-details-marker { display:none; }
html.planner-ui-v5 #plannerToolbar #v5FileMenu .v5-file-menu-popover { position:absolute;inset:calc(100% + 8px) 0 auto auto;width:260px;max-width:calc(100vw - 24px);z-index:30;background:var(--pt-paper);color:var(--pt-ink);border:1px solid var(--pt-line); }
html.planner-ui-v5 #plannerToolbar .v5-file-menu-popover button { min-height:44px;font-size:14px; }
html.planner-ui-v5 #plannerToolbar .planner-placement-ribbon { display:flex;flex-wrap:wrap;align-items:stretch;gap:0;padding:6px 0 3px;border-top:1px solid var(--pt-line); }
.planner-ribbon-group { display:flex;flex:1 1 auto;flex-direction:column;align-items:stretch;min-width:0;padding:0 8px;border-right:1px solid var(--pt-line); }
.planner-ribbon-group:first-child { padding-left:0; }
.planner-ribbon-group:last-child { padding-right:0;border:0; }
.planner-ribbon-tools { display:flex;align-items:stretch;justify-content:space-around;gap:2px; }
html.planner-ui-v5 #plannerToolbar .planner-ribbon-tools .planner-command { flex:1 0 52px;min-width:52px;max-width:92px;height:58px;min-height:58px;padding:4px 5px;touch-action:none; }
html.planner-ui-v5 #plannerToolbar .planner-group-title { display:block;align-self:center;min-width:0;min-height:20px;height:20px;width:auto;flex:none;margin:0;padding:3px 8px;border:0;box-shadow:none;background:transparent;color:#64705f;border-radius:3px;font:400 10px/14px "Segoe UI",Arial,sans-serif;text-transform:uppercase;letter-spacing:.06em; }
html.planner-ui-v5 #plannerToolbar button.planner-group-title:hover { color:var(--pt-green);text-decoration:underline; }
html.planner-ui-v5 #plannerToolbar .planner-finish-ribbon { display:flex;align-items:stretch;flex-wrap:wrap;justify-content:space-around;gap:4px;border-top:1px solid var(--pt-line);padding:7px 0; }
html.planner-ui-v5 #plannerToolbar .planner-finish-ribbon .planner-command { flex:1 0 68px;max-width:120px; }
html.planner-ui-v5 #plannerToolbar select, html.planner-ui-v5 #plannerToolbar input { color:var(--pt-ink);background:var(--pt-paper);border:1px solid var(--pt-line);border-radius:5px;min-height:30px;font-size:13px;padding:3px 7px; }
.ceiling-height-dialog { width:390px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);box-sizing:border-box;padding:24px;border:1px solid var(--pt-line);border-radius:12px;background:var(--pt-paper);color:var(--pt-ink);box-shadow:0 16px 60px #17251e30;overflow:auto; }
.ceiling-height-dialog::backdrop { background:#17251e60; }
.ceiling-height-dialog h2 { margin:0 0 10px;font-size:20px; }
.ceiling-height-dialog p { font-size:14px;line-height:1.5; }
.ceiling-height-dialog label { display:block;margin:18px 0 6px;font-size:14px;font-weight:600; }
.ceiling-height-dialog input { box-sizing:border-box;width:100%;min-height:44px;padding:8px 10px;font-size:16px;border:1px solid var(--pt-line);border-radius:6px;background:#fff;color:var(--pt-ink); }
.ceiling-height-dialog input[aria-invalid="true"] { border-color:#a83d32; }
.ceiling-height-error { color:#a83d32; }
.ceiling-height-fit { min-height:42px;color:#556251; }
.ceiling-height-actions { display:flex;justify-content:flex-end;gap:10px;margin-top:20px; }
.ceiling-height-actions button { min-width:84px;min-height:44px;padding:8px 16px;border:1px solid var(--pt-line);border-radius:6px;background:var(--pt-paper);color:var(--pt-ink);font-size:14px; }
.ceiling-height-actions #ceilingHeightApplyBtn { background:var(--pt-green);color:#fff;border-color:var(--pt-green); }
.ceiling-height-dialog :focus-visible, #ceilingHeightEditBtn:focus-visible { outline:2px solid var(--pt-green);outline-offset:2px; }
.planner-tool-context { display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:8px 3px;border-top:1px solid var(--pt-line);font-size:12px;background:#f5f7f0; }
.planner-context-label { margin-right:8px;font-weight:600; }
.planner-context-choices { display:flex;gap:4px; }
html.planner-ui-v5 #plannerToolbar .planner-context-choices .planner-command { min-width:42px;min-height:32px;height:32px;padding:4px 8px;border:1px solid var(--pt-line);font-size:12px; }
.planner-context-hint { color:#64705f;margin-left:auto; }
.planner-context-height { display:flex;align-items:center;gap:5px; }
html.planner-ui-v5 #plannerToolbar .planner-context-depth { display:flex;align-items:center;gap:8px;padding:0;margin:0;background:none;border:0;width:auto; }
.planner-context-depth input { width:72px; }
.planner-tool-context[data-context="depth"] > :not(.planner-context-depth) { display:none!important; }
html.planner-ui-v5 #app.planner-toolbar-layout .planner-support { display:none; }
html.planner-ui-v5 #app.planner-toolbar-layout .canvas-badge { top:calc(var(--planner-toolbar-height) + 12px);left:16px;max-width:calc(100% - 270px);z-index:5; }
html.planner-ui-v5 #app.planner-toolbar-layout .floorplan-mini-map { top:calc(var(--planner-toolbar-height) + 12px);right:16px; }
html.planner-ui-v5 #app.planner-toolbar-layout .planner-utility-bar { position:absolute;inset:auto 0 0;display:flex;flex-wrap:wrap;align-items:center;gap:3px;z-index:20;padding:3px max(10px,env(safe-area-inset-right)) max(3px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));border-top:1px solid var(--pt-line);background:var(--pt-paper);color:var(--pt-ink); }
html.planner-ui-v5 .planner-utility-bar .planner-command { flex-direction:row;gap:5px;min-width:0;min-height:36px;height:36px;padding:5px 9px;font-size:11px; }
html.planner-ui-v5 .planner-utility-bar .planner-toolbar-icon { width:18px;height:18px;flex-basis:18px; }
html.planner-ui-v5 .planner-utility-bar #versionBadge { margin-left:auto;position:static;align-self:center;font-size:11px;padding:4px 8px;min-height:0;height:auto;background:none;border:0;box-shadow:none;color:#64705f; }
html.planner-ui-v5:not(.tablet-planner) .planner-utility-bar #tabletToolsToggleBtn { display:none; }
html.planner-ui-v5 #app.planner-toolbar-layout .v5-palette-host { top:calc(var(--planner-toolbar-height) + 10px);left:12px;bottom:calc(var(--planner-footer-height) + 12px);max-height:none;z-index:15;background:var(--pt-paper); }
html.planner-ui-v5:not(.tablet-planner) #app.planner-toolbar-layout #inspectorPanel { top:calc(var(--planner-toolbar-height) + 10px);bottom:calc(var(--planner-footer-height) + 12px);max-height:none;z-index:16; }
html.planner-ui-v5 #app.planner-toolbar-layout #plannerOperationHelp { top:calc(var(--planner-toolbar-height) + 8px);bottom:calc(var(--planner-footer-height) + 8px);max-height:none; }
html.planner-ui-v5 #app.planner-toolbar-layout .status-pill { bottom:calc(var(--planner-footer-height) + 8px);max-width:calc(100% - 32px); }
html.planner-ui-v5 #app.planner-toolbar-layout #threeViewport { top:var(--planner-toolbar-height);bottom:var(--planner-footer-height);height:auto; }
html.planner-ui-v5 #app.planner-toolbar-layout .design-validation-banner { bottom:calc(var(--planner-footer-height) + 58px); }
html.planner-ui-v5.tablet-planner #plannerToolbar { padding-top:max(4px,env(safe-area-inset-top)); }
html.planner-ui-v5.tablet-planner #plannerToolbar .planner-command { min-width:44px;min-height:56px;height:56px;padding:4px 5px;font-size:11px; }
html.planner-ui-v5.tablet-planner #plannerToolbar .planner-group-title { min-height:44px;height:44px;display:flex;align-items:center;justify-content:center; }
html.planner-ui-v5.tablet-planner #plannerToolbar .view-mode-btn { width:44px;min-width:44px;min-height:44px;height:44px; }
html.planner-ui-v5.tablet-planner #plannerToolbar input,html.planner-ui-v5.tablet-planner #plannerToolbar select { font-size:16px;min-height:44px;height:44px; }
html.planner-ui-v5.tablet-planner #plannerToolbar .planner-context-choices .planner-command { min-height:44px;height:44px; }
html.planner-ui-v5.tablet-planner .planner-utility-bar .planner-command { min-height:44px;height:44px;padding:5px 8px;font-size:11px; }
html.planner-ui-v5.tablet-planner #app.planner-toolbar-layout #inspectorPanel { bottom:calc(var(--planner-footer-height) + 8px);max-height:calc(100% - var(--planner-toolbar-height) - var(--planner-footer-height) - 22px); }
html.planner-ui-v5.tablet-planner #app.planner-toolbar-layout .v5-palette-host { top:auto;left:10px;right:10px;bottom:calc(var(--planner-footer-height) + 8px);width:auto;max-height:calc(100% - var(--planner-toolbar-height) - var(--planner-footer-height) - 22px); }
@media(max-width:1100px) {
  .planner-brand { display:none; }
  html.planner-ui-v5 #plannerToolbar #v5ToolRail { gap:4px; }
  .planner-command-group { padding-right:5px;gap:2px; }
  html.planner-ui-v5 #plannerToolbar .planner-command { min-width:44px;padding:4px 5px;font-size:11px; }
  html.planner-ui-v5 #plannerToolbar .planner-command.planner-primary { min-width:88px; }
  html.planner-ui-v5 #plannerToolbar .planner-command.planner-generate { min-width:112px; }
  .planner-ribbon-group { padding:0 5px; }
  html.planner-ui-v5 #plannerToolbar .planner-ribbon-tools .planner-command { flex-basis:44px;min-width:44px; }
}
@media(max-width:850px) {
  html.planner-ui-v5 #plannerToolbar .planner-placement-ribbon { gap:5px 0; }
  .planner-ribbon-group:nth-child(1),.planner-ribbon-group:nth-child(2) { flex:1 1 44%; }
  .planner-ribbon-group:nth-child(3),.planner-ribbon-group:nth-child(4) { flex:1 1 25%; }
  .planner-ribbon-group:nth-child(5) { flex:1 1 35%; }
  .planner-ribbon-group:nth-child(2) { border-right:0; }
  .planner-context-hint { flex-basis:100%; }
}
@media(max-width:600px) {
  .planner-design-actions { margin-left:0; }
  html.planner-ui-v5 #plannerToolbar #v5ToolRail { justify-content:center; }
  html.planner-ui-v5 .planner-utility-bar .planner-command { flex:1 0 62px; }
}

/* Compact command line. Every primary tool shares one horizontal row. */
:root { --planner-toolbar-height:78px; }
html.planner-ui-v5 #plannerToolbar { padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right)); }
.planner-single-row { display:flex;align-items:center;min-width:0;gap:3px; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail { flex:1 1 auto;min-width:0;max-width:100%;display:flex;flex-flow:row nowrap;align-items:flex-start;justify-content:flex-start;gap:4px;min-height:66px;padding:0 0 2px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:#b9c5b5 transparent;overscroll-behavior-x:contain; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail > * { flex-shrink:0; }
html.planner-ui-v5 #plannerToolbar .planner-brand { display:block;align-self:flex-start;font-size:20px;padding:14px 4px 0 0; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-command-group { gap:2px;padding:0 5px 0 0; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-command { min-width:42px;max-width:none;min-height:48px;height:48px;padding:3px 4px;gap:3px;font-size:10px;border-radius:5px; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-command > .planner-toolbar-icon { width:22px!important;height:22px!important;flex-basis:22px; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-command-label { white-space:nowrap; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-design-actions { margin-left:auto; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-primary { min-width:76px; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-generate { min-width:98px; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-file-actions { padding:0;border:0; }
html.planner-ui-v5 #plannerToolbar #v5FileMenu .v5-file-menu-popover { position:fixed;inset:auto 12px auto auto;max-height:calc(100dvh - var(--planner-toolbar-height) - 16px);overflow-y:auto; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-placement-ribbon { flex:0 0 auto;flex-wrap:nowrap;gap:0;padding:0;border:0; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-ribbon-group { flex:0 0 auto;padding:0 5px;border-right:1px solid var(--pt-line); }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-ribbon-group:first-child { padding-left:0; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-ribbon-tools { gap:1px;justify-content:flex-start; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-ribbon-tools .planner-command { flex:0 0 auto;touch-action:none; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-group-title { display:flex;align-items:center;justify-content:center;font-size:9px;line-height:12px;min-height:16px;height:16px;padding:2px 4px;letter-spacing:.03em; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-finish-ribbon { flex:1 0 auto;flex-wrap:nowrap;gap:1px;justify-content:flex-start;padding:0 5px 0 0;border:0;border-right:1px solid var(--pt-line); }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-finish-ribbon .planner-command { flex:0 0 auto; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-view-switch { padding-top:6px;gap:2px; }
html.planner-ui-v5 #plannerToolbar #v5ToolRail .view-mode-btn { width:34px;min-width:34px;height:34px;min-height:34px;font-size:11px; }
html.planner-ui-v5 #plannerToolbar .planner-scroll-button { flex:0 0 44px;width:44px;height:48px;min-height:44px;border:1px solid var(--pt-line);border-radius:5px;background:var(--pt-soft);color:var(--pt-green);font-size:27px;cursor:pointer; }
html.planner-ui-v5 #plannerToolbar .planner-scroll-button:disabled { opacity:.35;cursor:default; }
html.planner-ui-v5 #plannerToolbar .planner-scroll-button:focus-visible { outline:2px solid var(--pt-green);outline-offset:1px; }
@media(max-width:1450px) {
  html.planner-ui-v5 #plannerToolbar .planner-brand { display:none; }
  html.planner-ui-v5 #plannerToolbar #v5ToolRail { gap:2px; }
  html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-command-group { gap:1px;padding-right:3px; }
  html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-ribbon-group { padding:0 3px; }
}
html.planner-ui-v5.tablet-planner #plannerToolbar #v5ToolRail .planner-command { min-width:44px;min-height:48px;height:48px; }
html.planner-ui-v5.tablet-planner #plannerToolbar #v5ToolRail .view-mode-btn { width:44px;min-width:44px;height:44px;min-height:44px; }
html.planner-ui-v5.tablet-planner #plannerToolbar #v5ToolRail button.planner-group-title { min-width:44px;min-height:44px;height:44px; }
html.planner-ui-v5.tablet-planner #plannerToolbar #v5ToolRail .planner-ribbon-group { padding-left:2px;padding-right:2px; }
@media(min-width:1451px) {
  html.planner-ui-v5 #plannerToolbar #v5ToolRail { min-height:72px; }
  html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-command { min-width:48px;height:54px;min-height:54px;font-size:11px; }
  html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-command > .planner-toolbar-icon { width:24px!important;height:24px!important;flex-basis:24px; }
  html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-primary { min-width:84px; }
  html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-generate { min-width:110px; }
  html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-view-switch { padding-top:10px; }
}
@media(min-width:1451px) and (max-width:1700px) {
  html.planner-ui-v5 #plannerToolbar .planner-brand { display:none; }
  html.planner-ui-v5 #plannerToolbar #v5ToolRail .planner-command { min-width:44px;font-size:10px; }
}

/* Height settings remain available in Preferences in every plan/view mode. */
html.planner-ui-v5 #app .preference-height-settings .toolbar-cabinet-height-control,
html.planner-ui-v5 #app .preference-height-settings .toolbar-ceiling-height-control { position:static;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;width:auto;min-width:0;padding:8px 0;margin:0;background:none;border:0;box-shadow:none; }
html.planner-ui-v5 #app .preference-height-settings label { margin:0;font:500 13px/1.4 'Segoe UI',sans-serif;color:var(--pt-ink);text-transform:none;letter-spacing:0; }
html.planner-ui-v5 #app .preference-height-settings select,
html.planner-ui-v5 #app .preference-height-settings button { position:static;box-sizing:border-box;width:108px;min-width:108px;min-height:44px;height:44px;margin:0;padding:6px 10px;border:1px solid var(--pt-line);border-radius:5px;background:#fff;color:var(--pt-ink);font:400 16px/1.2 'Segoe UI',sans-serif;box-shadow:none; }
html.planner-ui-v5 #app .preference-height-settings #ceilingHeightEditBtn[data-fit="conflict"] { border-color:#a64f2c;color:#a64f2c; }
