.pb-main { max-width: 1920px; padding: 0 24px; }
.pb-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin: 24px 0 16px; }
.pb-heading h1 { font-size: 28px; }
.pb-heading p { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.pb-project-identity { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; overflow-wrap: anywhere; }
.pb-project-identity strong { color: var(--text); font-size: 13px; }
.pb-project-total { display: flex; flex-direction: column; gap: 2px; text-align: right; font-size: 12px; }
.pb-project-total strong { color: var(--primary); }
.pb-settings { margin-bottom: 12px; }
.pb-settings > summary { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 44px; padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--control-radius); cursor: pointer; list-style: none; font-size: 14px; background: var(--bg-card); }
.pb-settings > summary::-webkit-details-marker { display: none; }
.pb-settings > summary > span { color: var(--muted); font-size: 12px; }
.pb-settings > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pb-settings[open] > summary { margin-bottom: 12px; }
.pb-workspace { display: grid; grid-template-columns: minmax(240px, 270px) minmax(0, 1fr) minmax(260px, 290px); gap: 12px; align-items: start; margin-bottom: 24px; }
.pb-plan, .pb-inspector { min-width: 0; }
.pb-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--card-radius); box-shadow: var(--shadow-sm); padding: 16px; min-width: 0; }
.pb-brief { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.pb-brief h2 { font-size: 25px; margin: 10px 0 26px; }
.pb-brief .text-link { width: fit-content; margin-top: 18px; }
.pb-summary { padding: 22px 0; margin: 24px 0 0; border-top: 1px solid var(--border); }
.pb-summary span { font-size: 13px; color: var(--primary); }
.pb-toolbar, .pb-editor-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pb-inspector h2 { font-size: 17px; }
.pb-toolbar { justify-content: flex-end; }
.pb-toolbar .button { padding-inline: 12px; font-size: 12px; }
.pb-history { display: flex; border-inline: 1px solid var(--border); }
.pb-layout-status { font-size: 12px; color: var(--green); background: var(--green-bg); border-radius: var(--pill-radius); padding: 6px 10px; }
.pb-layout-status.warning { color: var(--yellow); background: var(--yellow-bg); }
.pb-page .button, .pb-page input, .pb-page select, .pb-page .nav-link { min-height: 44px; }
.pb-page input, .pb-page select { border-color: var(--border-strong); font-size: 14px; }
.pb-page input::placeholder { color: var(--text-muted); }
.pb-page form label { font-family: var(--font-body); font-size: 13px; letter-spacing: 0; text-transform: none; }
.pb-page form label .optional { font-size: 10px; letter-spacing: 0; }
.pb-page .form-note { text-align: left; font-size: 12px; }
.pb-field-error { font-size: 12px; line-height: 1.5; color: var(--danger); margin-top: 6px; }
.pb-page [aria-invalid="true"] { border-color: var(--danger); }
.pb-feedback { background: var(--bg-subtle); border-left: 3px solid var(--primary); padding: 10px 12px; margin: 12px 0; font-size: 12px; line-height: 1.6; color: var(--text-muted); overflow-wrap: anywhere; }
.pb-feedback .button { margin-top: 8px; }
#pb-budget-fields.field-pair { align-items: start; }
.pb-targets { display: grid; gap: 8px; margin: 12px 0; }
.pb-targets .button { justify-content: space-between; }
.pb-targets [aria-pressed="true"] { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.pb-must-haves { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pb-must-haves .button { white-space: normal; font-size: 12px; }
.pb-must-haves [aria-pressed="true"] { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }
.pb-canvas { display: flex; flex-direction: column; position: relative; isolation: isolate; overflow: hidden; height: clamp(480px, 66vh, 820px); background: var(--bg-subtle); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 20px 20px; border: 1px solid var(--border); border-radius: var(--card-radius); padding: 12px; }
.pb-canvas[data-view-mode="3d"]::after { position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(ellipse at center, transparent 48%, var(--surface-inset) 150%); content: ""; pointer-events: none; z-index: 1; }
.pb-iso-caption { display: none; position: absolute; bottom: 72px; left: 16px; max-width: calc(100% - 32px); flex-direction: column; gap: 3px; color: var(--text-muted); z-index: 3; pointer-events: none; text-transform: uppercase; }
.pb-canvas[data-view-mode="3d"] .pb-iso-caption { display: flex; }
.pb-iso-caption strong { width: fit-content; border-bottom: 1.5px solid var(--border-strong); padding-bottom: 2px; font-size: 13px; letter-spacing: .1em; }
.pb-iso-caption span { font-size: 10px; letter-spacing: .07em; }
.pb-stage-heading, .pb-canvas-bottom { position: relative; z-index: 3; }
.pb-canvas.pb-drop-active { outline: 2px solid var(--primary); outline-offset: 2px; background: var(--primary-bg); }
.pb-piece-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pb-piece-actions [aria-pressed="true"] { background: var(--primary-bg); border-color: var(--primary); color: var(--primary); }
.pb-workspace-nav, .pb-room-navigation, .pb-nav-side { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.pb-workspace-nav { flex-wrap: wrap; }
.pb-room-navigation { flex: 1; justify-content: flex-start; }
.pb-room-navigation > .button { flex-shrink: 0; }
.pb-room-tabs { display: flex; gap: 4px; overflow-x: auto; min-width: 0; padding: 4px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--control-radius); }
.pb-room-tabs .button { flex-shrink: 0; background: transparent; color: var(--text-muted); padding: 8px 12px; font-size: 13px; }
.pb-room-tabs .button[aria-pressed="true"] { background: var(--primary); color: var(--primary-contrast); }
.pb-room-tabs span { font-size: 11px; opacity: .8; }
.pb-view-switch { display: flex; flex-shrink: 0; padding: 3px; border: 1px solid var(--border); border-radius: var(--pill-radius); background: var(--bg-card); }
.pb-view-switch .button { background: transparent; color: var(--text-muted); border-radius: var(--pill-radius); padding: 8px 14px; font-size: 13px; }
.pb-view-switch [aria-pressed="true"] { background: var(--primary); color: var(--primary-contrast); }
.pb-stage-heading > .pb-stage-views { display: none; }
.pb-stage-dialog .pb-stage-heading > .pb-stage-views { display: flex; flex-direction: row; margin-left: auto; }
.pb-stage-heading { flex-wrap: wrap; }
.pb-canvas #pb-iso { height: 0; min-height: 0; }
.pb-view-option { display: flex; gap: 8px; align-items: center; min-height: 44px; font-size: 13px; color: var(--text-muted); }
.pb-view-option input { width: 18px; min-height: 18px; margin: 0; }
.pb-action-handle { cursor: pointer; color: var(--primary); outline: none; }
.pb-action-handle circle { fill: var(--bg-card); stroke: currentColor; stroke-width: 1.5; vector-effect: non-scaling-stroke; filter: drop-shadow(0 1px 2px var(--border-strong)); }
.pb-action-handle svg { pointer-events: none; }
.pb-action-handle.delete { color: var(--danger); }
.pb-action-handle.rotate { cursor: grab; }
.pb-action-handle:hover circle, .pb-action-handle:focus-visible circle { fill: var(--primary-bg); stroke-width: 3; }
.pb-window { fill: var(--bg-subtle); stroke: var(--border-strong); stroke-width: 1.5; }
.pb-item-dim { fill: var(--text); font: 10px var(--font-body); paint-order: stroke; stroke: var(--bg-card); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.pb-confirm-dialog { max-width: min(440px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--border); border-radius: var(--card-radius); color: var(--text); background: var(--bg-card); }
.pb-confirm-dialog h2 { font-size: 22px; }
.pb-confirm-dialog p { margin: 12px 0 24px; color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.pb-confirm-dialog > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.pb-confirm-dialog::backdrop { background: var(--modal-backdrop); }
.pb-zoom #pb-expand { border: 0; border-left: 1px solid var(--border); box-shadow: none; background: transparent; border-radius: 0; }
.pb-zoom #pb-expand span { display: none; }
.pb-stage-heading, .pb-canvas-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pb-stage-heading > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
#pb-active-room { overflow-wrap: anywhere; }
.pb-stage-heading .button { font-size: 12px; padding: 8px 12px; flex-shrink: 0; }
.pb-canvas-bottom { min-height: 44px; }
.pb-canvas-bottom .form-note { margin: 0; font-size: 11px; }
.pb-zoom { display: flex; align-items: center; flex-shrink: 0; margin-left: auto; border: 1px solid var(--border); border-radius: var(--control-radius); background: var(--bg-card); box-shadow: var(--shadow-sm); }
.pb-zoom .button { min-width: 44px; padding: 6px 10px; }
.pb-zoom output { width: 42px; text-align: center; color: var(--text-muted); font-size: 12px; }
#pb-fit { border-left: 1px solid var(--border); border-radius: 0; font-size: 12px; }
#pb-open-library, #pb-close-library { display: none; }
.pb-page:has(dialog[open]) { overflow: hidden; }
.pb-library-dialog, .pb-stage-dialog { padding: 0; border: 1px solid var(--border); border-radius: var(--card-radius); background: var(--bg); color: var(--text); box-shadow: var(--shadow-lg); }
.pb-library-dialog::backdrop, .pb-stage-dialog::backdrop { background: var(--modal-backdrop); }
.pb-stage-dialog { width: calc(100% - 24px); max-width: none; height: calc(100dvh - 24px); max-height: none; }
.pb-stage-dialog .pb-plan { display: flex; flex-direction: column; height: 100%; padding: 12px; }
.pb-stage-dialog .pb-canvas { flex: 1; height: auto; min-height: 0; }
.pb-stage-dialog #pb-open-library { display: none; }
.pb-help { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 8px; }
.pb-help > summary { min-height: 44px; align-content: center; cursor: pointer; font-size: 12px; color: var(--text-muted); }
#pb-svg[hidden], #pb-iso[hidden] { display: none; }
#pb-svg, #pb-iso { width: 100%; display: block; flex: 1; height: 0; min-height: 0; touch-action: none; }
.pb-preset-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.pb-preset-controls select { flex: 1 1 160px; min-width: 0; }
.pb-room-overview { margin: 20px 0 12px; border: 1px solid var(--border); border-radius: var(--card-radius); background: var(--bg-subtle); padding: 12px; }
.pb-room-overview svg { display: block; width: 100%; max-height: 160px; }
.pb-overview-room { cursor: pointer; outline: none; }
.pb-overview-room rect { fill: var(--bg-card); stroke: var(--border-strong); stroke-width: 4; }
.pb-overview-room.selected rect, .pb-overview-room:focus rect { fill: var(--primary-bg); stroke: var(--primary); stroke-width: 6; }
.pb-overview-room text { fill: var(--text); font-family: var(--font-body); pointer-events: none; }
.pb-floor { fill: var(--bg-card); }
.pb-wall { fill: none; stroke: var(--text); stroke-width: 5; }
.pb-door { fill: none; stroke: var(--green); stroke-width: 1.5; }
.pb-grid { stroke: var(--border); stroke-width: .35; }
.pb-footprint { fill: transparent; stroke: transparent; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.pb-furniture { cursor: grab; outline: none; }
.pb-furniture:focus-visible .pb-footprint, .pb-furniture.selected .pb-footprint { stroke: var(--primary); stroke-width: 1.6; stroke-dasharray: 5 3; }
.pb-furniture .plan-furniture-symbol { pointer-events: none; }
.pb-furniture text { fill: var(--text); font-family: var(--font-body); font-size: 10px; pointer-events: none; }
.pb-measure { fill: var(--muted); font-family: var(--font-body); font-size: 12px; }
.pb-plan-note { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; font-size: 10px; color: var(--muted); margin: 10px 0; }
.pb-notice { font-size: 12px; color: var(--muted); margin: 10px 0; min-height: 20px; overflow-wrap: anywhere; }
.pb-warnings { color: var(--primary); font-size: 13px; margin: 12px 0; padding-left: 20px; overflow-wrap: anywhere; }
.pb-editor { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 20px; }
.pb-editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.pb-editor-title strong { overflow-wrap: anywhere; }
.pb-piece-actions .button, .pb-editor-title .button { white-space: normal; }
.pb-placed { border-top: 1px solid var(--border); padding-top: 20px; margin-top: 20px; }
.pb-placed h3 { font-size: 16px; }
#pb-placed-list { list-style: none; margin: 12px 0 0; padding: 2px; display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.pb-placed-button { width: 100%; min-height: 44px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--control-radius); color: var(--text); background: var(--bg-card); font: inherit; cursor: pointer; }
.pb-placed-button span { width: 100%; overflow-wrap: anywhere; font-size: 13px; }
.pb-placed-button small { color: var(--muted); font-size: 11px; }
.pb-placed-button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-bg); }
.pb-placed-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pb-collection { display: flex; flex-direction: column; height: clamp(480px, 78vh, 940px); }
.pb-collection .section-heading { align-items: center; flex-direction: row; justify-content: space-between; gap: 8px; margin: 0; }
.pb-collection h2 { font-size: 17px; }
.pb-collection-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.pb-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 16px 0 10px; }
.pb-filters input, #pb-brand { grid-column: 1 / -1; min-width: 0; }
.pb-filters select { min-width: 0; grid-column: 1 / -1; }
#pb-clear-filters { grid-column: 1 / -1; justify-self: start; }
#pb-load-status { font-size: 12px; line-height: 1.5; color: var(--muted); }
.pb-products { display: flex; flex-direction: column; gap: 8px; min-height: 120px; flex: 1; overflow-y: auto; padding: 2px 6px 6px 2px; margin-top: 12px; overscroll-behavior-y: contain; }
.pb-products:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pb-product { border: 1px solid var(--border); background: var(--bg-card); border-radius: var(--card-radius); display: flex; gap: 10px; padding: 10px; min-width: 0; cursor: grab; }
.pb-product[draggable="true"]:active { cursor: grabbing; }
.pb-product-photo { flex: 0 0 54px; width: 54px; height: 64px; background: var(--bg-subtle); display: grid; place-items: center; color: var(--muted); font-size: 10px; text-align: center; overflow: hidden; }
.pb-product-photo img { width: 100%; height: 100%; object-fit: contain; }
.pb-product-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pb-product-info h3 { font-size: 13px; overflow-wrap: anywhere; }
.pb-product-info p { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.pb-product-info button { align-self: flex-start; margin-top: 3px; min-width: 44px; padding: 4px 10px; font-size: 12px; }
@media (max-width: 1250px) {
  .pb-workspace { grid-template-columns: minmax(240px, 280px) minmax(0, 1fr); }
  .pb-inspector { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; }
  .pb-inspector > .eyebrow, .pb-inspector > h2, .pb-inspector > .form-note { grid-column: 1 / -1; }
  .pb-inspector .pb-placed { grid-column: 2; grid-row: 3 / span 2; }
}
@media (max-width: 720px) {
  .pb-main { padding: 0 16px; }
  .pb-heading { gap: 12px; margin-top: 20px; }
  .pb-toolbar { justify-content: flex-start; gap: 6px; }
  .pb-layout-status { order: 1; }
  .pb-history .button { padding-inline: 8px; min-width: 44px; }
  .pb-history span { display: none; }
  .pb-action-label { display: none; }
  .pb-nav-side { justify-content: space-between; width: 100%; }
  .pb-room-navigation { width: 100%; flex-basis: 100%; gap: 4px; }
  .pb-workspace { grid-template-columns: 1fr; }
  .pb-plan { grid-row: 1; }
  .pb-workspace > .pb-collection { display: none; }
  .pb-library-dialog { width: 100%; max-width: none; max-height: 85dvh; margin: auto 0 0; border-radius: var(--card-radius) var(--card-radius) 0 0; }
  .pb-library-dialog .pb-collection { height: 80dvh; border: 0; }
  #pb-open-library { display: flex; position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); z-index: 6; box-shadow: var(--shadow-lg); }
  .pb-page .site-footer { padding-bottom: 88px; }
  #pb-close-library { display: inline-flex; }
  .pb-canvas { height: 54dvh; min-height: 360px; }
  .pb-canvas-bottom { flex-wrap: wrap; justify-content: flex-end; }
  .pb-canvas-bottom .form-note { flex: 1 1 120px; }
  .pb-inspector { display: block; }
  .pb-brief { grid-template-columns: 1fr; gap: 0; }
  .pb-brief h2 { margin-bottom: 18px; }
}
@media (max-width: 520px) {
  .pb-panel { padding: 16px; }
  .pb-settings > summary > span { font-size: 11px; }
  .pb-settings > summary > span:last-child { max-width: 110px; flex-shrink: 0; text-align: right; }
  .pb-page input, .pb-page select { font-size: 16px; }
  .pb-stage-heading .button { padding-inline: 8px; }
  .pb-canvas { padding: 10px; }
}
