/* Implantation (room planner) and Rendu (photo render) views. Loaded after styles.css. */
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.planner-pane, .render-pane { position: absolute; inset: 0; background: #e9e6e0; overflow: hidden; }
.room-view .reset, .room-view .dims-chip { display: none; }
.room-view .stage-top .presets { display: none; }
.room-view .stage-top { justify-content: flex-end; }

.pl-canvas, .rd-canvas { position: absolute; inset: 0; }
.pl-canvas canvas, .rd-canvas canvas { display: block; touch-action: none; }
.pl-overlay { position: absolute; inset: 0; pointer-events: none; }
.pl-overlay > * { position: absolute; left: 0; top: 0; will-change: transform; }
.pl-band { border: 1px dashed #1f6fd1; background: rgba(31, 111, 209, .08); border-radius: 2px; }
.pl-toolbar { position: absolute; top: 14px; left: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: calc(100% - 330px); }
.pl-toolbar .toggle { margin: 0; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 9px; padding: 5px 10px; }
.pl-toolbar .ghost:disabled { opacity: .45; cursor: default; }

.pl-palette { position: absolute; left: 14px; top: var(--pl-top, 62px); bottom: 60px; width: 212px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.pl-palette-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.pl-tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.pl-tabs button { flex: 1; border: 0; background: none; padding: 9px 4px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; }
.pl-tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.pl-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; overflow-y: auto; align-content: start; }
.pl-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 7px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--accent); cursor: grab; touch-action: none; user-select: none; }
.pl-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.pl-card:active { cursor: grabbing; }
.pl-card-t { font-size: 12px; font-weight: 600; color: var(--ink); text-align: center; line-height: 1.2; }
.pl-card-s { font: 500 10.5px var(--mono); color: var(--ink-2); }

