.controls-dock .camera-popover {
  position: absolute;
  z-index: 36;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(300px, calc(100vw - 28px));
  max-height: calc(100dvh - 160px);
  overflow-y: auto;
  padding: 16px;
  box-sizing: border-box;
  border: 1px solid #526650;
  border-radius: 18px;
  background: linear-gradient(145deg, #233a30, #14251e);
  box-shadow: 0 16px 40px #0006;
  color: #f3f0e6;
  font:
    13px/1.5 "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
  touch-action: pan-y;
}

.camera-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.camera-heading h2 {
  margin: 0;
  font-size: 16px;
}

.camera-popover button {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #435c4b;
  border-radius: 10px;
  background: #223a2f;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.camera-heading button {
  font-size: 23px;
  line-height: 1;
}

.camera-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 14px 0 10px;
}

.camera-options button[aria-pressed="true"] {
  border-color: #e5bf79;
  background: #e5bf7920;
  color: #efd59d;
}

.camera-lock {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  width: 100%;
  white-space: nowrap;
  cursor: pointer;
}

.camera-lock input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  accent-color: #e5bf79;
}

#cameraState {
  margin: 4px 0 0;
  color: #b3c2b5;
  font-size: 11px;
}

.camera-popover :focus-visible {
  outline: 2px solid #e5bf79;
  outline-offset: 3px;
}

#camera.camera-locked::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e5bf79;
}

@media (height <= 500px) and (orientation: landscape) {
  .controls-dock .camera-popover {
    max-height: calc(100dvh - 100px);
    padding: 12px;
  }
}
