* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #e8e8ee;
}

#globeViz {
  position: absolute;
  inset: 0;
}

.airport-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 7px;
  background: linear-gradient(180deg, rgba(28, 28, 40, 0.92), rgba(10, 10, 16, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -140%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.airport-badge .dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #00d4ff;
  box-shadow: 0 0 5px rgba(0, 212, 255, 0.9);
}

#ui {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 320px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: rgba(18, 18, 28, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  z-index: 10;
}

#ui h1 {
  font-size: 16px;
  margin: 0 0 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

#searchBox {
  position: relative;
  margin-bottom: 14px;
}

#searchInput {
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 14px;
}

#searchInput:focus {
  outline: none;
  border-color: #00d4ff;
}

#suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #14141f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 20;
}

#suggestions.hidden {
  display: none;
}

#suggestions li {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.3;
}

#suggestions li .code {
  color: #00d4ff;
  font-weight: 600;
  margin-right: 6px;
}

#suggestions li.active,
#suggestions li:hover {
  background: rgba(0, 212, 255, 0.15);
}

#modeToggle {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

#modeToggle button {
  flex: 1;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: #c8c8d4;
  font-size: 12.5px;
  cursor: pointer;
}

#modeToggle button.active {
  background: rgba(0, 212, 255, 0.18);
  border-color: #00d4ff;
  color: #fff;
}

#modeHint {
  font-size: 11.5px;
  color: #9a9aab;
  margin-bottom: 12px;
}

#routePanel {
  margin-bottom: 14px;
}

#routeEmpty {
  font-size: 12.5px;
  color: #9a9aab;
  padding: 6px 2px;
}

#routeEmpty.hidden {
  display: none;
}

#routeList {
  list-style: none;
  margin: 0;
  padding: 0;
}

#routeList li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 13px;
}

#routeList .order {
  color: #9a9aab;
  width: 18px;
  flex-shrink: 0;
}

#routeList .label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#routeList .label .code {
  color: #00d4ff;
  font-weight: 600;
  margin-right: 4px;
}

#routeList button {
  background: none;
  border: none;
  color: #c8c8d4;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 5px;
  border-radius: 4px;
}

#routeList button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

#routeList button:disabled {
  opacity: 0.3;
  cursor: default;
}

#durationRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: #c8c8d4;
}

#durationRow input {
  width: 60px;
  padding: 5px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 13px;
}

#controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#controls button {
  flex: 1;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

#controls button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

#controls button:disabled {
  opacity: 0.35;
  cursor: default;
}

#recordBtn.recording {
  background: #b3261e;
  border-color: #ff5b5b;
  animation: pulse 1.2s infinite;
}

#stopBtn.hidden {
  display: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

#statusMsg {
  margin-top: 10px;
  font-size: 12px;
  color: #ffb454;
  min-height: 14px;
}
