:root {
  font-family: Inter, Pretendard, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #171717;
  background: #ececeb;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; }
body { display: grid; grid-template-columns: 300px 1fr; overflow: hidden; }

.panel {
  height: 100vh;
  overflow-y: auto;
  padding: 18px;
  background: rgba(249,249,247,.985);
  border-right: 1px solid #d8d8d3;
}
.brandRow { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.brand { display: flex; flex-direction: column; gap: 1px; }
.brand strong { font-size: 24px; letter-spacing: -.045em; line-height: 1; }
.brand span { margin-top: 5px; font-size: 11px; color: #777; }
.liveBadge {
  min-width: 46px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e6e6e2;
  color: #666;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  letter-spacing: .04em;
}
.liveBadge.live { background: #171717; color: #fff; }
.liveBadge.view { background: #fff; color: #171717; border: 1px solid #cfcfca; }

section { padding: 14px 0; border-top: 1px solid #dfdfda; }
section:first-of-type { border-top: 0; padding-top: 0; }
.sectionTitle { margin-bottom: 9px; color: #5c5c57; font-size: 11px; font-weight: 700; letter-spacing: .035em; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; font-weight: 600; color: #5c5c57; }
input, select {
  width: 100%;
  border: 1px solid #cecec9;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: #1d1d1b;
  font: inherit;
  font-size: 12px;
  outline: none;
}
input:focus, select:focus { border-color: #777770; box-shadow: 0 0 0 2px rgba(0,0,0,.035); }
button {
  border: 1px solid #c8c8c3;
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: #222;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
button:hover { background: #f1f1ee; }
button:disabled { opacity: .42; cursor: default; }
button.primary { background: #171717; color: #fff; border-color: #171717; }
button.primary:hover { background: #333; }
button.subtle { width: 100%; margin-top: 8px; }
button.subtle.compact { padding: 7px 9px; font-size: 10.5px; }
button.secondary { width: 100%; }
button.danger { color: #8b3030; }

.meta { margin-top: 7px; font-size: 10.5px; line-height: 1.45; color: #7b7b75; white-space: pre-wrap; }
.row { display: grid; gap: 8px; margin-top: 8px; }
.row.two { grid-template-columns: 1fr 1fr; }
.actionGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actionButton { width: 100%; margin: 0 0 8px 0; min-height: 39px; }
.actionButton.active { background: #171717; color: #fff; border-color: #171717; }

.cityLoadPanel {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #d9d9d4;
}
.cityLoadHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: #5c5c57;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .025em;
}
.cityLoadModes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.cityLoadMode {
  min-width: 0;
  padding: 7px 5px 6px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .025em;
}
.cityLoadMode span {
  display: block;
  margin-top: 2px;
  color: #92928c;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0;
}
.cityLoadMode.active { background: #171717; color: #fff; border-color: #171717; }
.cityLoadMode.active span { color: #cfcfca; }
.cityLoadInfo { min-height: 29px; }
.cityLoadInfo.ready { color: #43644d; }
.cityLoadInfo.busy { color: #765f24; }
.cityLoadInfo.warn { color: #8b5b30; }
#distantMassFill.active { background: #f0f0ec; border-color: #9d9d95; font-weight: 700; }
.cityLoadHint { margin-top: 5px; font-size: 9.5px; }

.layerPanel { margin-top: 10px; border-top: 1px dashed #d9d9d4; padding-top: 8px; }
.layerPanel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  color: #5c5c57;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  user-select: none;
}
.summaryMeta { color: #96968f; font-size: 9.5px; font-weight: 600; letter-spacing: 0; }
.layerPanelBody { padding-top: 8px; }
.layerHint { margin-top: 0; }
.layerList {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 9px;
  max-height: 280px;
  overflow: auto;
  padding-right: 2px;
}
.layerRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 33px;
  padding: 5px 6px 5px 8px;
  border: 1px solid #deded9;
  border-radius: 7px;
  background: #fff;
}
.layerName { min-width: 0; }
.layerId { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 650; color: #343431; }
.layerGroup { display: block; margin-top: 2px; font-size: 9px; color: #999991; }
.layerToggle {
  min-width: 44px;
  padding: 5px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}
.layerToggle.active { background: #171717; color: #fff; border-color: #171717; }
.layerToggle.unknown { color: #888; }
.layerEmpty { padding: 9px; border: 1px dashed #d6d6d1; border-radius: 7px; color: #8c8c86; font-size: 10px; text-align: center; }

.advanced { margin-top: 10px; border-top: 1px solid #dfdfda; padding-top: 12px; }
.advanced summary { cursor: pointer; color: #666; font-size: 11px; font-weight: 700; letter-spacing: .03em; user-select: none; }
.advancedBody { padding-top: 10px; }
.captureLink {
  display: block;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid #c8c8c3;
  border-radius: 8px;
  color: #222;
  background: #fff;
  text-decoration: none;
  font-size: 11px;
  text-align: center;
}
.hidden { display: none !important; }

.mapWrap {
  position: relative;
  min-width: 0;
  height: 100vh;
  background: #dce9f1;
  overflow: hidden;
}
.frameShell {
  position: absolute;
  inset: 0;
  transform: none;
  width: 100% !important;
  height: 100% !important;
  background: #dce9f1;
  overflow: hidden;
}
#vworldFrame { display: block; width: 100%; height: 100%; border: 0; background: #dce9f1; }
.toast {
  position: absolute;
  left: 16px;
  bottom: 16px;
  max-width: min(460px, calc(100% - 32px));
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(20,20,20,.78);
  color: #fff;
  font-size: 10.5px;
  line-height: 1.4;
  pointer-events: none;
  opacity: .94;
  z-index: 9;
}
.sourceBadge {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(20,20,20,.58);
  color: #fff;
  font-size: 9px;
  pointer-events: none;
  z-index: 9;
}
.frameBadge { display: none; }

@media (max-width: 820px) {
  body { grid-template-columns: 260px 1fr; }
  .panel { padding: 14px; }
  .row.two { grid-template-columns: 1fr; }
}