/* Interface épurée du viewer HD — usage non technique */

.v3d-rail {
  position: absolute;
  top: 44px;
  left: 0;
  bottom: 0;
  z-index: 10000;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0.5rem 0.35rem;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.94);
  border-right: 1px solid #334155;
  backdrop-filter: blur(8px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.v3d-rail__section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.v3d-rail__divider {
  height: 1px;
  background: #334155;
  margin: 0.15rem 0.25rem;
}

.v3d-rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.45rem 0.25rem;
  font-family: inherit;
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1.2;
  color: #94a3b8;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.v3d-rail-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.v3d-rail-btn:hover {
  background: rgba(51, 65, 85, 0.6);
  color: #f1f5f9;
}

.v3d-rail-btn.is-active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.5);
  color: #c7d2fe;
}

.v3d-rail-btn.is-loading {
  opacity: 0.65;
  cursor: wait;
}

.v3d-rail-btn.is-disabled,
.v3d-rail-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.v3d-rail-btn--panel.is-active {
  background: rgba(99, 102, 241, 0.12);
}

/* Panneau latéral droit */
.v3d-panel {
  position: absolute;
  top: 44px;
  right: 0;
  bottom: 0;
  z-index: 9999;
  width: 320px;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.96);
  border-left: 1px solid #334155;
  backdrop-filter: blur(8px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.25);
}

.v3d-panel__header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}

.v3d-panel__tab {
  flex: 1;
  padding: 0.65rem 0.5rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}

.v3d-panel__tab:hover {
  color: #cbd5e1;
}

.v3d-panel__tab.is-active {
  color: #e2e8f0;
  border-bottom-color: #6366f1;
}

.v3d-panel__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin-right: 0.25rem;
  font-size: 1.25rem;
  line-height: 1;
  color: #64748b;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.v3d-panel__close:hover {
  color: #f1f5f9;
  background: rgba(51, 65, 85, 0.6);
}

.v3d-panel__body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.v3d-tab {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

.v3d-tab[hidden] {
  display: none !important;
}

/* ── Onglet Éléments ── */

#v3d-tab-elements {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem;
}

.v3d-tree-intro {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #64748b;
}

.v3d-tree-card {
  flex: 1;
  min-height: 140px;
  max-height: 55vh;
  overflow: auto;
  padding: 0.35rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  scrollbar-color: #475569 transparent;
  scrollbar-width: thin;
}

.v3d-tree-card::-webkit-scrollbar {
  width: 6px;
}

.v3d-tree-card::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 999px;
}

/* jsTree — thème sombre modernisé */
#v3d-scene-tree #jstree_scene {
  font-family: inherit;
}

#v3d-scene-tree #jstree_scene.jstree-default .jstree-node {
  min-height: 30px;
  line-height: 30px;
  margin-left: 18px;
  background: none !important;
}

#v3d-scene-tree #jstree_scene.jstree-default > .jstree-container-ul > .jstree-node {
  margin-left: 0;
  margin-bottom: 0.35rem;
}

#v3d-scene-tree #jstree_scene .jstree-anchor {
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
  width: calc(100% - 28px) !important;
  height: 30px !important;
  line-height: 1.3 !important;
  padding: 0 0.5rem !important;
  margin: 1px 0;
  font-size: 0.8125rem;
  font-weight: 450;
  color: #e2e8f0 !important;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
}

#v3d-scene-tree #jstree_scene > .jstree-container-ul > .jstree-node > .jstree-anchor {
  height: 34px !important;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b !important;
}

#v3d-scene-tree #jstree_scene > .jstree-container-ul > .jstree-node > .jstree-anchor:hover,
#v3d-scene-tree #jstree_scene > .jstree-container-ul > .jstree-node > .jstree-anchor.jstree-clicked {
  background: rgba(51, 65, 85, 0.5) !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
}

#v3d-scene-tree #jstree_scene .jstree-hovered > .jstree-anchor,
#v3d-scene-tree #jstree_scene .jstree-wholerow-hovered {
  background: rgba(99, 102, 241, 0.1) !important;
  box-shadow: none !important;
}

