.v3d-cesium-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* Standalone Cesium viewer : le conteneur doit rester visible (cesium-ground.css le masque par défaut pour Potree). */
.v3d-cesium-viewport #cesiumContainer,
#cesiumContainer.v3d-cesium-full {
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 0;
}

.v3d-cesium-full {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  visibility: visible;
  pointer-events: auto;
}

.v3d-cesium-full .cesium-viewer,
.v3d-cesium-full .cesium-widget {
  width: 100%;
  height: 100%;
}

.v3d-tree-group {
  margin: 0.1rem 0;
}

.v3d-tree-group.is-collapsed > .v3d-tree-children {
  display: none;
}

.v3d-tree-row {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.v3d-tree-twist,
.v3d-tree-twist-spacer {
  flex: 0 0 1.1rem;
  width: 1.1rem;
  height: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.v3d-tree-twist {
  padding: 0;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}

.v3d-tree-twist:hover {
  background: rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
}

.v3d-tree-children {
  margin-left: 1.25rem;
  padding-left: 0.35rem;
  border-left: 1px solid rgba(148, 163, 184, 0.2);
}

.v3d-tree-actions {
  display: flex;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem 0.35rem;
}

.v3d-tree-action {
  padding: 0.15rem 0.45rem;
  border: 1px solid #334155;
  border-radius: 4px;
  background: #1e293b;
  color: #cbd5e1;
  font-size: 0.6875rem;
  cursor: pointer;
}

.v3d-tree-action:hover {
  background: #334155;
}

.v3d-tree-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
}

.v3d-tree-item--nested {
  padding: 0.2rem 0.45rem;
}

.v3d-tree-item:hover {
  background: rgba(148, 163, 184, 0.12);
}

.v3d-tree-item.is-selected {
  background: rgba(99, 102, 241, 0.2);
}

.v3d-tree-item input {
  margin: 0;
  accent-color: #6366f1;
}

.v3d-tree-item__label {
  flex: 1;
  font-size: 0.8125rem;
  color: #e2e8f0;
  min-width: 0;
}

.v3d-tree-item--nested .v3d-tree-item__label {
  font-size: 0.75rem;
}

.v3d-tree-item__code {
  color: #64748b;
}

.v3d-tree-item .v3d-class-swatch {
  flex-shrink: 0;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.v3d-tree-item.is-globally-hidden {
  opacity: 0.45;
}

.v3d-tree-item.is-globally-hidden .v3d-tree-item__label {
  text-decoration: line-through;
}

.v3d-viewer-switch {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-left: 0.75rem;
}

.v3d-viewer-switch a {
  color: #a5b4fc;
}

.v3d-ground-status {
  position: absolute;
  left: 50%;
  bottom: 3.75rem;
  transform: translateX(-50%);
  z-index: 10001;
  margin: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid #334155;
  pointer-events: none;
}

.v3d-ground-status--ready {
  border-color: rgba(74, 222, 128, 0.45);
  color: #bbf7d0;
}

.v3d-ground-status--busy {
  border-color: rgba(99, 102, 241, 0.45);
  color: #c7d2fe;
}

.v3d-ground-status--pending {
  border-color: rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

body.convoy-playback-active .v3d-ground-status {
  display: none !important;
}

.v3d-perf-overlay {
  position: absolute;
  top: 3.25rem;
  right: 0.75rem;
  z-index: 10010;
  width: min(22rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 28rem);
  overflow: auto;
  padding: 0.55rem 0.65rem 0.65rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid #475569;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.6875rem;
  line-height: 1.4;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.v3d-perf-overlay__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
}

.v3d-perf-overlay__badge {
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #86efac;
  font-size: 0.625rem;
}

.v3d-perf-overlay__body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #cbd5e1;
}
