:root {
  --bg: #f4f6f8;
  --card: #fff;
  --ink: #1d2733;
  --muted: #667085;
  --line: #e2e6ea;
  --c0: #f28e2b;
  --c1: #4e79a7;
  --c2: #59a14f;
  --c3: #b07aa1;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; background: var(--bg); color: var(--ink); }
.top { padding: 20px 16px 8px; max-width: 1200px; margin: 0 auto; }
.top h1 { margin: 0 0 4px; font-size: 1.5rem; }
.top p { margin: 0; color: var(--muted); }
main { max-width: 1200px; margin: 0 auto; padding: 8px 16px 24px; display: grid; gap: 16px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.panel h2 { margin: 0 0 8px; font-size: 1.05rem; }
.hint { margin: 0 0 12px; color: var(--muted); font-size: .88rem; }

#sliders { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.sl { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.sl .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .92rem; }
.sl .name { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.sl input[type=range] { width: 100%; margin: 8px 0 4px; }
.sl .alloc { font-size: .85rem; color: var(--muted); }
.sl .alloc b { color: var(--ink); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 14px; font: inherit; cursor: pointer; }
button:hover { background: #f0f3f6; }
button.primary { background: #1f6feb; border-color: #1f6feb; color: #fff; font-weight: 600; }
button.primary:hover { background: #1a5fc8; }
.pending { margin: 8px 0 0; color: #b42318; font-size: .88rem; }

.mapwrap { padding: 0; overflow: hidden; position: relative; }
#map { height: 620px; width: 100%; }
.legend { position: absolute; right: 12px; bottom: 24px; z-index: 500; background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: .85rem; }
.legend label { display: flex; align-items: center; gap: 6px; cursor: pointer; margin: 3px 0; }
.legend .sel { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.legend .ring { width: 12px; height: 12px; border-radius: 50%; border: 3px solid #e00; background: #fff; }

#guBars { display: grid; gap: 4px; }
.bar { display: grid; grid-template-columns: 70px 1fr 36px; align-items: center; gap: 8px; font-size: .88rem; cursor: pointer; }
.bar:hover .track { outline: 1px solid #aab; }
.track { background: #eef1f4; border-radius: 4px; height: 14px; overflow: hidden; display: flex; }
.seg { height: 100%; }
.bar .n { text-align: right; font-variant-numeric: tabular-nums; }

.tablehead { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 8px; }
.tablehead h2 { margin: 0; }
.tablehead select { font: inherit; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); }
#rowCount { color: var(--muted); font-size: .88rem; }
.tablewrap { max-height: 480px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; background: #f0f3f6; cursor: pointer; user-select: none; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #f7fafc; cursor: pointer; }
.tag { display: inline-flex; align-items: center; gap: 5px; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 0 16px 24px; }

@media (max-width: 640px) {
  #map { height: 440px; }
  .top h1 { font-size: 1.25rem; }
}