#v3d-scene-tree #jstree_scene .jstree-clicked > .jstree-anchor,
#v3d-scene-tree #jstree_scene .jstree-wholerow-clicked {
  background: rgba(99, 102, 241, 0.22) !important;
  color: #f1f5f9 !important;
  box-shadow: none !important;
}

#v3d-scene-tree #jstree_scene .jstree-wholerow {
  height: 30px;
}

/* Masquer les lignes de liaison verticales */
#v3d-scene-tree #jstree_scene.jstree-default .jstree-node,
#v3d-scene-tree #jstree_scene.jstree-default .jstree-icon {
  background-image: none !important;
}

/* Flèches expand/collapse */
#v3d-scene-tree #jstree_scene .jstree-ocl {
  width: 22px !important;
  height: 30px !important;
  background: none !important;
  position: relative;
  flex-shrink: 0;
}

#v3d-scene-tree #jstree_scene .jstree-ocl::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #64748b;
  border-bottom: 1.5px solid #64748b;
  transform: translate(-60%, -70%) rotate(-45deg);
  transition: transform 0.15s, border-color 0.12s;
}

#v3d-scene-tree #jstree_scene .jstree-open > .jstree-ocl::before {
  transform: translate(-50%, -30%) rotate(45deg);
}

#v3d-scene-tree #jstree_scene .jstree-leaf > .jstree-ocl::before {
  opacity: 0;
}

#v3d-scene-tree #jstree_scene .jstree-leaf > .jstree-ocl {
  width: 12px !important;
}

/* Cases à cocher modernes */
#v3d-scene-tree #jstree_scene .jstree-checkbox {
  width: 16px !important;
  height: 16px !important;
  margin: 0 4px 0 0 !important;
  background: #0f172a !important;
  background-image: none !important;
  border: 1.5px solid #64748b;
  border-radius: 4px;
  box-sizing: border-box;
  transition: background 0.12s, border-color 0.12s;
}

#v3d-scene-tree #jstree_scene .jstree-checkbox:hover {
  border-color: #94a3b8;
}

#v3d-scene-tree #jstree_scene .jstree-checked > .jstree-checkbox,
#v3d-scene-tree #jstree_scene .jstree-checked > .jstree-checkbox:hover {
  background: #6366f1 !important;
  border-color: #818cf8 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.5L6.5 11.5L12.5 4.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-size: 12px !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

#v3d-scene-tree #jstree_scene .jstree-anchor > .jstree-checkbox {
  position: relative;
  top: 0;
}

/* Icônes des éléments (nuage, mesure…) */
#v3d-scene-tree #jstree_scene .jstree-themeicon {
  width: 18px !important;
  height: 18px !important;
  margin-right: 2px !important;
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  filter: brightness(1.15);
  opacity: 0.9;
}

#v3d-scene-tree #jstree_scene .jstree-themeicon-custom {
  background-size: 16px !important;
}

#v3d-scene-tree #jstree_scene .jstree-anchor > .jstree-themeicon:empty,
#v3d-scene-tree #jstree_scene .jstree-themeicon-hidden {
  display: none !important;
}

/* Sections vides masquées */
#v3d-scene-tree #jstree_scene .jstree-hidden {
  display: none !important;
}

/* Menu contextuel */
.vakata-context,
.vakata-context ul {
  background: #1e293b !important;
  border: 1px solid #475569 !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
  padding: 4px !important;
}

.vakata-context li > a {
  color: #e2e8f0 !important;
  text-shadow: none !important;
  line-height: 2rem !important;
  border-radius: 4px !important;
  font-size: 0.8125rem !important;
}

.vakata-context li > a:hover,
.vakata-context .vakata-context-hover > a {
  background: rgba(99, 102, 241, 0.2) !important;
  box-shadow: none !important;
}

/* ── Propriétés de l'élément sélectionné ── */

.v3d-props-section {
  flex-shrink: 0;
  padding-top: 0.25rem;
  border-top: 1px solid #334155;
}

