:root {
  --bg: #15171b; --panel: #1f2329; --line: #343a43; --fg: #e8ebef; --dim: #9aa3ae; --acc: #4da3ff;
  --btn: 48px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.3 -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
body { display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
button { font: inherit; color: var(--fg); background: #2b313a; border: 1px solid var(--line); border-radius: 10px;
  min-height: var(--btn); padding: 0 14px; touch-action: manipulation; }
button:active { background: #38404b; }
button:disabled { opacity: .4; }
button.on { background: var(--acc); border-color: var(--acc); color: #04121f; font-weight: 600; }
#top, #tools { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--panel); flex-wrap: wrap; }
#top { border-bottom: 1px solid var(--line); }
#tools { border-top: 1px solid var(--line); }
.logo small { color: var(--dim); font-weight: 400; margin-left: 4px; }
.sp { flex: 1; }
.seg { display: inline-flex; }
.seg button { border-radius: 0; margin-left: -1px; }
.seg button:first-child { border-radius: 10px 0 0 10px; margin-left: 0; }
.seg button:last-child { border-radius: 0 10px 10px 0; }
.group { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.group[hidden], #map3d[hidden], #msg[hidden] { display: none; }
.sl { display: flex; align-items: center; gap: 8px; color: var(--dim); }
.sl input { width: 150px; height: var(--btn); }
.sl output { min-width: 2.5em; color: var(--fg); text-align: right; }
.hint { color: var(--dim); }
#status { margin-left: auto; color: var(--dim); font-size: 13px; }
#stage { position: relative; flex: 1; min-height: 0; background: #0d0f12; }
#stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
#msg { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: rgba(0,0,0,.8); padding: 10px 16px;
  border-radius: 10px; pointer-events: none; max-width: 90%; }
dialog { background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
dialog::backdrop { background: rgba(0,0,0,.55); }
dialog h3 { margin: 0 0 12px; }
dialog label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0; }
dialog select { font: inherit; min-height: 44px; }
dialog menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 16px 0 0; }
@media (max-width: 760px) { .sl input { width: 110px; } .logo small { display: none; } }
.menu { display: flex; flex-direction: column; gap: 10px; min-width: min(420px, 80vw); }
.menu .hint { margin: 0; font-size: 13px; }
#roadCtl input[type=number] { width: 90px; font: inherit; text-align: right; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: #11141a; color: var(--fg); }
#roadCtl input[type=checkbox] { width: 28px; height: 28px; }
#saveState { color: var(--dim); }
