.topovec-camera-viewer {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 0.6rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--marimo-text-color, #1f2937);
}

.topovec-camera-toolbar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.topovec-camera-viewer[data-show-toolbar="false"] .topovec-camera-toolbar {
  display: none;
}

.topovec-camera-toolbar button {
  border: 1px solid rgba(15, 23, 42, 0.18);
  background: rgba(248, 250, 252, 0.92);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font: inherit;
  cursor: pointer;
}

.topovec-camera-toolbar button:hover {
  background: rgba(226, 232, 240, 0.95);
}

.topovec-camera-status {
  min-height: 1.2rem;
  flex: 1 1 100%;
  font-size: 0.74rem;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
  opacity: 0.8;
}

.topovec-camera-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.88), rgba(226, 232, 240, 0.82)),
    linear-gradient(135deg, rgba(226, 232, 240, 0.92), rgba(241, 245, 249, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 10px 30px rgba(15, 23, 42, 0.08);
  cursor: grab;
  touch-action: none;
}

.topovec-camera-viewer[data-drag-mode="pan"] .topovec-camera-viewport {
  cursor: move;
}

.topovec-camera-viewer[data-drag-mode="rotate"] .topovec-camera-viewport,
.topovec-camera-viewer[data-drag-mode="roll"] .topovec-camera-viewport {
  cursor: grabbing;
}

.topovec-camera-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

.topovec-camera-busy {
  position: absolute;
  right: 0.9rem;
  top: 0.9rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: white;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: none;
}

.topovec-camera-viewer[data-busy="true"] .topovec-camera-busy {
  opacity: 1;
  transform: translateY(0);
}

.topovec-camera-help {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  max-width: calc(100% - 1.5rem);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.82);
  color: rgba(15, 23, 42, 0.84);
  padding: 0.28rem 0.5rem;
  font-size: 0.68rem;
  line-height: 1.25;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  pointer-events: none;
  transition: opacity 120ms ease;
}

.topovec-camera-viewer[data-help-visible="false"] .topovec-camera-help {
  opacity: 0;
}
