:root {
  --paper: #f7f3ea;
  --ink: #2b2a27;
  --muted: #6d6a62;
  --line: #d9d2c3;
  --gold: #d4a017;
  --river: #4a90c2;
  --hi: #2e7d32;
  --mid: #e0a800;
  --lo: #c0392b;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; color: var(--ink); background: var(--paper); }
#map { position: absolute; inset: 0; }

#panel {
  position: absolute; top: 12px; left: 12px; bottom: 12px; width: 300px;
  overflow-y: auto; background: rgba(247, 243, 234, 0.95);
  border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; font-size: 13px;
}
#panel h1 { font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: 18px; margin: 0; }
#panel .sub { margin: 2px 0 8px; color: var(--muted); }
#panel h2 { font-size: 12px; color: var(--muted); margin: 14px 0 6px; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
#panel ul { list-style: none; margin: 0; padding: 0; }
#panel li { padding: 5px 6px; border-radius: 4px; cursor: pointer; line-height: 1.4; }
#panel li:hover { background: #ece5d6; }
#panel li .meta { display: block; color: var(--muted); font-size: 11px; }
#panel footer { margin-top: 16px; font-size: 11px; color: var(--muted); }
#panel a { color: #7a5a00; }

.seg { display: flex; gap: 4px; }
.seg button { flex: 1; padding: 4px; border: 1px solid var(--line); background: #fff; border-radius: 4px; cursor: pointer; font-size: 12px; }
.seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.row input { flex: 1; }

.legend div { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #0004; display: inline-block; }
.line { width: 18px; height: 3px; display: inline-block; }

.marker { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #0006, 0 1px 4px #0006; cursor: pointer; }
.marker-label { position: absolute; left: 20px; top: -2px; white-space: nowrap; font-size: 12px; font-weight: bold; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; pointer-events: none; }

#detail {
  position: absolute; top: 12px; right: 12px; width: 340px; max-height: calc(100% - 24px); overflow-y: auto;
  background: rgba(247, 243, 234, 0.97); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; font-size: 13px; line-height: 1.6;
}
#detail h3 { font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; margin: 0 0 6px; font-size: 16px; }
#detail dl { margin: 0; }
#detail dt { color: var(--muted); font-size: 11px; margin-top: 8px; }
#detail dd { margin: 0; }
#detail .close { float: right; border: none; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
#detail ol { margin: 4px 0 0; padding-left: 18px; font-size: 12px; }

@media (max-width: 700px) {
  #panel { width: auto; right: 12px; bottom: auto; max-height: 40%; }
  #detail { left: 12px; right: 12px; width: auto; top: auto; bottom: 12px; max-height: 45%; }
}

#panel li.sel { background: #d9f3f8; box-shadow: inset 3px 0 0 #00b4d8; }
.hl-label {
  background: #00b4d8; color: #fff; font-size: 13px; font-weight: bold; padding: 4px 8px; border-radius: 4px;
  white-space: nowrap; pointer-events: none; box-shadow: 0 1px 4px #0006;
}

.legend .star { display: inline-block; width: 14px; text-align: center; font-size: 15px; line-height: 1; text-shadow: 0 0 1px #0006; }
.legend .note { font-size: 11px; color: var(--muted); margin-top: 4px; }