.v3d-props-title {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.v3d-props-empty {
  margin: 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #64748b;
  background: #1e293b;
  border: 1px dashed #334155;
  border-radius: 8px;
}

.v3d-props-empty[hidden] {
  display: none !important;
}

.v3d-props-card {
  font-size: 0.8125rem;
  color: #cbd5e1;
}

.v3d-props-card:empty {
  display: none;
}

.v3d-props-intro {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #94a3b8;
}

.v3d-props-section--alignment {
  margin-top: 0.75rem;
}

.v3d-alignment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.v3d-field--compact {
  margin-bottom: 0;
}

.v3d-field input[type="number"] {
  width: 100%;
  padding: 0.45rem 0.5rem;
  font-family: inherit;
  font-size: 0.8125rem;
  color: #e2e8f0;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 6px;
}

.v3d-alignment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.v3d-alignment-actions button {
  flex: 1 1 auto;
  min-width: 7rem;
  padding: 0.45rem 0.75rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: #e2e8f0;
  background: #334155;
  border: 1px solid #475569;
  border-radius: 6px;
  cursor: pointer;
}

.v3d-alignment-actions button:hover:not(:disabled) {
  background: #475569;
}

.v3d-alignment-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.v3d-alignment-actions button.v3d-btn--primary {
  color: #fff;
  background: #6366f1;
  border-color: #6366f1;
}

.v3d-alignment-actions button.v3d-btn--primary:hover:not(:disabled) {
  background: #4f46e5;
}

.v3d-alignment-status {
  margin: 0.65rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: #64748b;
}

.v3d-alignment-status.is-dirty {
  color: #fbbf24;
}

.v3d-alignment-status.is-saved {
  color: #86efac;
}

.v3d-field__hint--mask {
  display: block;
  margin: -0.35rem 0 0.75rem;
}

/* Filtre par classes (mode classification) */

.v3d-class-actions {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.v3d-class-actions button {
  padding: 0.25rem 0.6rem;
  font-family: inherit;
  font-size: 0.6875rem;
  color: #cbd5e1;
  background: #334155;
  border: 1px solid #475569;
  border-radius: 5px;
  cursor: pointer;
}

.v3d-class-actions button:hover {
  background: #475569;
}

.v3d-class-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.4rem 0.5rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  margin-bottom: 0.35rem;
}

.v3d-class-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.15rem 0;
  font-size: 0.75rem;
  color: #cbd5e1;
  cursor: pointer;
}

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

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

.v3d-class-name small {
  color: #64748b;
}

.v3d-class-pending {
  font-size: 0.75rem;
  color: #64748b;
  font-style: italic;
}

/* HUD du mode véhicule */

.v3d-vehicle-loading {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10003;
  min-width: 280px;
  max-width: 90vw;
  padding: 1.25rem 1.5rem;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid #334155;
  border-radius: 12px;
  color: #e2e8f0;
  font-size: 0.875rem;
  text-align: center;
  pointer-events: none;
}

.v3d-vehicle-loading[hidden] {
  display: none;
}

.v3d-vehicle-loading__track {
  height: 6px;
  margin: 0.85rem 0 0.5rem;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
}

.v3d-vehicle-loading__fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #6366f1, #4ade80);
  border-radius: 999px;
  transition: width 0.15s ease-out;
}

