:root {
  --bg: #f5f6f8; --card: #fff; --ink: #1d2433; --muted: #6b7385; --line: #e1e4ea; --accent: #2f4b7c;
}
* { 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: 16px 20px 4px; }
.top h1 { margin: 0 0 4px; font-size: 22px; }
.top p { margin: 0; color: var(--muted); font-size: 13px; }
h2 { font-size: 15px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 8px; }

main { display: grid; grid-template-columns: 320px 1fr; gap: 14px; padding: 12px 20px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.summary { margin: 0 20px 14px; }
.mapwrap { min-height: 560px; }
#map { height: 100%; min-height: 560px; border-radius: 10px; border: 1px solid var(--line); }

.slider-row { margin-bottom: 10px; }
.slider-row label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 2px; }
.slider-row .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.slider-row input[type=range] { width: 100%; }
.sum-line { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer; }
button:hover { background: #eef2f8; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: bold; }
button.primary:hover { background: #243b63; }
button.primary.dirty { box-shadow: 0 0 0 3px rgba(47,75,124,.25); }
.allocation { font-size: 13px; background: #f3f5f9; border-radius: 6px; padding: 8px 10px; margin-bottom: 14px; }
.allocation span { display: inline-block; margin-right: 10px; }

.legend-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.legend-row .dot { width: 12px; height: 12px; border-radius: 50%; }
.legend-row .sub { color: var(--muted); font-size: 12px; }
.legend-sel { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 8px; }
.legend-sel .ring { width: 12px; height: 12px; border-radius: 50%; border: 3px solid #e00000; background: #ddd; }

.grid2 { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: #f3f5f9; position: sticky; top: 0; }
td.num, th.num { text-align: right; }
.bar { display: inline-block; height: 8px; background: #e00000; border-radius: 4px; vertical-align: middle; }
.table-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.table-head h3 { margin: 0; }
.table-head select { font: inherit; padding: 4px 6px; margin-left: 4px; }
.table-scroll { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 10px; color: #fff; font-size: 12px; }
footer { padding: 4px 20px 20px; color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
}
