* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #0f0f0f;
  color: #f0f0f0;
}

#file-panel {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
  background: rgba(0, 0, 0, 0.72);
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
}

#file-panel label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dataset-file-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dataset-file-panel[hidden] {
  display: none !important;
}

#file-panel input[type='file'] {
  font-size: 12px;
  color: #ccc;
}

#file-panel label.sit-skip-ego {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #bbb;
  cursor: pointer;
}

#file-panel label.sit-skip-ego input {
  margin: 0;
}

.panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

button {
  background: #2a5a8a;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
}

button:hover:not(:disabled) {
  background: #3a6fa0;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#btn-reset-view {
  background: #444;
}

#container {
  width: 100vw;
  height: 100vh;
}

#hud {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 200;
  background: rgba(0, 0, 0, 0.65);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  max-width: 320px;
  pointer-events: none;
}

#status {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 300;
  max-width: 420px;
  background: rgba(0, 0, 0, 0.72);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

#status.error {
  border-color: rgba(255, 80, 80, 0.6);
  color: #ffb0b0;
}

#legend {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 200;
  background: rgba(0, 0, 0, 0.65);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  min-width: 120px;
}

.legend-title {
  margin-bottom: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.legend-item.legend-empty {
  display: block;
  opacity: 0.85;
}

.legend-swatch {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 2px;
}

.legend-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}

.legend-type {
  font-weight: 600;
}

.legend-meta {
  font-size: 10px;
  opacity: 0.85;
  font-family: ui-monospace, monospace;
}

h1 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.subtitle {
  margin: 0 0 8px;
  opacity: 0.75;
  font-size: 11px;
}

.dataset-label {
  margin-bottom: 4px;
}

.dataset-label select {
  margin-top: 4px;
  width: 100%;
  padding: 6px 8px;
  background: #1f1f1f;
  color: #f0f0f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-size: 13px;
}

.file-hint {
  margin: 0 0 10px;
  font-size: 11px;
  opacity: 0.8;
  line-height: 1.4;
}

#xr-status {
  margin-top: 6px;
  opacity: 0.9;
  pointer-events: auto;
}

#xr-status a {
  color: #8ec8ff;
}

body.vr-presenting #file-panel,
body.vr-presenting #hud,
body.vr-presenting #status,
body.vr-presenting #legend {
  display: none !important;
}

body.vr-presenting #VRButton {
  bottom: 24px;
}