.v3d-vehicle-loading__meta {
  margin: 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.v3d-vehicle-loading__hint {
  margin: 0.65rem 0 0;
  font-size: 0.6875rem;
  color: #64748b;
}

.v3d-vehicle-panel {
  position: fixed;
  top: calc(44px + 0.85rem);
  right: 0.85rem;
  z-index: 10001;
  width: min(18.5rem, calc(100vw - 6rem));
  max-height: calc(100vh - 44px - 1.7rem);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(12px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #e2e8f0;
  scrollbar-width: thin;
  scrollbar-color: #475569 transparent;
  transition: right 0.22s ease, max-height 0.22s ease;
}

/* Panneau apparence ouvert : décaler le contrôle véhicule à sa gauche */
body.v3d-panel-open .v3d-vehicle-panel {
  right: calc(320px + 0.85rem);
  max-height: calc(100vh - 44px - 1.7rem);
}

.v3d-vehicle-panel[hidden] {
  display: none;
}

.v3d-vehicle-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.v3d-vehicle-panel__eyebrow {
  margin: 0;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #818cf8;
}

.v3d-vehicle-panel__title {
  margin: 0.15rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #f8fafc;
}

.v3d-vehicle-panel__exit {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid #334155;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.8);
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.v3d-vehicle-panel__exit:hover {
  background: #334155;
  color: #f1f5f9;
  border-color: #475569;
}

.v3d-vehicle-panel__speed-block {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, rgba(49, 46, 129, 0.55), rgba(30, 41, 59, 0.85));
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 12px;
}

.v3d-vehicle-panel__speed {
  font-size: 2.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #c7d2fe;
}

.v3d-vehicle-panel__speed-unit {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94a3b8;
}

.v3d-vehicle-panel__section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.v3d-vehicle-panel__section--keys {
  padding-top: 0.15rem;
  border-top: 1px solid #334155;
}

.v3d-vehicle-panel__section-title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.v3d-vehicle-panel__section-meta {
  margin: 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.v3d-vehicle-panel__section-meta strong {
  color: #e2e8f0;
  font-weight: 600;
}

.v3d-vehicle-panel__view-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.v3d-vehicle-panel__view-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #334155;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.65);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.75rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.v3d-vehicle-panel__view-btn:hover {
  border-color: #6366f1;
  background: rgba(49, 46, 129, 0.35);
}

.v3d-vehicle-panel__view-btn.is-active {
  border-color: #818cf8;
  background: rgba(67, 56, 202, 0.45);
  color: #eef2ff;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.35);
}

.v3d-vehicle-panel__view-icon {
  font-size: 0.875rem;
  line-height: 1;
  opacity: 0.85;
}

.v3d-vehicle-panel__view-label {
  font-weight: 500;
  line-height: 1.2;
}

.v3d-vehicle-panel__switch {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
}

.v3d-vehicle-panel__switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.v3d-vehicle-panel__switch-track {
  position: relative;
  flex-shrink: 0;
  width: 2.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #334155;
  transition: background 0.2s;
}

.v3d-vehicle-panel__switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #f8fafc;
  transition: transform 0.2s;
}

.v3d-vehicle-panel__switch input:checked + .v3d-vehicle-panel__switch-track {
  background: #4f46e5;
}

.v3d-vehicle-panel__switch input:checked + .v3d-vehicle-panel__switch-track::after {
  transform: translateX(1rem);
}

.v3d-vehicle-panel__switch-label {
  font-size: 0.8125rem;
  color: #cbd5e1;
}

.v3d-vehicle-panel__status {
  margin: 0;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(127, 29, 29, 0.45);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.v3d-vehicle-panel__status[data-state="off"] {
  background: rgba(51, 65, 85, 0.55);
  color: #94a3b8;
  border-color: #475569;
}

.v3d-vehicle-panel__status--warn {
  background: rgba(120, 53, 15, 0.45);
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.35);
}

.v3d-vehicle-panel__keys {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.v3d-vehicle-panel__keys li {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.35;
}

.v3d-vehicle-panel__keys kbd {
  display: inline-block;
  min-width: 1.35rem;
  padding: 0.05rem 0.35rem;
  margin-right: 0.15rem;
  border: 1px solid #475569;
  border-radius: 4px;
  background: #1e293b;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #e2e8f0;
  text-align: center;
}

@media (max-width: 900px) {
  body.v3d-panel-open.v3d-vehicle-active .v3d-panel {
    width: min(280px, 46vw);
  }

  body.v3d-panel-open .v3d-vehicle-panel {
    right: calc(min(280px, 46vw) + 0.65rem);
    width: min(16rem, calc(100vw - min(280px, 46vw) - 5.5rem));
  }
}

@media (max-width: 640px) {
  body.v3d-panel-open .v3d-vehicle-panel {
    right: 0.5rem;
    left: calc(76px + 0.5rem);
    width: auto;
    max-height: min(42vh, 20rem);
    top: calc(44px + 0.5rem);
  }

  body.v3d-panel-open.v3d-vehicle-active .v3d-panel {
    top: auto;
    bottom: 0;
    max-height: min(48vh, 24rem);
  }
}

#v3d-scene-props .scene_content,
#v3d-scene-props .measurement_content,
#v3d-scene-props .propertypanel_content {
  padding: 0.65rem 0.75rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
}

#v3d-scene-props .pv-menu-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

#v3d-scene-props .pv-menu-list > li,
#v3d-scene-props .pv-menu-list > div {
  margin: 0 0 0.65rem;
  color: #cbd5e1;
  font-size: 0.8125rem;
}

