:root {
  --bg: #0b1220;
  --card: #131c2e;
  --card2: #1b2740;
  --ink: #e7ecf5;
  --muted: #8a97b1;
  --accent: #ffb020;
  --primary: #2ea0ff;
  --danger: #ff5470;
  --ok: #36d399;
  --line: #25324d;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

#topbar {
  position: sticky; top: 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
#title { font-weight: 700; font-size: 18px; }

.status {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; letter-spacing: .5px;
}
.status.idle { background: #2a3550; color: var(--muted); }
.status.tracking { background: rgba(54,211,153,.15); color: var(--ok); }
.status.error { background: rgba(255,84,112,.18); color: var(--danger); }

main { padding: 12px; padding-bottom: 96px; max-width: 560px; margin: 0 auto; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}

.lbl { font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }

/* arrow */
.target-label { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.target-label b { color: var(--ink); }

.arrow-wrap {
  position: relative;
  height: 220px;
  display: flex; align-items: center; justify-content: center;
  margin: 4px 0 14px;
}
.arrow {
  font-size: 160px; line-height: 1;
  transition: transform .15s linear;
  filter: drop-shadow(0 0 18px rgba(46,160,255,.45));
  color: var(--primary);
  will-change: transform;
}
.arrow.on-target { color: var(--ok); filter: drop-shadow(0 0 18px rgba(54,211,153,.55)); }
.no-heading {
  position: absolute; bottom: 0; left: 0; right: 0;
  text-align: center; font-size: 12px; color: var(--accent);
}

.readouts { display: flex; gap: 8px; }
.readout {
  flex: 1; background: var(--card2); border-radius: 12px;
  padding: 10px 6px; text-align: center;
}
.readout .big { display: block; font-size: 22px; font-weight: 800; }
.readout .unit { font-size: 11px; color: var(--muted); }

.meta-grid {
  margin-top: 12px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px;
  font-size: 13px; color: var(--muted);
}
.meta-grid b { color: var(--ink); font-weight: 700; }

select, button { font-family: inherit; }
select {
  width: 100%; padding: 12px; border-radius: 12px;
  background: var(--card2); color: var(--ink);
  border: 1px solid var(--line); font-size: 16px;
}

#map { height: 280px; border-radius: 12px; margin-top: 10px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 8px; }

.wp-list { list-style: none; margin: 0; padding: 0; }
.wp-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.wp-list li:last-child { border-bottom: none; }
.wp-list .wp-name { flex: 1; font-weight: 600; }
.wp-list .wp-sub { color: var(--muted); font-size: 12px; }
.wp-list .wp-go {
  background: var(--primary); color: #042038; border: none;
  padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px;
}
.wp-list .wp-del {
  background: none; border: none; color: var(--danger); font-size: 18px; padding: 4px 8px;
}

#controls {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 500;
  display: flex; gap: 8px; padding: 12px;
  background: linear-gradient(transparent, var(--bg) 28%);
  max-width: 560px; margin: 0 auto;
}
#controls button {
  flex: 1; padding: 14px 6px; border-radius: 14px; border: none;
  font-size: 15px; font-weight: 800; color: #06101f;
}
#controls .primary { background: var(--primary); }
#controls .accent  { background: var(--accent); }
#controls .danger  { background: var(--danger); color: #fff; }
#controls .ghost   { background: var(--card2); color: var(--ink); border: 1px solid var(--line); }
#controls button:disabled { opacity: .4; }

button.ghost {
  background: var(--card2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; font-size: 14px; font-weight: 600; width: 100%;
}

.hidden { display: none !important; }
