/* The planner is a dedicated workspace, entered and exited via the Alfa brand. */
body.planner-page { margin: 0; padding: 0; height: 100%; overflow: hidden; }
.planner-page > :is(.announcement, .site-header, .footer, .mobile-bottom-nav, .floating-whatsapp) { display: none !important; }
.planner-page #conteudo { width: 100%; max-width: none; margin: 0; padding: 0; }
.planner {
  --pl-line: #d7dbd8;
  --pl-ink: #202423;
  --pl-muted: #555e59;
  --pl-red: #b3262e;
  --pl-rail: #202124;
  --pl-bar: #151618;
  --pl-rail-width: 72px;
  --pl-appbar-height: 59px;
  --pl-inspector-width: clamp(282px, 23vw, 346px);
  position: relative;
  isolation: isolate;
  margin: 0;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  color: var(--pl-ink);
  background: #f0f2ef;
  font-family: var(--body);
}
.planner [hidden] { display: none !important; }
.planner.pl-fullscreen, .planner:fullscreen { position: fixed; inset: 0; z-index: 5000; }
.pl-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#pl-loading, .pl-message { margin: 0; padding: 28px; font-size: 1rem; color: var(--pl-ink); }
.pl-workspace {
  width: 100%; height: 100%;
  display: grid;
  grid-template-columns: minmax(var(--pl-rail-width), max-content) minmax(0, 1fr) var(--pl-inspector-width);
  grid-template-rows: calc(var(--pl-appbar-height) + env(safe-area-inset-top, 0px)) minmax(0, 1fr);
  grid-template-areas: "bar bar bar" "tools board side";
}
.planner :is(button, summary, a, select, input, canvas):focus-visible { outline: 2px solid #a02530; outline-offset: 2px; }
.planner :is(.pl-appbar, .pl-command-rail) :is(a, button, summary):focus-visible { outline-color: #ff848a; outline-offset: -2px; }
.pl-button, .pl-tool, .pl-file-menu summary {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 9px 14px; border: 1px solid var(--pl-line); border-radius: 6px;
  background: #fff; color: var(--pl-ink); font: 600 .84rem/1.2 var(--body); text-align: center; text-decoration: none; cursor: pointer;
}
.pl-button .ui-icon, .pl-tool .ui-icon { width: 18px; height: 18px; flex: none; }
.pl-tool { width: 42px; flex: none; padding: 7px; }
.pl-button:enabled:hover, .pl-tool:enabled:hover, .pl-picker-row:hover { background: #f0f1f0; border-color: #a2a7a4; }
.planner button:disabled { opacity: .48; cursor: default; }
.pl-button.pl-primary { background: var(--pl-red); border-color: var(--pl-red); color: #fff; }
.pl-button.pl-primary:enabled:hover { background: #961d26; border-color: #961d26; }
.pl-button.pl-dark { background: #292c2c; border-color: #292c2c; color: #fff; }
.pl-button.pl-dark:enabled:hover { background: #414444; }
.pl-button.pl-link { border-color: transparent; background: transparent; padding-inline: 7px; }

/* Project bar */
.pl-appbar {
  grid-area: bar; z-index: 6; min-width: 0; display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px;
  padding: env(safe-area-inset-top, 0px) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  background: var(--pl-bar); color: #f6f6f5; border-bottom: 1px solid #323336;
}
.pl-file-identity, .pl-file-tools, .pl-segment, .pl-project, .pl-home { display: flex; align-items: center; }
.pl-file-identity { gap: 15px; min-width: 0; }
.pl-home { flex: none; min-height: 44px; padding: 2px 0; }
.pl-home img { display: block; width: 94px; height: 29px; object-fit: contain; }
.pl-project { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; overflow: hidden; border-left: 1px solid #48494b; padding-left: 15px; }
.pl-project strong, .pl-project small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-project strong { color: #fff; font: 600 .9rem/1.25 var(--body); }
.pl-project small { color: #c1c4c2; font: 400 .76rem/1.3 var(--body); }
.pl-segment { gap: 2px; border: 1px solid #45464a; border-radius: 7px; background: #212225; padding: 3px; }
.pl-segment button {
  display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 33px; min-width: 68px;
  padding: 4px 10px; border: 0; border-radius: 4px; background: transparent; font: 650 .82rem/1 var(--body); color: #c7c9cb; cursor: pointer;
}
.pl-segment .ui-icon { width: 16px; height: 16px; }
.pl-segment button:hover { color: #fff; }
.pl-segment button[aria-pressed="true"] { background: #f3f4f3; color: #1a1b1d; }
.pl-file-tools { justify-content: flex-end; gap: 7px; min-width: 0; }
.pl-appbar .pl-tool, .pl-appbar .pl-pdf, .pl-appbar .pl-file-menu summary { background: transparent; border-color: #47484a; color: #fff; }
.pl-appbar .pl-tool, .pl-appbar .pl-file-menu summary { min-height: 38px; width: 38px; }
.pl-appbar .pl-pdf { min-height: 38px; white-space: nowrap; }
.pl-appbar .pl-file-tools > button:enabled:hover, .pl-appbar .pl-file-menu summary:hover,
.pl-appbar .pl-file-menu[open] summary, .pl-file-tools [data-action=fullscreen][aria-pressed=true] { background: #343639; border-color: #707275; }
.pl-file-menu { position: relative; flex: none; }
.pl-file-menu summary { list-style: none; }
.pl-file-menu summary::-webkit-details-marker { display: none; }
.pl-file-actions {
  position: absolute; top: calc(100% + 7px); right: 0; width: max-content; min-width: 202px; max-width: calc(100vw - 24px);
  display: grid; gap: 2px; padding: 5px; border: 1px solid var(--pl-line); border-radius: 8px; background: white; color: var(--pl-ink);
  box-shadow: 0 10px 32px #14181828;
}
.pl-file-actions > .pl-button { justify-content: flex-start; padding-inline: 10px; border: 0; }
.pl-file-actions .footer-languages { display: flex; flex-wrap: wrap; align-items: stretch; gap: 3px; margin: 3px 0 0; padding: 5px 2px 0; border-top: 1px solid var(--pl-line); }
.pl-file-actions .footer-languages a { display: flex; align-items: center; min-height: 40px; padding: 0 5px; color: #48504b; font-size: .75rem; }
.pl-file-actions .footer-languages a[aria-current=true] { color: #911b25; font-weight: 650; }

/* Left tool rail */
.pl-command-rail {
  grid-area: tools; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #525457 var(--pl-rail);
  background: var(--pl-rail); color: #fff; padding: 6px 4px max(8px, env(safe-area-inset-bottom)); border-right: 1px solid #333539;
}
.pl-rail-group { display: grid; grid-auto-rows: minmax(48px, auto); gap: 3px; padding: 6px 0; }
.pl-rail-group + .pl-rail-group { border-top: 1px solid #414246; }
.pl-rail-bottom { margin-top: auto; }
.pl-rail-tool {
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; min-height: 48px;
  padding: 5px 1px; border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: #d9dadb; font: 550 .78rem/1.16 var(--body); text-align: center; white-space: nowrap; overflow-wrap: normal; word-break: normal; cursor: pointer;
}
.pl-rail-tool .ui-icon { width: 20px; height: 20px; flex: none; }
.pl-rail-tool:enabled:hover { background: #333538; color: #fff; }
.pl-rail-tool[aria-pressed=true] { background: #a7252d; border-color: #c13b43; color: #fff; }
.pl-rail-tool[aria-pressed=true]:hover { background: #b52a33; }
.pl-rail-tool[data-action=properties][aria-expanded=true] { background: #383a3d; border-color: #505256; color: #fff; }

/* Canvas and its controls */
.pl-board { position: relative; grid-area: board; min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.pl-stage {
  position: relative; isolation: isolate; min-width: 0; min-height: 0; overflow: hidden; background-color: #f1f3f0;
  background-image: radial-gradient(#b6bdb9 .8px, transparent .95px); background-size: 16px 16px;
}
#pl-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#pl-canvas:active { cursor: grabbing; }
.planner #pl-canvas:focus-visible { outline-offset: -3px; }
.planner:is([data-tool=draw], [data-tool=wall], [data-tool=resize]) #pl-canvas, .editing-outline #pl-canvas { cursor: crosshair; }
.pl-stats, .pl-stage-tools > div, .pl-draft-bar {
  border: 1px solid #cbd1cd; border-radius: 6px; background: #fffffff5; box-shadow: 0 2px 9px #17201912;
}
.pl-stats { position: absolute; top: 16px; left: 16px; display: grid; gap: 3px; padding: 7px 11px; pointer-events: none; }
.planner[data-tool=draw] .pl-stats { display: none; }
.pl-stats strong { color: #242a26; font: 650 1.08rem/1.1 var(--head); }
.pl-stats span, #pl-size, #pl-result-count { color: var(--pl-muted); font-size: .77rem; }
#pl-notice {
  position: absolute; z-index: 7; top: 15px; left: 50%; transform: translateX(-50%); max-width: min(400px, calc(100% - 210px));
  width: max-content; margin: 0; padding: 9px 14px; border-radius: 6px; background: #27292bf5; color: white; box-shadow: 0 2px 9px #171b1a26;
  font: 500 .82rem/1.35 var(--body); text-align: center; pointer-events: none;
}
#pl-notice:empty { width: 1px; height: 1px; padding: 0; background: transparent; box-shadow: none; }
.pl-stage-tools { position: absolute; bottom: 15px; right: 15px; display: flex; align-items: center; gap: 6px; }
.pl-stage-tools > div { display: flex; align-items: center; padding: 2px; }
.pl-stage-tools .pl-tool { width: 37px; min-height: 37px; padding: 5px; border: 0; border-radius: 4px; }
.pl-stage-tools [data-action=orbit-left] svg { transform: scaleX(-1); }
.pl-draft-bar { display: none; }
.editing-outline .pl-draft-bar { position: absolute; bottom: 15px; left: 15px; display: flex; gap: 3px; align-items: center; padding: 3px; }
.pl-draft-bar .pl-button { min-height: 36px; padding: 6px 8px; }
.pl-board-foot {
  display: flex; gap: 10px; align-items: center; justify-content: space-between; min-height: 58px;
  padding: 8px 16px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--pl-line); background: #fbfcfa; color: var(--pl-muted);
}
#pl-help { max-width: clamp(105px, calc(50vw - var(--pl-rail-width) - 137px), 490px); font: 450 .79rem/1.4 var(--body); }

/* Contextual properties */
.pl-side {
  grid-area: side; align-self: stretch; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin;
  padding-bottom: env(safe-area-inset-bottom); border-left: 1px solid var(--pl-line); background: #fff;
}
.pl-panel-tabs { position: sticky; top: 0; z-index: 2; display: flex; align-items: stretch; gap: 18px; padding-inline: 17px; border-bottom: 1px solid var(--pl-line); background: #fff; }
.pl-panel-tabs [data-panel] {
  min-height: 52px; padding: 0 2px; display: inline-flex; align-items: center; gap: 6px; border: 0; border-bottom: 2px solid transparent;
  color: var(--pl-muted); background: transparent; font: 600 .87rem var(--body); cursor: pointer;
}
.pl-panel-tabs [data-panel][aria-pressed=true] { border-bottom-color: var(--pl-red); color: #181c19; }
#pl-count { background: #e9ece9; color: #48514b; border-radius: 9px; padding: 1px 7px; font-size: .74rem; }
.pl-panel-tabs [data-action=close-properties] { display: none; }
.pl-room-form, #pl-items, #pl-wall-inspector { padding: 19px 17px; }
.pl-room-name { margin-bottom: 16px; }
.pl-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 9px; }
.pl-field, .pl-range { display: grid; gap: 5px; min-width: 0; color: #303632; font: 600 .86rem/1.35 var(--body); }
.pl-number { display: flex; align-items: center; min-width: 0; padding: 0 9px; border: 1px solid #b9c0bb; border-radius: 5px; background: #fff; }
.pl-number:focus-within { outline: 2px solid #a02530; outline-offset: 1px; }
.pl-number input { width: 100%; min-width: 0; height: 40px; padding: 6px 0; border: 0; background: transparent; color: #202522; font: 500 .9rem var(--body); }
.planner .pl-number input:focus-visible { outline: 0; }
.pl-number small { padding-left: 3px; color: #626b65; font-weight: 400; font-size: .78rem; }
.pl-field select, .pl-filter select, .pl-field > input {
  width: 100%; min-width: 0; height: 42px; padding: 6px 8px; border: 1px solid #b9c0bb; border-radius: 5px; background-color: #fff; color: #202522; font: 500 .86rem var(--body);
}
.pl-surface input[type=color] { cursor: pointer; padding: 4px 6px; }
.pl-room-form .pl-more { margin-top: 13px; }
.pl-more { border-top: 1px solid var(--pl-line); font-size: .85rem; }
.pl-more summary { padding: 11px 0 0; font-weight: 550; cursor: pointer; }
.pl-more[open] > summary { margin-bottom: 12px; }
.pl-range { margin: 12px 0; }
.pl-range input { width: 100%; height: 25px; accent-color: var(--pl-red); }
.pl-room-submit, #pl-position-form > .pl-button { width: 100%; margin-top: 13px; }
.pl-room-submit { background: #f0f2ef; }
.pl-room-form .pl-empty { display: flex; width: 100%; margin-top: 3px; font-size: .78rem; }
.pl-architecture { padding: 0 17px 17px; }
.pl-architecture summary { padding-top: 14px; }
#pl-feature-list:empty { display: none; }
.pl-architecture:has(#pl-feature-list:empty) { display: none; }
#pl-feature-list, #pl-feature-form { display: grid; gap: 7px; }
#pl-feature-form { margin-top: 12px; }
.pl-arch-item {
  cursor: pointer; text-align: left; color: #27322d; background: #f4f5f2; border: 1px solid var(--pl-line); border-radius: 5px;
  padding: 9px; font: 500 .83rem var(--body);
}
.pl-arch-item[aria-pressed=true] { border-color: var(--pl-red); }
#pl-wall-inspector { border-bottom: 1px solid #d5d8d4; background: #f4f5f2; }
#pl-wall-inspector .pl-form-grid + .pl-form-grid { margin-top: 10px; }
#pl-wall-title, .pl-side-title h2, .pl-dialog h2 { margin: 0; color: var(--pl-ink); font: 650 1.19rem/1.2 var(--head); letter-spacing: -.025em; }
#pl-wall-title { margin-bottom: 14px; }
.planner:is([data-tool=draw], [data-tool=resize]) #pl-room-form > :not(#pl-outline-editor) { display: none; }
#pl-outline-editor { margin-bottom: 15px; padding: 12px; border: 1px solid #ddc6c7; border-radius: 6px; background: #fbf4f3; }
#pl-outline-editor p, .pl-share-body p, .pl-ar-inner p, .pl-measures form p { margin: 7px 0; color: var(--pl-muted); font-size: .88rem; line-height: 1.45; }
#pl-outline-editor .pl-form-grid, #pl-wall-inspector > .pl-editor-actions, #pl-outline-editor .pl-editor-actions { margin-top: 9px; }
.pl-editor-actions, .pl-inspector-actions, .pl-ar-modes { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pl-editor-actions .pl-button, .pl-inspector-actions .pl-button { padding: 6px 9px; font-size: .78rem; }
.pl-side-title, .pl-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pl-side-title { margin-bottom: 8px; }
#pl-inventory { max-height: 33vh; overflow: auto; scrollbar-width: thin; }
.pl-item {
  display: flex; align-items: center; gap: 9px; min-height: 44px; width: 100%; padding: 7px; border: 0; border-bottom: 1px solid var(--pl-line);
  background: white; color: #303630; font: 550 .83rem/1.3 var(--body); text-align: left; cursor: pointer;
}
.pl-item b { background: #e6e9e6; padding: 3px 6px; border-radius: 3px; color: #364038; font-size: .76rem; }
.pl-item[aria-pressed=true] { background: #fbefee; color: #8e252a; }
.pl-item[aria-pressed=true] b { background: var(--pl-red); color: #fff; }
#pl-inspector { border-top: 2px solid #acb3ac; margin-top: 14px; padding-top: 13px; }
.pl-selected-name { font: 650 1.12rem var(--head); }
.pl-finish-fields { display: grid; gap: 10px; margin: 12px 0; }
.pl-finish-field, .pl-finish-caption { display: flex; align-items: center; gap: 6px; }
.pl-finish-field { align-items: flex-end; min-width: 0; }
.pl-finish-label { flex: 1; display: grid; gap: 4px; min-width: 0; }
.pl-finish-caption { font: 600 .8rem var(--body); }
.pl-finish-dot { flex: none; width: 13px; height: 13px; border: 1px solid #6b706d; border-radius: 50%; background: var(--swatch); }
.pl-finish-label select, .pl-finish-custom { width: 100%; min-width: 0; min-height: 44px; padding: 5px 8px; border: 1px solid #b9c0bb; border-radius: 5px; background-color: #fff; color: #202522; font: 500 .85rem var(--body); }
.pl-finish-custom { width: 46px; cursor: pointer; }
.pl-apply-finish { width: 100%; border-color: #ca9c9e; color: #98232b; }
.pl-inspector-actions { margin: 12px 0; }

/* Shared planner dialogs */
.pl-dialog {
  width: min(730px, calc(100vw - 26px)); max-height: min(86dvh, 900px); overflow: auto; margin: auto; padding: 0;
  border: 1px solid #bfc6c0; border-radius: 9px; background: #fff; color: var(--pl-ink); box-shadow: 0 16px 60px #13181633;
}
.pl-dialog::backdrop { background: #0d1010a8; }
.pl-dialog-head { padding: 16px 20px 12px; }
.pl-dialog-head .eyebrow { font-size: .65rem; color: var(--pl-red); }
.pl-dialog-head h2 { margin: 3px 0 0; font-size: 1.55rem; }
.pl-share-body, .pl-ar-inner, .pl-measures form { padding: 0 20px 18px; }
.pl-share-dialog { max-width: 510px; }
.pl-ar-dialog { max-width: 590px; }
.pl-ar-modes .pl-button[aria-pressed=true] { background: #282d2a; color: #fff; }
.pl-ar-stage model-viewer { display: block; width: 100%; height: clamp(180px, 32vh, 290px); background: #edf0ec; }
.pl-phone { text-align: center; }
.pl-phone img { display: block; width: min(88%, 260px); height: auto; image-rendering: pixelated; margin: 10px auto; }
.pl-measures { max-width: 430px; }
.pl-measures form p { margin-block: 9px 13px; }
.pl-share-body .pl-editor-actions { margin-block: 12px; }
.pl-filters { display: flex; gap: 8px; padding: 4px 20px; }
.pl-search { display: flex; align-items: center; flex: 1; min-width: 0; gap: 7px; height: 42px; padding: 0 9px; border: 1px solid #b9c0bb; border-radius: 5px; }
.pl-search input { width: 100%; min-width: 0; border: 0; background: none; color: var(--pl-ink); font: 500 .9rem var(--body); }
.pl-search .ui-icon { width: 17px; height: 17px; color: #66716a; }
#pl-result-count { padding: 0 20px; margin: 7px 0; }
.pl-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 6px; max-height: 45dvh; overflow: auto; padding: 0 20px; scrollbar-width: thin; }
.pl-picker-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; min-height: 64px; padding: 5px; border: 1px solid var(--pl-line); border-radius: 5px; background: #fff; color: var(--pl-ink); text-align: left; cursor: pointer; }
.pl-picker-row img, .pl-placeholder { width: 50px; height: 50px; object-fit: contain; background: #f1f2ef; }
.pl-placeholder { display: grid; place-items: center; color: #69726c; font-size: .75rem; }
.pl-picker-row strong, .pl-picker-row small { display: block; }
.pl-picker-row strong { font: 600 .84rem/1.25 var(--body); }
.pl-picker-row small { color: var(--pl-muted); margin-top: 3px; font-size: .73rem; }
.pl-picker-row > b { color: var(--pl-red); font-size: 1.1rem; }
.pl-selected-photo { margin: 12px 0; background: #f1f2ef; padding: 8px; border-radius: 5px; text-align: center; }
.pl-selected-photo img { display: block; margin: auto; object-fit: contain; }
.pl-selected-photo figcaption { color: var(--pl-muted); font-size: .74rem; }
.pl-library-foot { padding: 12px 20px 16px; }

@media (min-width: 761px) {
  .planner.properties-collapsed .pl-workspace { grid-template-columns: minmax(var(--pl-rail-width), max-content) minmax(0, 1fr) 0; }
  .planner.properties-collapsed .pl-side { display: none; }
  .pl-project-buttons {
    position: fixed; left: 50%; bottom: max(8px, env(safe-area-inset-bottom)); transform: translateX(-50%);
    z-index: 3; filter: drop-shadow(0 2px 4px #351c1f18);
  }
  .planner-page .planner [data-action=quote]:disabled { opacity: 1; color: #656d67; background: #e2e5e1; border-color: #d0d5d0; box-shadow: none; }
}
@media (max-width: 970px) {
  .planner { --pl-rail-width: 64px; --pl-inspector-width: 271px; }
  .pl-stage-tools { right: 9px; bottom: 9px; }
  .editing-outline .pl-draft-bar { left: 9px; bottom: 58px; }
  #pl-notice { top: 81px; max-width: calc(100% - 24px); }
}
@media (max-width: 760px) {
  .planner { --pl-appbar-height: 54px; --pl-rail-width: calc(64px + env(safe-area-inset-left, 0px)); }
  .pl-workspace { grid-template-columns: minmax(var(--pl-rail-width), max-content) minmax(0, 1fr); grid-template-areas: "bar bar" "tools board"; }
  .pl-appbar { gap: 5px; padding-inline: max(7px, env(safe-area-inset-left)) max(7px, env(safe-area-inset-right)); }
  .pl-home img { width: 76px; height: 24px; }
  .pl-file-identity { gap: 6px; }
  .pl-project { border: 0; padding-left: 0; }
  .pl-project small { display: none; }
  .pl-file-tools { gap: 1px; }
  .pl-file-tools > .pl-tool, .pl-appbar .pl-file-menu summary, .pl-file-tools .pl-pdf { min-height: 44px; width: 44px; padding: 6px; border: 0; }
  .pl-file-tools .pl-pdf > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .pl-segment { padding: 2px; }
  .pl-segment button { min-width: 44px; min-height: 38px; padding: 3px; gap: 4px; }
  .pl-segment .ui-icon { width: 13px; height: 13px; }
  .pl-command-rail { padding: 2px 3px max(5px, env(safe-area-inset-bottom)) max(3px, env(safe-area-inset-left)); }
  .pl-rail-group { gap: 2px; padding: 4px 0; grid-auto-rows: minmax(47px, auto); }
  .pl-rail-tool { min-height: 47px; padding-inline: 0; gap: 3px; font-size: .75rem; }
  .pl-rail-tool .ui-icon { width: 19px; height: 19px; }
  .pl-board-foot { min-height: 54px; align-items: center; flex-wrap: wrap; gap: 6px; padding: 7px max(8px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) 8px; }
  #pl-help { flex: 1 1 115px; max-width: none; font-size: .78rem; line-height: 1.3; }
  .pl-board-foot [data-action=quote] { flex: none; min-height: 43px; padding: 5px 8px; gap: 5px; font-size: .78rem; }
  .pl-board-foot [data-action=quote] svg { width: 16px; height: 16px; }
  .pl-stage-tools .pl-tool { min-height: 43px; width: 43px; }
  .pl-stats { top: 9px; left: 9px; padding: 5px 8px; }
  #pl-notice { top: 68px; font-size: .76rem; }
  .pl-draft-bar .pl-button { min-height: 42px; }
  .pl-side {
    position: relative; z-index: 5; grid-area: board; justify-self: end;
    width: min(345px, 100%); padding-right: env(safe-area-inset-right);
    box-shadow: -7px 0 24px #10191724; visibility: hidden; transform: translateX(100%);
    transition: transform .18s ease, visibility .18s;
  }
  .properties-open .pl-side { visibility: visible; transform: none; }
  .properties-open #pl-notice { top: auto; bottom: max(8px, env(safe-area-inset-bottom)); }
  .properties-open:has(#pl-notice:not(:empty)) .pl-side { padding-bottom: max(65px, env(safe-area-inset-bottom)); }
  .pl-panel-tabs { gap: 10px; padding-inline: 12px 6px; }
  .pl-panel-tabs [data-action=close-properties] { display: inline-flex; align-self: center; margin-left: auto; border: 0; width: 44px; min-height: 44px; }
  .pl-room-form, #pl-items, #pl-wall-inspector { padding: 15px 13px; }
  .pl-architecture { padding-inline: 13px; }
  .pl-field input, .pl-field select, .pl-filter select, .pl-search input, .pl-finish-label select { font-size: 1rem; }
  .pl-dialog-head, .pl-filters, .pl-results, .pl-library-foot, #pl-result-count { padding-inline: 12px; }
  .pl-results { grid-template-columns: 1fr; max-height: 46dvh; }
}
@media (max-width: 540px) {
  .pl-project { display: none; }
  .pl-stage-tools { max-width: calc(100% - 12px); flex-wrap: wrap; justify-content: flex-end; right: 6px; }
}
@media (max-width: 390px) {
  .pl-appbar { grid-template-columns: minmax(55px, 1fr) auto auto; }
  .pl-home img { width: 65px; height: 21px; }
  .pl-segment .ui-icon { display: none; }
}
@media (max-width: 350px) {
  .pl-board-foot [data-action=quote] { margin-left: auto; }
}
@media (max-height: 550px) and (orientation: landscape) {
  .pl-rail-tool span { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .pl-rail-group { padding-block: 2px; grid-auto-rows: minmax(42px, auto); }
  .pl-rail-tool { min-height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .pl-side { transition: none; }
}

/* The canvas remains the main workspace. Open precision controls on demand. */
.pl-mobilebar, .pl-room-tools, .pl-touch-history { display: none; }
.pl-file-actions #pl-menu-saved { padding: 6px 10px; color: var(--pl-muted); font-size: .78rem; }
#pl-inspector { margin: 0 0 16px; padding: 0 0 12px; border: 0; border-bottom: 1px solid var(--pl-line); }
#pl-inspector .pl-more { margin: 0; }
#pl-inspector summary { min-height: 44px; }
.pl-start { width: min(412px, calc(100vw - 24px)); border: 0; border-radius: 14px; }
.pl-start .pl-dialog-head { border-top: 4px solid var(--pl-red); padding: 19px 22px 0; }
.pl-start .pl-dialog-head h2 { font-size: clamp(1.65rem, 4vw, 2rem); letter-spacing: -.035em; }
.pl-start-body { padding: 4px 22px 22px; }
.pl-start-body > p { font-size: .96rem; line-height: 1.45; margin: 0 0 15px; color: var(--pl-muted); }
.pl-start-preview { height: 104px; margin-bottom: 15px; display: grid; place-items: center; position: relative; border: 1px solid #dadbd6; border-radius: 7px; background-color: #f3f4ef; background-image: radial-gradient(#abb1a8 .8px, transparent .8px); background-size: 9px 9px; }
#pl-preview-outline { box-sizing: border-box; border: 2px solid #474c46; background: #d7dcd2cc; }
#pl-preview-area { position: absolute; bottom: 6px; right: 8px; padding: 2px 4px; border-radius: 3px; color: #394337; background: #f3f4ef; font: 650 .8rem var(--body); }
.pl-start .pl-primary, .pl-start-draw { width: 100%; min-height: 46px; margin-top: 12px; }
.pl-start-draw { margin-top: 7px; }
#pl-first-item { position: absolute; left: 50%; top: 51%; transform: translate(-50%,-50%); }
#pl-first-item button { width: max-content; max-width: 75vw; box-shadow: 0 3px 12px #14181629; }
.pl-ruler-bar { position: absolute; top: 16px; right: 16px; display: flex; align-items: center; gap: 7px; }
#pl-ruler-value:not(:empty) { background: #fff; color: #84252b; padding: 6px 8px; border-radius: 4px; font-weight: 700; }
.planner[data-tool=ruler] #pl-canvas { cursor: crosshair; }
@media (max-width: 760px) {
  .pl-workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: calc(var(--pl-appbar-height) + env(safe-area-inset-top,0px)) minmax(0,1fr) auto; grid-template-areas: "bar" "board" "mobiletools"; }
  .pl-command-rail { display: none; }
  .pl-mobilebar { grid-area: mobiletools; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); align-items: stretch; gap: 2px; padding: 4px max(5px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(5px,env(safe-area-inset-left)); background: var(--pl-rail); }
  .pl-mobilebar .pl-rail-tool { width: 100%; min-height: 48px; }
  .pl-mobilebar .pl-rail-tool span { position: static; width: auto; height: auto; clip-path: none; overflow: visible; }
  .pl-mobilebar .pl-rail-tool[aria-expanded=true] { background: #383a3d; border-color: #737477; color: white; }
  .pl-room-tools { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; padding: 12px 13px 0; }
  .pl-room-tools button { min-height: 44px; padding: 7px; }
  .pl-touch-history { position: absolute; right: 9px; top: 9px; display: flex; gap: 2px; }
  .pl-touch-history .pl-tool { min-height: 44px; width: 44px; }
  .pl-ruler-bar { top: auto; right: auto; left: 9px; bottom: 9px; }
  .pl-ruler-bar .pl-button { min-height: 44px; }
  .planner[data-tool=ruler] .pl-stage-tools { bottom: 62px; }
  .pl-board-foot { padding-bottom: 7px; }
  .pl-start .pl-field input { font-size: 1rem; }
}
@media (max-height: 550px) {
  .pl-start-preview { display: none; }
}

.pl-floor-switch { pointer-events: auto; display: flex; gap: 6px; align-items: center; align-self: start; max-width: min(230px,44vw); background: none; color: var(--pl-ink); border: 0; border-bottom: 1px solid var(--pl-line); padding: 0 0 5px; margin-bottom: 3px; min-height: 30px; cursor: pointer; }
.pl-floor-switch .ui-icon { width: 15px; height: 15px; flex: none; }
.pl-floor-switch span { overflow: hidden; color: inherit; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pl-project-tools,.pl-select-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.pl-project-tools { margin: 14px 14px 0; }
.pl-select-actions { margin: 5px 0 10px; }
.pl-project-tools .pl-button,.pl-select-actions .pl-button,#pl-inspector .pl-inspector-actions .pl-button { padding-inline: 6px; min-height: 42px; }
#pl-inspector .pl-inspector-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.pl-cancel-tool { position:absolute; right:12px; top:12px; }
.planner:is([data-tool=door],[data-tool=sector]) #pl-canvas {cursor:crosshair;}
.pl-project-tools [aria-pressed=true] {background:#f9e7e5; border-color:#b52c32;}
@media(max-width:760px) {
 .pl-floor-switch { min-height:38px; }
 .pl-cancel-tool { top:auto; bottom:8px; left:8px; right:auto; }
 .pl-project-tools .pl-button,.pl-select-actions .pl-button,#pl-inspector .pl-inspector-actions .pl-button { min-height:44px; }
 .pl-ruler-bar {flex-wrap:wrap; max-width:calc(100% - 18px);}
}

.pl-project-buttons { display:flex; align-items:center; justify-content:center; gap:8px; }
.pl-project-buttons .pl-button { min-height:44px; }
@media (min-width:761px) {
  #pl-help { max-width:clamp(65px,calc(50vw - var(--pl-rail-width) - 185px),465px); }
}
@media (max-width:760px) {
  .pl-board-foot { display:grid; grid-template-columns:1fr; gap:4px; justify-items:stretch; }
  #pl-help { margin:0; }
  .pl-project-buttons { display:grid; grid-template-columns: auto auto; gap:7px; }
  .pl-project-buttons .pl-button { min-height:44px; padding:5px 10px; font-size:.82rem; }
  .pl-board-foot [data-action=quote] { margin:0; }
}

.pl-decor-choices { display:grid; grid-template-columns:repeat(auto-fit,minmax(125px,1fr)); gap:8px; }
.pl-decor-choices .pl-button { justify-content:flex-start; min-height:48px; text-align:start; }
.pl-decor-choices .ui-icon { color:var(--pl-red,#ad2530); flex:none; }
#pl-decor h3 { margin:12px 0 8px; font-size:1rem; }
#pl-decor-list { display:grid; gap:6px; }
#pl-fixture-status:empty { display:none; }
[data-tool="decor-place"] #pl-canvas { cursor:crosshair; }
.pl-construct-tools h3{font-size:1rem;margin:12px 0 6px}
#pl-notice.pl-warning{background:#7b2228;color:white;border:1px solid #e48d8d}

dialog.pl-guide[open]{position:fixed;inset:0;box-sizing:border-box;width:100%;max-width:none;height:100%;max-height:none;margin:0;padding:0;border:0;background:transparent;overflow:hidden;color:#1b211e;animation:none;box-shadow:none}
/* The tutorial points at controls behind the dialog. Keep those controls sharp. */
dialog.pl-guide::backdrop{background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none}
dialog.pl-guide.pl-guide-no-target::backdrop{background:rgba(14,19,17,.16)}
.pl-guide-focus{position:absolute;border:2px solid #fff;border-radius:7px;box-shadow:0 0 0 3px #c83137,0 0 0 200vmax rgba(14,19,17,.16);pointer-events:none}
.pl-guide-card{box-sizing:border-box;position:absolute;width:min(355px,calc(100% - 24px));max-height:calc(100% - 24px);overflow:auto;background:#fff;border-radius:9px;padding:20px;box-shadow:0 8px 36px #0005}
.pl-guide-card .pl-guide-count{margin:0 0 8px;color:#a62830;font-size:.74rem;font-weight:700}
.pl-guide-card h2{color:#17221c;font-size:1.35rem;line-height:1.15;margin:0 0 8px}
.pl-guide-body{color:#414a46;font-size:.91rem;line-height:1.5;margin:0}
.pl-guide-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:17px}
.pl-guide-actions .pl-button{min-height:40px;padding:7px 10px}
.pl-guide-skip{min-height:40px;background:transparent;border:0;color:#49524d;text-decoration:underline;margin-right:auto;padding:4px;font:inherit;font-size:.79rem;cursor:pointer}
.pl-guide-actions button:focus-visible{outline:3px solid #a72d34;outline-offset:2px}
@media(max-width:420px){.pl-guide-card{padding:16px}.pl-multi-bar{max-width:calc(100% - 12px);flex-wrap:wrap}.pl-multi-bar button{padding-inline:6px}}

#pl-library[open]{display:flex;flex-direction:column;max-height:88dvh;overflow:auto}
.pl-batch-mode{display:flex;align-items:center;gap:9px;margin:4px 20px;min-height:38px;font-size:.9rem;font-weight:600;color:var(--pl-ink);cursor:pointer}
.pl-batch-mode input{width:18px;height:18px;accent-color:var(--pl-red)}
#pl-library .pl-results{min-height:min(130px,21dvh);flex:1 1 auto}
.pl-picker-row[aria-pressed=true]{border-color:#a92c33;background:#fff5f5;box-shadow:inset 0 0 0 1px #a92c33}
.pl-batch-tray{padding:10px 20px 14px;border-top:1px solid var(--pl-line);background:#fff;display:grid;gap:7px;flex:0 0 auto}
.pl-batch-summary{display:flex;align-items:center;justify-content:space-between;gap:8px}.pl-batch-summary button{flex-shrink:0;min-height:36px}
.pl-batch-tray strong{font-size:.9rem}.pl-batch-tray .pl-button{justify-self:end}
.pl-batch-list{max-height:16dvh;overflow:auto}.pl-batch-list>div,.pl-batch-list label{display:flex;align-items:center;gap:8px}
.pl-batch-list>div+div{border-top:1px solid var(--pl-line)}.pl-batch-list label{flex:1;justify-content:space-between;font-size:.85rem}
.pl-batch-list input{max-width:64px;height:36px;padding:3px 6px;font:inherit;border:1px solid #929b96;border-radius:4px}
.pl-batch-list button{width:38px;min-height:38px;border:0;background:transparent;color:#a32a32;font-size:1.25rem;cursor:pointer}
#pl-batch-report{margin:0;white-space:pre-line;color:#813037;font-size:.83rem;line-height:1.45;max-height:12dvh;overflow:auto}
#pl-batch-report:empty,.pl-batch-list:empty{display:none}
@media(max-width:760px){.pl-batch-mode{margin-inline:12px}.pl-batch-tray{padding-inline:12px}.pl-batch-tray > .pl-button{width:100%}}

@media(min-width:761px){
  .planner{--pl-rail-width:clamp(164px,15.5vw,222px)}
  .pl-command-rail{width:var(--pl-rail-width);box-sizing:border-box}
  .pl-command-rail [data-action=palette-close]{display:none}
}
.pl-command-rail{padding:0;overflow:hidden}
.pl-tool-shelf-head,.pl-tool-history{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;gap:4px;flex:none}
.pl-tool-shelf-head{border-bottom:1px solid #424449;font-size:.92rem}
.pl-tool-sections{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.pl-tool-group{border-bottom:1px solid #393b40}
.pl-tool-group>summary{cursor:pointer;min-height:42px;display:flex;align-items:center;justify-content:space-between;padding:0 12px;font-size:.81rem;font-weight:650;list-style:none}
.pl-tool-group>summary::after{content:'⌄';color:#a7aaaf}
.pl-tool-group[open]>summary::after{transform:rotate(180deg)}
.pl-tool-group>summary::-webkit-details-marker{display:none}
.pl-command-list{display:grid;padding:0 6px 7px;gap:2px}
.pl-command{display:flex;align-items:center;min-height:36px;gap:8px;padding:5px 8px;border:1px solid transparent;border-radius:5px;color:#e4e4e6;background:transparent;font:500 .77rem/1.18 var(--body);text-align:left;cursor:pointer}
.pl-command .ui-icon{flex:none;width:16px;height:16px}
.pl-command kbd{margin-left:auto;color:#bdbfc5;font:500 .65rem var(--body)}
.pl-command:enabled:hover,.pl-tool-group>summary:hover{background:#333539}
.pl-command[aria-pressed=true],.pl-command[aria-pressed=true]:hover{border-color:#bf4851;background:#76272e;color:white}
.pl-command:disabled{opacity:.44;cursor:default}
.pl-tool-history{border-top:1px solid #44464a;justify-content:space-around}
.pl-tool-history .pl-tool,.pl-tool-shelf-head .pl-tool{background:transparent;color:#eee;border-color:#484a4f}
.pl-palette-drawer{border:0;padding:0;margin:0 auto 0 0;width:min(290px,85vw);max-width:none;height:100dvh;max-height:none;background:var(--pl-rail);color:white}
.pl-palette-drawer::backdrop{background:#0c12195c}
.pl-palette-drawer[open] .pl-command-rail{display:flex;height:100%;width:100%;box-sizing:border-box}
.pl-palette-drawer .pl-command{min-height:44px}
.planner[data-tool=move-tool] canvas{cursor:move}
.planner[data-tool=pan-tool] canvas{cursor:grab}
.planner[data-tool=turn-tool] canvas,.planner[data-tool=mirror-resize] canvas{cursor:crosshair}
#pl-mirror-edit{display:grid;gap:5px}
#pl-mirror-edit>label{font-weight:650}
#pl-mirror-edit p,#pl-mirror-edit output{margin:0;font-size:.79rem}
.pl-mirror-surface{position:relative;height:138px;background:#f2f4f1;border:1px solid #d4d9d6;border-radius:6px;display:grid;place-items:center}
.pl-mirror-wall{position:relative;background:#dadcd8;box-shadow:0 0 0 1px #89928b;touch-action:none}
.pl-mirror-face{position:absolute;background:linear-gradient(135deg,#8fadb7,#dae8eb 55%,#a4bec8);border:1px solid #4d6976;box-sizing:border-box}
.pl-mirror-grip{position:absolute;transform:translate(-50%,-50%);border:0;background:transparent;width:26px;height:26px;touch-action:none;display:grid;place-items:center;padding:0}
.pl-mirror-grip::before{content:'';width:11px;height:11px;border:2px solid white;border-radius:50%;background:#a82432;box-shadow:0 0 0 1px #852333}
.planner[data-tool=orbit-tool] #pl-canvas{cursor:grab}
.planner[data-tool=orbit-tool] #pl-canvas:active{cursor:grabbing}
.pl-stage-tools [data-action=orbit-tool][aria-pressed=true]{background:#9d2631;color:white}
.pl-command[data-command=tilt-down] svg{transform:rotate(180deg)}
.pl-layout-note{font-size:.76rem;line-height:1.4;color:#47534c;margin:4px 0 8px}

.pl-tool-search { display:flex; align-items:center; gap:7px; margin:0 9px 8px; padding:0 8px; background:#303236; border:1px solid #595d63; border-radius:5px; }
.pl-tool-search:focus-within { border-color:#ff868b; }
.pl-tool-search .ui-icon { width:16px; flex:none; }
.pl-tool-search input { width:100%; min-width:0; height:38px; border:0; background:transparent; color:#fff; font:inherit; font-size:.875rem; }
.pl-tool-search input::placeholder { color:#d3d4d6; }
.pl-tool-shelf-head { border-bottom:0; }
.pl-quick-tools { display:grid; gap:3px; padding:0 8px 8px; border-bottom:1px solid #494b50; }
.pl-quick-tools .pl-button { justify-content:flex-start; min-height:36px; gap:8px; color:#fff; background:#37393e; border-color:transparent; font-size:.875rem; }
.pl-quick-tools .pl-button:enabled:hover { background:#484b50; }
.pl-quick-tools .pl-button[aria-pressed=true] { background:#9b242c; }
.pl-quick-tools .ui-icon { width:17px; }
.pl-tool-group>summary { min-height:45px; justify-content:flex-start; gap:9px; font-size:.875rem; }
.pl-tool-group>summary .ui-icon { width:18px; height:18px; color:#d3d4d7; }
.pl-tool-group>summary::after { margin-left:auto; }
.pl-command { font-size:.855rem; min-height:38px; }
#pl-tool-empty { margin:4px 12px; color:#e1e1e2; font-size:.875rem; }
@media(max-width:760px) {
  .pl-palette-drawer .pl-tool-search input { font-size:1rem; height:44px; }
  .pl-palette-drawer .pl-quick-tools .pl-button { min-height:44px; }
}
@media(max-height:540px) {
  .pl-quick-tools { display:flex; flex-wrap:wrap; }
  .pl-quick-tools .pl-button { flex:1; min-height:34px; padding:4px; }
  .pl-quick-tools .ui-icon { display:none; }
}

.planner[data-view=building] .pl-side { display:none; }
@media(min-width:761px) {
  .planner[data-view=building] .pl-workspace { grid-template-columns:var(--pl-rail-width) minmax(0,1fr) 0; }
}
.pl-room-shortcuts { margin-inline:14px; }
.pl-room-shortcuts .pl-room-tools,.pl-room-shortcuts .pl-project-tools { padding:0; margin:7px 0; }

#pl-decor[open] { display:flex; flex-direction:column; overflow:hidden; }
#pl-decor-count { margin:6px 20px; color:var(--pl-muted); font-size:.85rem; }
.pl-decor-scroll { min-height:0; overflow:auto; padding:2px 20px 18px; overscroll-behavior:contain; }
.pl-decor-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.pl-decor-card { min-width:0; border:1px solid var(--pl-line); border-radius:7px; background:white; padding:0; overflow:hidden; cursor:pointer; text-align:left; color:var(--pl-ink); }
.pl-decor-card:is(:hover,:focus-visible) { border-color:var(--pl-red); }
.pl-decor-card:focus-visible { outline-offset:-3px; }
.pl-decor-card img { display:block; width:100%; height:auto; aspect-ratio:9/7; background:#eceeeb; }
.pl-decor-card span { display:grid; gap:3px; padding:9px 10px; }
.pl-decor-card strong { font-size:.91rem; line-height:1.25; }
.pl-decor-card small { color:var(--pl-muted); font-size:.78rem; }
#pl-decor-added { margin-top:14px; }
#pl-decor-added summary { cursor:pointer; padding:8px 0; }
.pl-catalog-error { color:#962630; background:#fff0f1; margin:3px 16px; padding:8px; font-size:.875rem; }
@media(max-width:600px){
  .pl-decor-grid { grid-template-columns:repeat(2,minmax(0,1fr));gap:7px; }
  .pl-decor-scroll { padding:2px 12px 14px; }
  #pl-decor-count { margin-inline:12px; }
  #pl-decor .pl-filters { flex-wrap:wrap; }
  #pl-decor .pl-search { min-width:140px; }
}