#v3d-scene-props .pv-menu-list > li:last-child {
  margin-bottom: 0;
}

#v3d-scene-props label,
#v3d-scene-props .pv-select-label {
  color: #94a3b8;
  font-size: 0.75rem;
}

#v3d-scene-props select,
#v3d-scene-props input[type="text"],
#v3d-scene-props input[type="number"] {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.4rem 0.5rem;
  font-family: inherit;
  font-size: 0.8125rem;
  color: #e2e8f0;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 6px;
}

#v3d-scene-props .divider {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

#v3d-scene-props .divider > span::before,
#v3d-scene-props .divider > span::after {
  background: #334155;
}

#v3d-scene-props table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

#v3d-scene-props table td,
#v3d-scene-props table th {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid #334155;
  color: #cbd5e1;
  text-align: left;
}

#v3d-scene-props .ui-slider {
  margin-top: 0.35rem;
  background: #0f172a !important;
  border: 1px solid #475569 !important;
  border-radius: 999px !important;
  height: 6px !important;
}

#v3d-scene-props .ui-slider-handle {
  width: 14px !important;
  height: 14px !important;
  top: 50% !important;
  transform: translateY(-50%);
  background: #6366f1 !important;
  border: 2px solid #c7d2fe !important;
  border-radius: 50% !important;
}

#v3d-scene-props .ui-state-default {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

#v3d-scene-props .ui-button {
  background: #334155 !important;
  border: 1px solid #475569 !important;
  color: #e2e8f0 !important;
  border-radius: 6px !important;
}

#v3d-scene-props input[type="checkbox"] {
  accent-color: #6366f1;
  margin-right: 0.35rem;
}

#v3d-scene-props .measurement_value_table td {
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

#v3d-scene-props .coordinates_table_container td {
  color: #94a3b8;
}

/* Ancien bloc arborescence (remplacé ci-dessus) */
#v3d-scene-tree {
  flex: none;
  min-height: unset;
  overflow: visible;
}

#v3d-scene-props {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  font-size: inherit;
  color: inherit;
}

#v3d-scene-props:empty {
  display: none;
}

/* Priorité sur les surcharges Potree globales */
#v3d-scene-tree #jstree_scene.jstree-default .jstree-hovered,
#v3d-scene-tree #jstree_scene.jstree-default .jstree-clicked {
  background: transparent !important;
  box-shadow: none !important;
}

#v3d-scene-tree #scene_objects {
  margin: 0;
  padding: 0;
}

/* Formulaire apparence */
.v3d-field {
  display: block;
  margin-bottom: 1rem;
}

.v3d-field > span:first-child {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #cbd5e1;
}

.v3d-field select,
.v3d-field input[type="range"] {
  width: 100%;
  font-family: inherit;
}

.v3d-field select {
  padding: 0.45rem 0.5rem;
  font-size: 0.8125rem;
  color: #e2e8f0;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 6px;
}

.v3d-field input[type="range"] {
  accent-color: #6366f1;
}

.v3d-field--check.is-disabled {
  opacity: 0.65;
}

.v3d-field--check.is-disabled input {
  cursor: not-allowed;
}
  align-items: center;
  gap: 0.5rem;
}

.v3d-field--check input {
  width: 16px;
  height: 16px;
  accent-color: #6366f1;
}

.v3d-field--check span {
  font-size: 0.8125rem;
  color: #cbd5e1;
}

.v3d-field__hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  color: #64748b;
}

