html,
body,
#cesiumContainer {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

/* Let Cesium own touch gestures (one-finger drag = pan, pinch = zoom,
   two-finger drag = tilt) instead of the browser panning/zooming the page. */
#cesiumContainer,
#cesiumContainer canvas {
  touch-action: none;
}

#hud {
  position: absolute;
  top: 0;
  left: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  z-index: 10;
}

.panel {
  pointer-events: auto;
  background: rgba(8, 18, 26, 0.82);
  border: 1px solid rgba(90, 160, 200, 0.35);
  border-radius: 6px;
  color: #cfe6f2;
  padding: 10px 12px;
  min-width: 240px;
  font-size: 13px;
  backdrop-filter: blur(3px);
}

.panel .title {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #8fd0ff;
  margin-bottom: 6px;
  text-transform: uppercase;
  font-size: 12px;
}

/* Collapsible panels (click the title). */
.panel > .title {
  cursor: pointer;
  user-select: none;
}
.panel > .title::after {
  content: ' ▾';
  font-size: 10px;
  opacity: 0.6;
}
.panel.collapsed > .title {
  margin-bottom: 0;
}
.panel.collapsed > .title::after {
  content: ' ▸';
}
.panel.collapsed > *:not(.title) {
  display: none;
}

.chk {
  display: block;
  font-size: 12px;
  color: #cfe6f2;
  cursor: pointer;
  padding: 2px 0;
}
.chk input {
  margin-right: 6px;
  vertical-align: middle;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 0;
}
.row .k {
  color: #7f9aab;
}
.row .v {
  color: #eaf6ff;
  font-variant-numeric: tabular-nums;
}
.row.big .v {
  font-size: 17px;
  font-weight: 600;
  color: #aef0c0;
}

.v.warn {
  color: #ffcf6b;
}
.v.ok {
  color: #7be08a;
}
.v.err {
  color: #ff7a7a;
}

.hint {
  color: #7f9aab;
  font-size: 12px;
  line-height: 1.4;
}
.hidden {
  display: none;
}

button {
  margin-top: 8px;
  background: rgba(40, 90, 120, 0.6);
  border: 1px solid rgba(120, 190, 230, 0.4);
  color: #dff;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
}
button:hover {
  background: rgba(60, 120, 160, 0.7);
}

.notesLabel {
  display: block;
  margin: 8px 0 4px;
  color: #7f9aab;
  font-size: 11px;
}
textarea {
  width: 100%;
  box-sizing: border-box;
  height: 70px;
  resize: vertical;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(90, 160, 200, 0.35);
  border-radius: 4px;
  color: #eaf6ff;
  font-size: 12px;
  padding: 6px;
}

input[type='text'] {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(90, 160, 200, 0.35);
  border-radius: 4px;
  color: #eaf6ff;
  font-size: 12px;
  padding: 5px 6px;
}
.btnrow {
  display: flex;
  gap: 8px;
}
.btnrow button {
  flex: 1;
}

/* Track list (right side) */
#trackListPanel {
  position: absolute;
  top: 12px;
  right: 12px;
  width: min(380px, 94vw);
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  z-index: 10;
}
/* When collapsed, the panel shrinks to just its title bar. */
#trackListPanel.collapsed {
  width: auto;
  max-height: none;
}

/* Mobile: tighter HUD, capped list height so it never owns the screen. */
@media (max-width: 768px) {
  #hud {
    padding: 8px;
    gap: 8px;
    max-width: 78vw;
  }
  .panel {
    min-width: 0;
    font-size: 12px;
  }
  #trackListPanel {
    max-height: 55vh;
  }
}
.tlScroll {
  overflow-y: auto;
  margin-top: 4px;
}
#trackTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
#trackTable th {
  position: sticky;
  top: 0;
  background: rgba(8, 22, 32, 0.97);
  color: #8fd0ff;
  text-align: right;
  padding: 4px 6px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid rgba(90, 160, 200, 0.35);
  white-space: nowrap;
}
#trackTable th:first-child,
#trackTable td:first-child,
#trackTable th:nth-child(2),
#trackTable td:nth-child(2),
#trackTable th:nth-child(3),
#trackTable td:nth-child(3) {
  text-align: left;
}
#trackTable th.sorted::after {
  content: ' ▾';
}
#trackTable th.sorted.asc::after {
  content: ' ▴';
}
#trackTable td {
  padding: 3px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}
#trackTable tbody tr {
  cursor: pointer;
}
#trackTable tbody tr:hover {
  background: rgba(80, 140, 180, 0.18);
}
#trackTable tbody tr.selected {
  background: rgba(120, 200, 140, 0.22);
}
.idDot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
