/* Fireplace in your room — room visualizer (design: isRoom). */
/* 40px from the hero band to the stage (design: hero has no margin, section padding-top 40). */
.pm-room-page .pm-page-hero { margin-bottom: 0; }
main.pm-room-page .pm-page-hero + .pm-page-body.pm-room-body { padding-top: 40px; }
.pm-room { gap: 40px; }
.pm-room__main { min-width: 0; }

/* Stage: photo + fixed-scale overlay + vertical ruler */
.pm-room__stage {
    position: relative; overflow: hidden; isolation: isolate;
    aspect-ratio: 16 / 10; border-radius: var(--pm-radius-panel);
    border: 1px solid var(--pm-line); background: var(--pm-well);
    user-select: none; -webkit-user-select: none; touch-action: none; cursor: grab;
}
.pm-room__stage.is-panning { cursor: grabbing; }
.pm-room__stage:focus-visible { outline: 2px solid var(--pm-red); outline-offset: 3px; }
.pm-room__photo {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    transform-origin: 50% 50%; will-change: transform; pointer-events: none; max-width: none;
}
.pm-room__overlay { position: absolute; left: 0; top: 0; cursor: grab; touch-action: none; }
.pm-room__overlay.is-dragging { cursor: grabbing; }
.pm-room__overlay svg { display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pm-room__overlay:focus-visible { outline: 2px solid var(--pm-red); outline-offset: 4px; }
/* Product cut-out PNG (Products → Dimensions & cut-outs), stretched to the surround's true size. */
.pm-room__cutout { display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; max-width: none; }
.pm-room__cutout[hidden] { display: none; }
.pm-room__auto { padding: 12px 20px; }
.pm-room__auto[aria-busy="true"] { opacity: 0.6; cursor: progress; }

/* Empty state: no photo yet (design: add_photo_alternate + copy, centred). */
.pm-room__stage.is-empty { cursor: default; touch-action: auto; }
.pm-room__empty-state {
    position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center;
    gap: 0; padding: 24px; text-align: center; cursor: pointer;
}
.pm-room__stage.is-empty .pm-room__empty-state { display: flex; }
.pm-room__empty-state .ms { color: var(--pm-red); font-size: 44px; }
.pm-room__empty-title { font-size: 16px; line-height: 24px; color: var(--pm-ink); margin: 12px 0 4px; }
.pm-room__empty-text { font-size: 13px; line-height: 20px; color: var(--pm-muted); }
.pm-room__tag {
    position: absolute; left: 50%; top: -26px; transform: translateX(-50%);
    background: rgba(28, 27, 27, 0.78); color: var(--pm-white);
    font-size: 11px; line-height: 14px; letter-spacing: 0.06em;
    padding: 4px 8px; border-radius: var(--pm-radius-sm); white-space: nowrap; pointer-events: none;
}

/* Rulers (ticks are generated in precast-room.js) */
.pm-room__vruler {
    position: absolute; left: 0; top: 0; bottom: 0; width: 34px; z-index: 2;
    background: rgba(252, 249, 248, 0.88); border-right: 1px solid rgba(28, 27, 27, 0.15); pointer-events: none;
}
.pm-room__hruler[hidden], .pm-room__vruler[hidden] { display: none; }
.pm-room__hruler {
    position: relative; height: 34px; margin-top: 10px; overflow: hidden;
    border-radius: var(--pm-radius); border: 1px solid var(--pm-line); background: var(--pm-band);
}
.pm-room__tick { position: absolute; background: rgba(28, 27, 27, 0.45); }
.pm-room__tick.is-major { background: var(--pm-ink); }
.pm-room__hruler .pm-room__tick { top: 0; width: 1px; }
.pm-room__vruler .pm-room__tick { right: 0; height: 1px; }
.pm-room__num { position: absolute; font-size: 10px; line-height: 12px; letter-spacing: 0.04em; color: var(--pm-ink); }
.pm-room__hruler .pm-room__num { bottom: 3px; transform: translateX(2px); }
.pm-room__vruler .pm-room__num { left: 3px; transform: translateY(2px); }
.pm-room__unit {
    position: absolute; left: 6px; bottom: 3px; z-index: 1; background: var(--pm-band); padding-right: 2px;
    font-size: 9px; line-height: 12px; letter-spacing: 0.1em; font-weight: 700; text-transform: uppercase; color: var(--pm-red);
}

/* Toolbar under the stage */
.pm-room__bar { margin-top: 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pm-room__upload { padding: 12px 24px; cursor: pointer; }
.pm-room__upload:focus-within { outline: 2px solid var(--pm-red); outline-offset: 3px; }
.pm-room__note { font-size: 12px; line-height: 18px; color: var(--pm-muted); margin: 0; flex: 1 1 200px; }

/* Side panels */
.pm-room__panel { padding: 24px; }
.pm-room__step { margin-bottom: 16px; }
.pm-room__text { font-size: 13px; line-height: 20px; color: var(--pm-muted); margin: 0 0 16px; }
.pm-room__small { display: block; font-size: 12px; line-height: 18px; color: var(--pm-muted); margin: 0; }
.pm-room__control { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.pm-room__label { font-size: 12px; line-height: 16px; letter-spacing: 0.08em; font-weight: 600; text-transform: uppercase; color: var(--pm-muted); }
.pm-room__label output { color: var(--pm-ink); }
.pm-room__control input[type="range"] { width: 100%; min-width: 0; accent-color: var(--pm-red); margin: 0; }
.pm-room__number {
    width: 100%; background: var(--pm-page); border: 1px solid var(--pm-line-strong); border-radius: 8px;
    padding: 10px 12px; font-size: 14px; color: var(--pm-ink); outline: none;
}
.pm-room__number:focus, .pm-room__search input:focus { border-color: var(--pm-red); box-shadow: 0 0 0 3px var(--pm-red-tint); }
.pm-room__control[hidden] { display: none; }
.pm-room__fixed { margin-top: 14px; }
.pm-room__reset {
    display: block; width: 100%; margin-top: 16px; padding: 12px; background: transparent; cursor: pointer;
    border: 1px solid var(--pm-line-strong); border-radius: var(--pm-radius); color: var(--pm-ink);
    font-size: 12px; line-height: 16px; letter-spacing: 0.1em; font-weight: 600; text-transform: uppercase;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.pm-room__reset:hover { border-color: var(--pm-red); color: var(--pm-red); }
.pm-room__reset:focus-visible { outline: 2px solid var(--pm-red); outline-offset: 2px; }

.pm-room__search { position: relative; margin-bottom: 14px; }
.pm-room__search .ms { position: absolute; left: 12px; top: 11px; font-size: 20px; color: var(--pm-muted); pointer-events: none; }
.pm-room__search input {
    width: 100%; background: var(--pm-page); border: 1px solid var(--pm-line-strong); border-radius: 8px;
    padding: 11px 12px 11px 40px; font-size: 14px; color: var(--pm-ink); outline: none;
}
.pm-room__meta {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px;
    font-size: 11px; line-height: 16px; letter-spacing: 0.08em; font-weight: 600; text-transform: uppercase; color: var(--pm-muted);
}
.pm-room__meta-sel { color: var(--pm-red); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.pm-room__list {
    list-style: none; margin: 0; padding: 2px; display: flex; flex-direction: column; gap: 8px;
    max-height: 320px; overflow-y: auto; overscroll-behavior: contain;
}
.pm-room__opt {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 13px; cursor: pointer;
    border: 1px solid var(--pm-line-strong); background: var(--pm-page); border-radius: 8px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.pm-room__opt:hover, .pm-room__opt.is-active { border-color: var(--pm-red); }
.pm-room__opt.is-active { box-shadow: 0 0 0 2px var(--pm-red-tint); }
.pm-room__opt[aria-selected="true"] { border-color: var(--pm-red); background: var(--pm-red-soft); }
.pm-room__opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pm-room__opt-name { font-size: 14px; line-height: 20px; color: var(--pm-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-room__opt[aria-selected="true"] .pm-room__opt-name { color: var(--pm-red); }
.pm-room__opt-style { font-size: 11px; line-height: 16px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pm-muted); }
.pm-room__opt-dims { font-size: 12px; line-height: 16px; color: var(--pm-muted); white-space: nowrap; }
.pm-room__empty { font-size: 13px; line-height: 20px; color: var(--pm-muted); margin: 4px 0 0; }

@media (prefers-reduced-motion: reduce) {
    .pm-room__opt, .pm-room__reset { transition: none; }
}

/* --- Phones (design mobile, ≤900px: `rstage` / `rempty` / `rup`) ----------- */
@media (max-width: 900px) {
    .pm-room__stage { aspect-ratio: 4 / 3; }
    .pm-room__empty-state { padding: 0 24px; }
    .pm-room__empty-state .ms { font-size: 36px; }
    .pm-room__empty-title { font-size: 15px; margin-top: 8px; }
    .pm-room__bar { flex-direction: column; align-items: stretch; gap: 10px; }
    .pm-room__upload, .pm-room__auto { justify-content: center; padding: 14px 20px; }
    .pm-room__note { flex: 0 0 auto; text-align: center; }
    .pm-room__vruler { width: 34px; }
    .pm-room-page .pm-cta-card { padding: 24px; }
    .pm-room-page .pm-cta-card h3 { font-size: 24px; line-height: 32px; }
    .pm-room-page .pm-cta-card p { margin-bottom: 18px; }

    /* Empty stage copy at `normal` line height under a 44px icon line (design `rempty`). */
    .pm-room__empty-state { margin: 0; }
    .pm-room__empty-state .ms { height: 44px; line-height: 44px; }
    .pm-room__empty-title, .pm-room__empty-text { line-height: normal; }
    /* Upload label: 14px/20px padding around an 18px icon line = 50px; no label margin. */
    .pm-body label.pm-btn.pm-room__upload { min-height: 50px; margin: 0; }
    /* Panels: headings, labels and list rows at `normal` line height. */
    .pm-room__step, .pm-room__label, .pm-room__meta { line-height: normal; }
    .pm-room__label { margin: 0; }
    .pm-room { row-gap: 20px; }
    .pm-room__list { padding: 0; }
    .pm-room__control input[type="range"] { margin: 2px; }
    .pm-room__fixed { margin-top: 0; }
    .pm-room__reset { min-height: 52px; padding-top: 0; padding-bottom: 0; }
    .pm-room__opt-name { line-height: 18px; }
    .pm-room__opt-style { line-height: 14px; }
}