/* Bandeau d'aide contextuel */
.v3d-hint {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  z-index: 10000;
  transform: translateX(-50%);
  max-width: min(560px, calc(100% - 2rem));
  padding: 0.45rem 0.85rem;
  font-family: system-ui, sans-serif;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: #94a3b8;
  text-align: center;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid #334155;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.v3d-hint.is-measure {
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(30, 27, 75, 0.9);
}

/* Overlay outil de mesure */
.v3d-measure-overlay {
  position: absolute;
  top: 52px;
  right: 12px;
  z-index: 10001;
  width: 220px;
  padding: 0.85rem 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.v3d-measure-overlay__label {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #e2e8f0;
}

.v3d-measure-overlay__hint {
  margin: 0 0 0.75rem;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: #64748b;
}

.v3d-measure-overlay__actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.v3d-measure-overlay__btn {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #cbd5e1;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.v3d-measure-overlay__btn:hover {
  background: #334155;
  color: #f1f5f9;
}

.v3d-measure-overlay__btn--primary {
  color: #fff;
  background: #6366f1;
  border-color: #818cf8;
}

.v3d-measure-overlay__btn--primary:hover {
  background: #4f46e5;
  border-color: #6366f1;
}

.v3d-measure-overlay__key {
  margin: 0.55rem 0 0;
  font-size: 0.625rem;
  text-align: center;
  color: #64748b;
}

.v3d-measure-overlay__key kbd {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  font-family: inherit;
  font-size: 0.625rem;
  color: #94a3b8;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 4px;
}

/* Masquer la sidebar Potree native */
#potree_sidebar_container,
#potree_quick_buttons {
  display: none !important;
}

#potree_render_area {
  left: 0 !important;
}

#potree_map {
  z-index: 10000 !important;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

#potree_map_content {
  background: #dbeafe !important;
}

.v3d-map-legend {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 120;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  max-width: calc(100% - 16px);
  padding: 0.35rem 0.55rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.6875rem;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 6px;
  pointer-events: none;
}

.v3d-map-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.v3d-map-legend__item::before {
  content: "";
  width: 14px;
  height: 3px;
  border-radius: 999px;
}

.v3d-map-legend__item--extent::before {
  background: #0000ff;
}

.v3d-map-legend__item--trace::before {
  background: rgba(56, 189, 248, 0.95);
}

.v3d-map-legend__item--cloud::before {
  background: rgba(255, 165, 0, 0.95);
}

.v3d-map-legend__note {
  flex-basis: 100%;
  color: #94a3b8;
}

/* Barre de rejeu de la simulation de convoi */
.v3d-convoy-bar {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 10002;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid #334155;
  backdrop-filter: blur(6px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #e2e8f0;
  max-width: min(92vw, 760px);
}

.v3d-convoy-bar__controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.v3d-convoy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
}

.v3d-convoy-btn svg { width: 1.1rem; height: 1.1rem; }

.v3d-convoy-btn:hover {
  background: rgba(148, 163, 184, 0.15);
  color: #f1f5f9;
}

.v3d-convoy-btn--primary {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #c7d2fe;
}

.v3d-convoy-btn--primary:hover {
  background: rgba(99, 102, 241, 0.4);
}

.v3d-convoy-bar__progress {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 220px;
  flex: 1;
}

.v3d-convoy-bar__progress input[type="range"] {
  flex: 1;
  accent-color: #818cf8;
  cursor: pointer;
}

.v3d-convoy-bar__time {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: #cbd5e1;
  white-space: nowrap;
}

.v3d-convoy-bar__speed {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.v3d-convoy-bar__speed input[type="range"] {
  width: 90px;
  accent-color: #818cf8;
  cursor: pointer;
}

.v3d-convoy-bar__speed-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.v3d-convoy-bar__speed-value {
  font-size: 0.78rem;
  min-width: 2.2rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #c7d2fe;
}

@media (max-width: 720px) {
  .v3d-convoy-bar { flex-wrap: wrap; justify-content: center; }
  .v3d-convoy-bar__progress { min-width: 160px; }
}

.v3d-convoy-bar:not([hidden]) ~ .v3d-hint,
body.convoy-playback-active .v3d-hint {
  display: none !important;
}
