:root {
  --line: #2a3e51;
  --line-soft: #243546;
  --text: #eaf4ff;
  --muted: #98afc4;
  --accent: #59beff;
  --good: #79e8c7;
  --alert: #ff8f8f;
  --glass: #08131ecc;
  --glass-strong: #0a1724ee;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
  color: var(--text);
  background: #02050b;
}

.earth-app {
  width: 100vw;
  min-height: 100vh;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(8px);
}

.globe-stage {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  border: 0;
  border-radius: 0;
}

#globe-canvas {
  width: 100%;
  height: 100vh;
  display: block;
  touch-action: none;
  cursor: grab;
}

#globe-canvas.dragging {
  cursor: grabbing;
}

.top-bar {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}

.brand {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  letter-spacing: 0.02em;
  font-size: 0.88rem;
  color: #c4d8eb;
}

.search-wrap {
  width: min(620px, 68vw);
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.left-panel {
  position: absolute;
  top: 78px;
  left: 18px;
  width: min(385px, 90vw);
  max-height: calc(100vh - 186px);
  overflow: auto;
  background: var(--glass);
  padding: 14px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  font-size: 0.72rem;
}

h1 {
  margin: 3px 0 6px;
  font-size: 1.34rem;
}

.sub {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.43;
}

.scan-form {
  margin-bottom: 10px;
}

.hud-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-bottom: 10px;
}

.stat {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 9px;
  background: #081521d9;
}

.stat span {
  color: var(--muted);
  font-size: 0.72rem;
}

.stat strong {
  display: block;
  margin-top: 3px;
  font-size: 1rem;
}

.drawer {
  margin-top: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #07131fcc;
  overflow: hidden;
}

.drawer summary {
  cursor: pointer;
  padding: 10px;
  font-weight: 600;
  font-size: 0.9rem;
}

#node-list,
#log {
  list-style: none;
  margin: 0;
  padding: 0 10px 10px;
  display: grid;
  gap: 6px;
  max-height: 160px;
  overflow: auto;
}

#node-list li,
#log li {
  border: 1px solid #27394a;
  border-radius: 8px;
  padding: 8px;
  background: #091826;
  font-size: 0.82rem;
}

#node-list li.detected {
  border-color: #2f8e75;
  color: var(--good);
}

input,
button {
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 0.95rem;
}

input {
  width: 100%;
  background: var(--glass-strong);
  color: var(--text);
  padding: 0 12px;
}

button {
  background: linear-gradient(145deg, #77d2ff, var(--accent));
  color: #072335;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
}

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

.secondary {
  width: 100%;
  background: #0b1d2d;
  color: #d5e9f8;
}

.map-tools {
  position: absolute;
  right: 18px;
  top: 106px;
  display: grid;
  gap: 8px;
}

.map-tools button {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: #0a1824d9;
  color: #e6f3ff;
  border: 1px solid #30495d;
  font-size: 1rem;
  display: grid;
  place-items: center;
}

#compass-btn {
  width: 52px;
  height: 52px;
  margin-bottom: 4px;
}

#compass-needle {
  display: inline-block;
  font-size: 1.1rem;
  transform: rotate(var(--heading, 0deg));
  transition: transform 120ms linear;
}

.status-bar {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  padding: 10px 12px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #2c4255;
  border-radius: 12px;
  background: #071421cf;
  color: #bbcfdf;
  font-size: 0.82rem;
}

.log-alert {
  color: var(--alert);
}

.content-shell {
  width: min(1180px, 94vw);
  margin: 34px auto 44px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.content-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #07131fd9;
  padding: 16px;
}

.content-card h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.content-card p,
.content-card li {
  color: #c3d6e5;
  font-size: 0.9rem;
  line-height: 1.55;
}

.content-card ul,
.content-card ol {
  margin: 0;
  padding-left: 18px;
}

.policy-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.policy-links a {
  color: #8ad0ff;
  text-decoration: none;
  border-bottom: 1px solid #2f627f;
}

@media (max-width: 980px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .search-wrap {
    width: 100%;
  }

  .left-panel {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 86px;
    width: auto;
    max-height: 42vh;
  }

  .map-tools {
    right: 10px;
    top: 130px;
  }

  .status-bar {
    left: 10px;
    right: 10px;
    font-size: 0.75rem;
    gap: 7px;
    flex-wrap: wrap;
  }

  .content-shell {
    grid-template-columns: 1fr;
    width: min(96vw, 680px);
    margin-top: 18px;
  }
}