.pl-hint { position: absolute; left: 240px; right: 14px; bottom: 14px; margin: 0; font-size: 13px; color: var(--ink-2); background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-left: 4px solid #cfc8bb; border-radius: 9px; padding: 8px 12px; pointer-events: none; }
.pl-hint.ok { border-left-color: #2f9e6b; color: var(--ink); }
.pl-hint.warn { border-left-color: #e0a31a; color: var(--ink); background: #fffaf0; }
.pl-hint.bad { border-left-color: #d64545; color: var(--late); background: #fff5f4; }
.pl-tip { position: absolute; left: 0; top: 0; max-width: 300px; font-size: 12.5px; line-height: 1.35; padding: 6px 9px; border-radius: 8px; background: #1d1b18; color: #fff; pointer-events: none; z-index: 5; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.pl-tip.warn { background: #8a5a06; }
.pl-tip.bad { background: #a62f2f; }
.pl-label { font: 600 11.5px var(--mono); color: #fff; background: #2f9e6b; padding: 3px 7px; border-radius: 6px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.pl-label.warn { background: #b07d10; }
.pl-label.bad { background: #c23b3b; }
.pl-dim { font: 500 11px var(--mono); color: var(--ink-2); background: rgba(255, 255, 255, .85); padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.pl-handle { pointer-events: auto; display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--ink); background: rgba(255, 255, 255, .95); border: 1px solid var(--accent); border-radius: 999px; padding: 4px 9px 4px 6px; cursor: grab; touch-action: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .14); }
.pl-handle svg { color: var(--accent); }
.pl-handle:hover { background: var(--accent-soft); }
.dragging .pl-handle { display: none !important; }
.dragging, .dragging * { cursor: grabbing !important; }
.pl-trash { position: absolute; left: 50%; bottom: 62px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 12px; background: rgba(255, 255, 255, .95); border: 2px dashed #d64545; color: #a62f2f; font-weight: 600; font-size: 13px; z-index: 4; }
.pl-trash.over { background: #d64545; color: #fff; border-style: solid; }
.pl-walk-help { position: absolute; left: 50%; top: 62px; transform: translateX(-50%); margin: 0; font-size: 12.5px; background: rgba(29, 27, 24, .78); color: #fff; padding: 6px 12px; border-radius: 8px; pointer-events: none; }

.rd-shots { position: absolute; top: 14px; left: 14px; display: flex; gap: 6px; flex-wrap: wrap; max-width: calc(100% - 640px); }
.rd-shots .chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.rd-panel { position: absolute; right: 14px; top: 62px; bottom: 70px; width: 248px; overflow-y: auto; background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.rd-panel section + section { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.rd-panel h4 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.rd-panel .pills { display: flex; flex-wrap: wrap; gap: 6px; }
.rd-panel .pill[aria-pressed="true"], .rd-quality .pill[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.rd-panel .toggle { margin-bottom: 8px; }
.rd-slider { display: block; font-size: 13px; color: var(--ink-2); margin-top: 10px; }
.rd-slider > span:first-child { display: flex; justify-content: space-between; }
.rd-slider em { font: 500 11.5px var(--mono); font-style: normal; color: var(--ink); }
.rd-slider input { width: 100%; accent-color: var(--accent); }
.rd-slider input[data-set="temp"] { accent-color: #d58a3a; }
.rd-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-2); }
.rd-scale i { font-style: normal; }
.rd-sw-group + .rd-sw-group { margin-top: 10px; }
.rd-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.rd-sw { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); padding: 3px; background: var(--surface); cursor: pointer; }
.rd-sw span { display: block; width: 100%; height: 100%; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.rd-sw[aria-pressed="true"] { border: 2px solid var(--ink); padding: 2px; }
.rd-foot { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.rd-quality { display: flex; gap: 4px; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.rd-quality .pill { border: 0; padding: 5px 9px; }
.rd-progress { margin-right: auto; position: relative; min-width: 260px; max-width: 520px; flex: 1; font-size: 12.5px; color: var(--ink); background: rgba(255, 255, 255, .94); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; overflow: hidden; }
.rd-progress::before { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--p, 0%); background: var(--accent); transition: width .2s; }
.rd-progress.done::before { background: #2f9e6b; }
.rd-progress > span { position: relative; }

.furn-row { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 8px; margin-bottom: 4px; border: 1px solid transparent; }
.furn-row.on { border-color: #e0861a; background: #fff7ec; }
.furn-row select { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 5px 6px; font-size: 12.5px; background: var(--surface); }
.furn-name { border: 0; background: none; font-weight: 600; font-size: 12.5px; cursor: pointer; padding: 4px 2px; min-width: 84px; text-align: left; color: var(--ink); }
.ghost.small.icon { padding: 5px 7px; display: inline-flex; }
.furn-add { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.furn-tools { display: flex; gap: 6px; flex-wrap: wrap; }

@media screen and (max-width: 860px) {
  .pl-palette { top: auto; bottom: 56px; left: 10px; right: 10px; width: auto; height: 150px; }
  .pl-cards { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
  .pl-hint { left: 10px; right: 10px; bottom: 10px; }
  .pl-toolbar { top: 56px; left: 10px; max-width: calc(100% - 20px); }
  .rd-panel { top: auto; left: 10px; right: 10px; width: auto; bottom: 64px; height: 38%; }
  .rd-shots { top: 56px; left: 10px; max-width: calc(100% - 20px); }
  .rd-progress { min-width: 0; flex-basis: 100%; }
}
.rd-note { margin: 0 0 8px; font-size: 12px; color: var(--warn); }
.rd-panel-toggle { position: absolute; right: 14px; top: 62px; z-index: 2; }
.render-pane .rd-panel { top: 100px; }
.rd-collapsed .rd-panel { display: none; }
.rd-collapsed .rd-shots { max-width: calc(100% - 340px); }
.rd-led { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin: -2px 0 10px 24px; font-size: 12px; color: var(--ink-2); }
.rd-led > span { flex-basis: 100%; }
.rd-led .rd-sw { width: 24px; height: 24px; }
.rd-denoise { margin: 0; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; }

/* Implantation: room drawn from the plan (wall handles, typed lengths, dimension chains) */
.pl-dim { pointer-events: auto; cursor: text; border: 1px solid transparent; }
.pl-dim:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
.pl-wall-handle { pointer-events: auto; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1.5px solid var(--accent); background: #fff; color: var(--accent); cursor: ew-resize; touch-action: none; box-shadow: 0 1px 5px rgba(0, 0, 0, .2); }
.pl-wall-handle.depth { cursor: ns-resize; }
/* room shape handles: steps, corners, pillars (smaller and square, so they read apart from the wall handles) */
.pl-shape-handle { pointer-events: auto; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border-radius: 5px; border: 1.5px solid #8a5a12; background: #fff7ea; color: #8a5a12; cursor: move; touch-action: none; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.pl-shape-handle:hover, .pl-shape-handle:focus-visible { background: #8a5a12; color: #fff; }
.pl-shape-handle.corner { border-radius: 50%; border-style: dashed; cursor: nwse-resize; }
.pl-shape-handle.step.face { cursor: ns-resize; }
.pl-shape-handle.beam.size, .pl-shape-handle.pillar.size { cursor: nwse-resize; width: 16px; height: 16px; }
.pl-shape-handle.free { width: 24px; height: 24px; border-radius: 50%; border-color: var(--accent); color: var(--accent); background: #fff; }
.pl-shape-handle.free.turn { cursor: grab; }
.pl-shape-handle.point { width: auto; min-width: 22px; height: 16px; padding: 0 4px; border-radius: 8px; border-color: #2f6fb3; color: #2f6fb3; background: #fff; font: 600 9px/1 system-ui, sans-serif; cursor: ew-resize; }
.pl-shape-handle.point:hover, .pl-shape-handle.point:focus-visible { background: #2f6fb3; color: #fff; }
.pl-shape-handle.bend { width: 12px; height: 12px; border-radius: 2px; transform: rotate(45deg); background: #fff; cursor: grab; }
.pl-shape-handle.bend svg { display: none; }
.pl-shape-handle.mid { width: 12px; height: 12px; border-radius: 50%; opacity: .75; cursor: copy; }
.pl-shape-handle.mid svg { display: none; }
.pl-shape-handle.vertex { width: 14px; height: 14px; border-radius: 50%; background: #8a5a12; color: #fff; cursor: move; }
.drawing .pl-canvas { cursor: crosshair; }
.pl-draw[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.pl-wall-handle:hover { background: var(--accent); color: #fff; }
.dragging .pl-wall-handle, .dragging .pl-dim { display: none !important; }
.dragging .pl-chain, .dragging .pl-code { opacity: .75; }
.pl-len-edit { pointer-events: auto; z-index: 6; }
.pl-len-edit label { display: flex; align-items: center; gap: 5px; background: #fff; border: 1.5px solid var(--accent); border-radius: 8px; padding: 3px 7px; font-size: 11.5px; color: var(--ink-2); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.pl-len-edit input { width: 64px; border: 0; outline: 0; font: 600 13px var(--mono); color: var(--ink); background: none; text-align: right; }
.pl-chain { font: 500 10.5px var(--mono); color: #3a3732; background: rgba(233, 230, 224, .82); padding: 0 3px; border-radius: 3px; white-space: nowrap; }
.pl-chain.gap { color: #8a8378; font-style: italic; }
.pl-code { font: 700 10.5px var(--mono); color: var(--ink); background: rgba(255, 255, 255, .82); padding: 1px 4px; border-radius: 4px; white-space: nowrap; letter-spacing: .02em; }

/* toolbar popovers: empty room, shortcuts */
.pl-help-btn { min-width: 30px; font-weight: 700; }
.pl-toolbar [aria-expanded="true"] { border-color: var(--ink); }
.pl-pop { position: absolute; top: calc(var(--pl-top, 62px) - 4px); left: 240px; z-index: 8; width: 300px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .16); font-size: 13px; }
.pl-pop h4 { margin: 0 0 10px; font-size: 13.5px; }
.pl-field { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--ink-2); }
.pl-field input { width: 82px; border: 1px solid var(--line); border-radius: 7px; padding: 5px 7px; font: 500 13px var(--mono); text-align: right; }
.pl-field i { font-style: normal; font-size: 12px; }
.pl-field .pl-shapes { grid-column: 1 / -1; justify-self: start; }
.pl-pop-note { margin: 4px 0 12px; font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.pl-pop-foot { display: flex; justify-content: flex-end; gap: 8px; }
.pl-pop .primary.small { padding: 6px 12px; font-size: 12.5px; }
.pl-help { width: 380px; }
.pl-plan-list { display: grid; gap: 4px; margin-bottom: 10px; max-height: 50vh; overflow: auto; }
.pl-plan-room { display: flex; align-items: center; gap: 10px; width: 100%; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 12.5px; color: var(--ink); text-align: left; cursor: pointer; }
.pl-plan-room:hover, .pl-plan-room:focus-visible { border-color: var(--accent); background: #faf8f4; }
.pl-plan-room svg { flex: none; }
.pl-plan-room path { fill: #efe9df; stroke: var(--ink-2); stroke-width: 1.2; stroke-linejoin: round; }
.pl-help dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
.pl-help dt { color: var(--ink); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.pl-help dd { margin: 0; color: var(--ink-2); font-size: 12.5px; }
.pl-help kbd { font: 600 11px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: #faf8f4; }

/* catalogue families */
.pl-fam { grid-column: 1 / -1; margin: 6px 2px 0; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.pl-fam:first-child { margin-top: 0; }
@media screen and (max-width: 860px) {
  .pl-pop { top: var(--pl-top, 100px); left: 10px; right: 10px; width: auto; }
}

/* sloping wall: its heights under the length label */
.pl-dim-h { display: block; font-size: 10px; opacity: .8; }
/* catalogue pictures: real proportions, bottom-aligned so floor units stand on one line */
.pl-pic-box { display: flex; align-items: flex-end; justify-content: center; width: 64px; height: 50px; margin-bottom: 3px; }
.pl-pic { display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,.12)); }
