body.client-layout {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  margin: 0;
}

/* ── Overlay panels (name prompt, waiting) ── */
.overlay-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.overlay-panel[hidden] { display: none; }

.panel-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 360px;
  width: 90%;
  text-align: center;
}

.panel-box h2 { font-size: 1.5rem; margin: 0; }

.panel-box input[type="text"] {
  width: 100%;
  text-align: center;
}

.panel-box button {
  width: 100%;
}

.waiting-text {
  font-size: 1.4rem;
  color: #888;
  margin: 0;
}

.qr-img {
  width: 180px;
  height: 180px;
  background: #fff;
  padding: 8px;
  border-radius: 8px;
}
.qr-img[hidden] { display: none; }

/* ── Content toggle button (active only) ── */
.content-toggle-btn {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 20;
  height: 44px;
  padding: 0 1rem;
  border: none;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.content-toggle-btn:hover { background: rgba(255, 255, 255, 0.28); }
.content-toggle-btn[hidden] { display: none; }

/* ── Fullscreen button (passive only) ── */
.fullscreen-btn {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 20;
  width: 44px;
  height: 44px;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.fullscreen-btn:hover { background: rgba(255, 255, 255, 0.28); }
.fullscreen-btn svg { width: 100%; height: 100%; }
.fullscreen-btn[hidden] { display: none; }

/* ── Content area ── */
.content-area {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
  z-index: 5;
}
.content-area[hidden] { display: none; }

/* ── Image wrapper (hosts zoom transform) ── */
.img-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}
.img-wrap[hidden] { display: none; }

.host-pointer {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 80, 80, 0.85);
  border: 2px solid #fff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 15;
  display: none;
}
.host-pointer.visible { display: block; }

.content-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}

/* Passive: image fills the whole viewport */
body.passive .img-wrap {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
}
body.passive .content-image {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

/* ── Text wrapper ── */
.content-text-wrap {
  width: 100%;
  height: 100%;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  padding: 1.5rem;
  box-sizing: border-box;
}
.content-text-wrap[hidden] { display: none; }

body.passive .content-text-wrap {
  overflow: hidden;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.content-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 1rem;
  line-height: 1.6;
  color: #e0e0e0;
  font-family: monospace;
  margin: 0;
}

body.passive .content-text {
  text-align: center;
}
