.app-body[hidden], .app-top .search[hidden], .app-top .cabinet-mobile-view[hidden] { display: none; }
.room-launcher { width: min(100%, 550px); display: grid; gap: 14px; }
.room-launcher .panel-head { margin: 0; color: var(--text-muted); }
.room-launcher select { min-width: 0; width: 100%; }
.room-launcher .btn { justify-self: start; }
.app-top .cabinet-mobile-view { display: none; }
@media (max-width: 1100px) {
  .app-top .cabinet-mobile-view { display: inline-flex; flex-shrink: 0; }
}

.rw-defs { position: absolute; }
.room-work [hidden], #rw-invite-dialog [hidden] { display: none; }
.room-work {
  --rw-min-model: 320px;
  --rw-inspector-width: 292px;
  --rw-call-track: min(var(--rw-call-width, 232px), calc(100% - var(--rw-inspector-width) - var(--rw-min-model) - 12px));
  display: grid; grid-template-columns: var(--rw-call-track) 12px minmax(0,1fr) var(--rw-inspector-width);
  grid-template-rows: 52px minmax(0,1fr) 44px;
  grid-template-areas: "top top top top" "left call-split main right" "bottom bottom bottom bottom";
  height: 100dvh; min-height: 480px;
}
.rw-top, .rw-bottom {
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--panel); min-width: 0;
}
.rw-top { grid-area: top; border-bottom: 1px solid var(--border); }
.rw-bottom { grid-area: bottom; border-top: 1px solid var(--border); font-size: 11px; }
.rw-top .brand { flex: none; }
.rw-title { min-width: 0; padding-left: 12px; border-left: 1px solid var(--border); }
.rw-title h1 { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw-top .btn { flex: none; }
#room-entry { max-width: 480px; margin: 12vh auto; padding: 24px; display: grid; gap: 16px; justify-items: start; }
.rw-collab-bar { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 8px; font-size: 11px; }
#rw-screen-video { display: block; width: 100%; max-height: 36dvh; background: #0b0b0b; }
@media (max-width: 680px) {
  .rw-top { overflow-x: auto; }
  .rw-top .rw-title { min-width: 85px; }
}
.rw-left, .rw-right { min-width: 0; overflow: auto; background: var(--panel); }
.rw-left { grid-area: left; border-right: 1px solid var(--border); }
.rw-right { grid-area: right; border-left: 1px solid var(--border); }
.rw-panel { padding: 14px; display: grid; gap: 10px; }
.rw-panel + .rw-panel { border-top: 1px solid var(--border-soft); }
.rw-panel h2 { color: var(--text-muted); }
.rw-panel-head { min-height: 24px; }
.rw-camera { position: relative; display: grid; place-items: center; aspect-ratio: 16/10; border: 1px solid var(--border); border-radius: var(--radius); background: var(--well); overflow: hidden; }
.rw-camera video { position: absolute; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
#rw-remote-video { transform: none; }
.rw-camera #rw-local-screen { transform: none; object-fit: contain; background: #101012; }
#rw-local-share .auth-note { margin-top: 4px; }
#rw-retry-call { justify-self: start; }
.rw-camera span { display: grid; justify-items: center; gap: 6px; color: var(--text-muted); font-size: 11px; }
.rw-device-actions { gap: 6px; flex-wrap: wrap; }
.rw-device .btn { min-height: 32px; padding-inline: 6px; color: var(--text-muted); }
.rw-device .btn[aria-pressed="true"] { color: var(--ok); border-color: var(--ok); }
.rw-device meter { width: 56px; height: 10px; }
.rw-wall-select { width: 100%; min-width: 0; height: 34px; padding: 0 8px; background: var(--well); border: 1px solid var(--border); border-radius: var(--radius); }
.rw-facades h2:nth-of-type(2) { margin-top: 8px; }
.rw-main { grid-area: main; display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; min-width: 0; min-height: 0; }
.rw-toolbar, .rw-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--border); padding: 4px 10px; background: var(--panel); }
.rw-toolbar { justify-content: space-between; }
.rw-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.rw-tools .btn { background: transparent; border-color: transparent; }
.rw-tools .btn[aria-pressed="true"] { background: var(--hover); border-color: var(--border); }
.rw-tools .btn[aria-pressed="true"] svg { color: var(--accent); }
.rw-tools .btn:disabled { opacity: .46; }
.rw-meta { min-height: 32px; font-size: 11px; color: var(--text-muted); }
.rw-meta .label { color: var(--text-muted); }
#rw-follow { color: var(--accent); }
.rw-follow-object { stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.rw-canvas.viewport { height: auto; min-height: 0; grid-area: auto; }
.rw-canvas > svg, #rw-expanded, #rw-wall-3d { position: absolute; inset: 0; width: 100%; height: 100%; }
#rw-expanded { pointer-events: none; }
#rw-expanded:has(#rw-house) { pointer-events: auto; }
#rw-facade { touch-action: none; user-select: none; -webkit-user-select: none; }
#rw-facade:focus { outline: none; }
#rw-facade:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }
#rw-facade[data-tool="rect"] { cursor: crosshair; }
#rw-facade[data-tool="move"] .rw-hit { cursor: move; }
.rw-wall-shape { fill: var(--panel-2); fill-rule: evenodd; stroke: var(--text-dim); vector-effect: non-scaling-stroke; }
.rw-joints { color: var(--well); opacity: .7; pointer-events: none; }
.rw-selection { stroke: var(--accent); stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; fill: none; pointer-events: none; }
.rw-selection.rw-draft { fill: var(--accent); fill-opacity: .15; }
.rw-hit { fill: transparent; cursor: pointer; }
.rw-hint { padding: 7px 10px; border-top: 1px solid var(--border); color: var(--text-muted); background: var(--panel); font-size: 11px; }
#rw-loading { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; color: var(--text-muted); }
#rw-loading[hidden] { display: none; }
#rw-preview { height: 190px; position: relative; background: var(--well); border: 1px solid var(--border); border-radius: var(--radius); }
.rw-orbit #rw-preview { display: none; }
#rw-house { position: absolute; inset: 0; background: transparent; }
#rw-house:focus-within { outline: 1px solid var(--accent); outline-offset: -1px; }
.rw-list { display: grid; gap: 4px; min-width: 0; }
.rw-choice { width: 100%; min-width: 0; text-align: left; padding: 7px 8px; border: 1px solid transparent; border-radius: var(--radius); font-size: 12px; overflow-wrap: anywhere; }
.rw-choice:hover { background: var(--panel-2); }
.rw-choice[aria-pressed="true"] { background: var(--hover); box-shadow: inset 2px 0 var(--accent); }
.rw-choice small { display: block; color: var(--text-muted); font-size: 11px; }
.rw-material-row { display: flex; align-items: center; min-width: 0; gap: 4px; }
.rw-material-row .rw-choice { display: flex; gap: 8px; align-items: center; }
.rw-swatch { flex: 0 0 24px; height: 24px; border: 1px solid var(--border-strong); border-radius: var(--radius); }
.rw-remove { flex: none; }
.rw-form { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.rw-form input, .rw-form textarea { width: 100%; min-width: 0; }
.rw-form textarea { background: var(--well); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 8px; resize: vertical; }
.rw-form .btn { justify-self: start; }
#rw-material-status, #rw-requests { color: var(--text-muted); font-size: 11px; overflow-wrap: anywhere; }
#rw-material-status:empty { display: none; }
#rw-requests li { border-bottom: 1px solid var(--border-soft); padding: 4px 0; }
.rw-reference { text-decoration: underline; text-underline-offset: 2px; }
#rw-invite-result input { width: 100%; }
@media (max-width: 1050px) {
  .room-work { --rw-inspector-width: 240px; }
}
@media (max-width: 800px) {
  .rw-top { min-height: 52px; flex-wrap: wrap; padding-block: 8px; gap: 8px; }
  .rw-canvas.viewport { min-height: 54dvh; }
  .rw-bottom { min-height: 44px; }
}
@media (max-width: 450px) {
  .rw-top .brand img { width: 80px; height: auto; }
  .rw-title { flex: 1; }
  .rw-top .grow { display: none; }
  .rw-left { border-right: 0; }
  .rw-right { border-left: 0; border-top: 1px solid var(--border); }
  .rw-camera { max-width: 240px; width: 100%; }
}
.room-work.rw-staff {
  --rw-min-model: 720px;
  --rw-inspector-width: 0px;
  grid-template-columns: var(--rw-call-track) 12px minmax(0,1fr);
  grid-template-rows: 46px minmax(0,1fr) 38px;
  grid-template-areas: "top top top" "left call-split main" "bottom bottom bottom";
}
.room-work:has(> #rw-room-panel[hidden]) { --rw-call-track: 0px; }
.rw-call-split { grid-area: call-split; }
.rw-staff .rw-left { border-right: 0; }
.rw-studio-host { grid-area: main; min-width: 0; min-height: 0; position: relative; }
.rw-studio-host iframe { display: block; width: 100%; height: 100%; border: 0; }
.rw-studio-host { display: grid; grid-template: minmax(0,1fr) / minmax(0,1fr); }
.rw-room-draft { display: grid; grid-template-rows: auto minmax(0,1fr); min-height: 0; }
.rw-room-draft .rw-meta { margin: 0; }
.rw-room-draft-model { min-height: 0; position: relative; }
.rw-studio-empty { padding: 24px; align-content: center; justify-items: center; height: 100%; text-align: center; }
@media (max-width: 959px) {
  .room-work, .room-work.rw-staff {
    height: auto;
    grid-template-columns: minmax(0,1fr);
    grid-template-rows: auto auto 24px auto auto auto;
    grid-template-areas: "top" "left" "call-split" "main" "right" "bottom";
  }
  .room-work.rw-staff {
    grid-template-rows: auto auto 24px auto auto;
    grid-template-areas: "top" "left" "call-split" "main" "bottom";
  }
  .rw-left { max-height: min(var(--rw-call-height, 290px), 75dvh); }
  .rw-camera { max-width: 360px; width: 100%; }
  .rw-canvas.viewport { min-height: 54dvh; }
  .rw-studio-host { min-height: 75dvh; }
  .rw-studio-host iframe { height: 75dvh; }
  .rw-room-draft { height: 75dvh; }
}

.rw-call-bar { display: flex; flex-wrap: wrap; gap: 5px; }
.rw-call-body, .rw-call-settings, .rw-chat { display: grid; gap: 8px; min-width: 0; }
.rw-call-settings > :not(summary) { margin-top: 8px; }
.rw-call-settings summary { cursor: pointer; }
.rw-call-settings select { width: 100%; min-width: 0; }
.rw-media-stage:not([data-source="remote"]) .rw-stage-remote,
.rw-media-stage:not([data-source="local"]) .rw-stage-local,
.rw-media-stage:not([data-source="screen"]) .rw-stage-screen { display: none; }
#rw-remote-video.rw-video-muted { visibility: hidden; }
#rw-remote:has(.rw-video-muted) .rw-camera { aspect-ratio: auto; min-height: 0; border: 0; }
.rw-chat { padding-top: 10px; border-top: 1px solid var(--border); }
.rw-chat ol { max-height: 180px; overflow: auto; padding: 0; margin: 0; list-style: none; }
.rw-chat li { display: grid; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--border-soft); overflow-wrap: anywhere; }
.rw-chat li b { color: var(--text-muted); font-size: 11px; }
.rw-chat-form { display: flex; flex-wrap: wrap; gap: 5px; }
.rw-chat-form input { flex: 1 1 85px; min-width: 0; }
.rw-chat .auth-note:empty { display: none; }
.rw-media-stage .rw-camera { max-width: 720px; }
