/* The real room: the photo is the stage, as large as the screen allows; the editor's side
   panels and phone sheets around it. Turquoise marks what the customer is placing. */
.rr-stage { display: block; background: #1d2326; }
/* More specific than the engine's .rr-host (injected after this sheet), which is position:relative. */
.rr-stage > .rr-stage-host { position: absolute; inset: 0; }
.rr-tabs { grid-template-columns: repeat(3, 1fr); }
.rr-float { display: none; }
.rr-stage .pane-hint { background: rgba(255,255,255,.94); }

.rr-surfaces { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.rr-surfaces button { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: var(--r); padding: 7px 9px; font-size: 13px; font-weight: 600; cursor: pointer; text-align: start; min-height: 46px; }
.rr-surfaces button[aria-pressed=true] { border-color: var(--firuze); background: var(--firuze-wash); }
.rr-surfaces i { width: 26px; height: 26px; border-radius: 7px; flex: none; background: repeating-linear-gradient(45deg, #eee 0 4px, #fff 4px 8px); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); background-size: cover; }
.rr-surfaces small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.rr-tools { display: grid; gap: 10px; padding: 12px; border-radius: var(--r); background: var(--paper); margin-bottom: 14px; }
.rr-tools .seg { width: 100%; }
.rr-tools .seg button { flex: 1; padding: 0 6px; }
.rr-tools label { display: grid; gap: 2px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rr-current { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rr-current i { width: 40px; height: 40px; border-radius: 9px; flex: none; background-size: cover; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.rr-current b { display: block; font-size: 14px; }
.rr-current small { color: var(--muted); font-size: 12px; }
.rr-current .btn { margin-inline-start: auto; }

.rr-guide { display: block; width: 100%; max-width: 280px; margin: 4px auto 12px; }
.rr-check { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r); background: var(--firuze-wash); color: var(--firuze-deep); font-weight: 600; font-size: 13.5px; }
.rr-check.bad { background: var(--brick-wash); color: var(--brick); }
.rr-check b { font-size: 16px; color: var(--ink); }
.rr-check svg { width: 22px; height: 22px; flex: none; }
.rr-field { display: grid; gap: 6px; margin-top: 14px; }
.rr-field > span { font: 700 13px/1.4 var(--ui); color: var(--muted); }
.rr-field .row input[type=number] { width: 110px; min-height: 38px; text-align: center; }

.rr-quick { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
.rr-quick button { flex: none; width: 76px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 4px; font-size: 11px; line-height: 1.35; cursor: pointer; }
.rr-quick img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }

/* Live AR overlay: dom-overlay keeps it on screen over the camera. */
.lr-overlay { position: fixed; inset: 0; z-index: 60; pointer-events: none; font-family: var(--ui); }
.lr-overlay[hidden] { display: none; }
.lr-overlay > * { pointer-events: auto; }
.lr-top { position: absolute; top: 0; inset-inline: 0; display: flex; gap: 10px; align-items: center; padding: max(12px, env(safe-area-inset-top)) 12px 0; }
.lr-top p { flex: 1; margin: 0; background: rgba(20,24,26,.74); color: #fff; padding: 8px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.6; }
.lr-modes { position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 74px); left: 50%; transform: translateX(-50%); background: rgba(255,255,255,.95); box-shadow: var(--shadow); }
.lr-modes button { white-space: nowrap; }
.lr-modes button[aria-selected=true] { background: var(--ink); color: #fff; }
.lr-bottom { position: absolute; bottom: 0; inset-inline: 0; padding: 0 10px max(12px, env(safe-area-inset-bottom)); }
.lr-tools { display: grid; gap: 8px; }
.lr-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; background: rgba(255,255,255,.95); border-radius: 16px; padding: 8px; }
.lr-count { font-weight: 700; font-size: 13px; margin-inline-end: auto; padding: 0 6px; }
.lr-hint { margin: 0; background: rgba(255,255,255,.95); border-radius: 16px; padding: 10px 14px; font-size: 13.5px; }
.lr-exp { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.lr-exp input { width: 110px; }
.lr-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.lr-strip button { flex: none; width: 74px; border: 2px solid transparent; border-radius: 14px; background: rgba(255,255,255,.95); padding: 4px; font-size: 11px; line-height: 1.3; }
.lr-strip button[aria-pressed=true] { border-color: var(--firuze); }
.lr-strip img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.lr-strip .lr-sw i { display: block; aspect-ratio: 1; border-radius: 10px; background-size: cover; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); margin-bottom: 3px; }
.lr-strip .lr-sw span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lr-more { display: grid; place-content: center; justify-items: center; gap: 4px; font-weight: 700; color: var(--firuze-deep); }
.lr-more svg { width: 26px; height: 26px; }
.lr-gear, .rr-gear { position: absolute; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; color: var(--ink); box-shadow: 0 3px 12px rgba(0,0,0,.35); display: grid; place-items: center; cursor: pointer; z-index: 5; padding: 0; }
.lr-gear svg, .rr-gear svg { width: 22px; height: 22px; }
.lr-gear[hidden], .rr-gear[hidden] { display: none; }
/* The selected piece's real size, under its settings icon. */
.lr-dims { position: absolute; z-index: 5; transform: translateX(-50%); background: rgba(20,24,26,.78); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 10px; white-space: nowrap; pointer-events: none; }
.lr-dims[hidden] { display: none; }
#live-undo svg { width: 20px; height: 20px; }
/* While the phone looks for the floor: a phone sweeping side to side. */
.lr-coach { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none !important; }
.lr-coach[hidden] { display: none; }
.lr-phone { width: 46px; height: 80px; border: 3px solid #fff; border-radius: 10px; box-shadow: 0 2px 14px rgba(0,0,0,.45); animation: lr-sweep 2.4s ease-in-out infinite; }
@keyframes lr-sweep { 0%, 100% { transform: translateX(-60px) rotate(-12deg); } 50% { transform: translateX(60px) rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .lr-phone { animation: none; } }
.lr-sheet { position: absolute; inset-inline: 0; bottom: 0; max-height: 62dvh; overflow: auto; background: var(--card); border-radius: 20px 20px 0 0; padding: 14px 14px max(16px, env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); display: grid; gap: 12px; z-index: 6; }
.lr-sheet[hidden] { display: none; }
.lr-sheet-head { display: flex; align-items: center; gap: 10px; }
.lr-sheet-head b { flex: 1; font-size: 16px; }
.lr-cat .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 999px) {
  .rr-float { display: inline-flex; position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 4; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
  .rr-float button { white-space: nowrap; padding: 0 12px; }
  .rr-float button[aria-selected=true] { background: var(--ink); color: #fff; }
  .rr-stage .pane-hint { bottom: 10px; }
  .rr-tabs { display: none; }
}
@media (max-width: 999px) { .hide-phone { display: none !important; } }

/* The way into live AR on phones: always on the stage, above the hint. */
.rr-live-fab { display: none; }
@media (max-width: 999px) {
  .rr-live-fab { display: inline-flex; position: absolute; inset-inline-start: 12px; bottom: 64px; z-index: 6; box-shadow: var(--shadow-lg); }
  .rr-live-fab.pulse { animation: lr-pulse 1.6s ease-in-out 3; }
}
@keyframes lr-pulse { 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .rr-live-fab.pulse { animation: none; } }
.lr-heights .btn[aria-pressed=true] { border-color: var(--firuze); color: var(--firuze-deep); }
