html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0d0f12;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #fff;
}

#app, #app canvas { display: block; width: 100%; height: 100%; }

#loading {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(circle at 50% 40%, #1f2a33, #0d0f12 70%);
  z-index: 10;
  transition: opacity .6s;
}
#loading.hidden { opacity: 0; pointer-events: none; }
#loading .title { font-size: 56px; font-weight: 800; letter-spacing: 2px; }
#loading .title span { color: #f5c542; }
#loading-status { font-size: 16px; color: #b8c2cc; }
#loading-status.error { color: #ff7a6b; }

#help {
  position: fixed; top: 14px; left: 14px;
  padding: 10px 14px;
  background: rgba(10, 12, 15, .55);
  border-radius: 8px;
  font-size: 13px; line-height: 1.6;
  pointer-events: none;
}
#help.hidden { display: none; }

#tp-hud {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  text-align: center;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .7);
  pointer-events: none;
  display: none;
}
#tp-hud.visible { display: block; }
#tp-speed { font-size: 52px; font-weight: 800; line-height: 1; }
#tp-hud .unit { font-size: 14px; opacity: .8; }
#tp-street { margin-top: 6px; font-size: 15px; opacity: .9; }

#poi-card {
  position: fixed; top: 18px; left: 50%;
  transform: translate(-50%, -12px);
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px;
  background: rgba(12, 15, 19, .82);
  border-left: 4px solid #f5c542;
  border-radius: 8px;
  opacity: 0; pointer-events: none;
  transition: opacity .5s, transform .5s;
}
#poi-card.visible { opacity: 1; transform: translate(-50%, 0); }
#poi-card .title { font-size: 20px; font-weight: 700; }
#poi-card .text { margin-top: 4px; font-size: 14px; line-height: 1.45; color: #d4dae1; }

#map-labels { position: fixed; inset: 0; pointer-events: none; display: none; }
#map-labels.visible { display: block; }
.map-label {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; gap: 6px;
  padding: 4px 9px 4px 6px;
  background: rgba(255, 255, 255, .92); color: #14181d;
  border-radius: 14px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.map-label .icon { font-size: 15px; }

#north {
  position: fixed; top: 14px; right: 14px;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(10, 12, 15, .6);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1; color: #ff6b5b;
  pointer-events: none;
}
#north span { font-size: 13px; font-weight: 700; color: #fff; margin-top: 2px; }
#north.visible { display: flex; }
#map-height {
  position: fixed; top: 70px; right: 8px;
  background: rgba(10, 12, 15, .6);
  padding: 3px 8px; border-radius: 10px;
  font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap;
  display: none; pointer-events: none;
}
#map-height.visible { display: block; }

#attrib {
  position: fixed; right: 8px; bottom: 6px;
  font-size: 11px; color: #ddd;
  background: rgba(0, 0, 0, .4);
  padding: 2px 6px; border-radius: 4px;
}
#attrib a { color: #9fd0ff; }

#autopilot {
  position: fixed; top: 12vh; left: 50%; transform: translateX(-50%);
  width: min(480px, calc(100vw - 32px));
  padding: 16px 18px 12px;
  background: rgba(12, 15, 19, .9);
  border-top: 4px solid #3e8ef7;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  display: none; z-index: 5;
}
#autopilot.visible { display: block; }
#autopilot .ap-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
#ap-query {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px; border: 1px solid #3a424c; border-radius: 6px;
  background: #1b2027; color: #fff; font: inherit; font-size: 16px; outline: none;
}
#ap-query:focus { border-color: #3e8ef7; }
#ap-error { min-height: 0; color: #ff7a6b; font-size: 13px; margin-top: 6px; }
#ap-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 46vh; overflow-y: auto; }
#ap-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 7px 10px; border-radius: 6px; cursor: pointer;
}
#ap-list li.sel, #ap-list li:hover { background: #26303b; }
#ap-list .name { font-size: 15px; }
#ap-list .meta { font-size: 12px; color: #9aa1ab; white-space: nowrap; }
#autopilot .ap-hint { margin-top: 8px; font-size: 12px; color: #8a929c; }

#ap-status {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  display: none; align-items: center; gap: 10px;
  padding: 7px 14px;
  background: rgba(12, 15, 19, .8); border-radius: 18px;
  font-size: 14px; white-space: nowrap; pointer-events: none;
}
#ap-status.visible { display: flex; }
#ap-status .badge { background: #3e8ef7; padding: 2px 8px; border-radius: 10px; font-weight: 700; font-size: 12px; }
#ap-status .dest { font-weight: 700; }
#ap-status .info { color: #c9d0d8; }
#ap-status .off { color: #8a929c; font-size: 12px; }

#ap-toast {
  position: fixed; top: 58px; left: 50%; transform: translateX(-50%);
  padding: 7px 14px; border-radius: 8px;
  background: rgba(12, 15, 19, .85); font-size: 14px;
  opacity: 0; transition: opacity .4s; pointer-events: none;
}
#ap-toast.visible { opacity: 1; }
#autopilot.visible ~ #poi-card { opacity: 0; }
