:root {
  --accent: #12a150;
  --ink: #1f2328;
  --muted: #6b7280;
  --line: #e5e7eb;
  --card: #ffffff;
  --card-2: #f6f7f8;
  --shadow: 0 2px 6px rgba(0, 0, 0, .12), 0 8px 24px rgba(0, 0, 0, .08);
  --radius: 12px;
  font-family: "Pretendard Variable", Pretendard, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  color-scheme: light;
}
html.dark {
  --ink: #e8eaed;
  --muted: #9aa0a6;
  --line: #3a3f47;
  --card: #23272e;
  --card-2: #2c313a;
  --shadow: 0 2px 6px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2b2d31; }
body { color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }

.ms {
  font-family: "Material Symbols Rounded";
  font-weight: 500; font-size: 20px; line-height: 1;
  display: inline-block; vertical-align: middle; user-select: none;
  font-feature-settings: "liga";
}

#map { position: fixed; inset: 0; }
.maplibregl-ctrl-scale {
  background: rgba(255, 255, 255, .9); color: var(--ink); border-color: #555; line-height: 18px;
  font-family: "Pretendard Variable", Pretendard, system-ui, sans-serif; font-weight: 600; font-size: 11px;
}
html.dark .maplibregl-ctrl-scale { background: rgba(35, 39, 46, .9); border-color: #9aa0a6; }
.maplibregl-ctrl-bottom-right { right: 12px; bottom: 10px; }
.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0; }

/* ------------------------------------------------------------- search + panel */
#side {
  position: fixed; top: 12px; left: calc(var(--rail, 0px) + 12px); z-index: 10;
  width: 380px; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px);
  display: flex; flex-direction: column; gap: 8px;
}
#side-head, #chips-wrap { flex: none; }
#side-head { display: flex; gap: 8px; }
#searchbox {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 8px 0 14px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 2px solid transparent;
}
#searchbox:focus-within { border-color: var(--accent); }
#searchbox > .ms { color: var(--accent); }
#q { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; }
#q::-webkit-search-cancel-button { display: none; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--muted); display: grid; place-items: center; }
.icon-btn:hover { background: var(--card-2); }

#chips-wrap { position: relative; }
#chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 1px 1px 5px; margin-bottom: -4px; }
#chips::-webkit-scrollbar { display: none; }
#chips.fade-r { mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
#chips.fade-l { mask-image: linear-gradient(to left, #000 calc(100% - 56px), transparent); }
#chips.fade-l.fade-r { mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent); }
.chips-nav {
  position: absolute; top: 1px; z-index: 1; width: 32px; height: 32px; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; background: var(--card); color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.chips-nav:hover { background: var(--card-2); }
.chips-nav.prev { left: 0; }
.chips-nav.next { right: 0; }
@media (hover: none) { .chips-nav { display: none !important; } }
.chip {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex: none;
  height: 32px; padding: 0 11px 0 8px; border: 0; border-radius: 16px; cursor: pointer;
  background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); font-size: 13px; font-weight: 600;
}
.chip .ms { font-size: 17px; color: var(--c); }
.chip[aria-pressed="true"] { background: var(--accent); color: #fff; }
.chip[aria-pressed="true"] .ms { color: #fff; }

/* Boxes that scroll over the map are a hair short of opaque. Chrome culls whatever lies under an opaque
   scroller by the size of its whole content, not the part on screen, so a long bottom sheet on a phone
   blanked the map above it (and made it flicker while panning). */
#panel, .pop, #layer-legend { --scroller-bg: color-mix(in srgb, var(--card) 99.6%, transparent); }
#panel { position: relative; background: var(--scroller-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; min-height: 0; }
#panel-close { position: absolute; top: 8px; right: 8px; z-index: 1; }
#panel-body { padding: 18px 18px 16px; }
#panel-body.flush { padding: 0; }
#panel h2 { font-size: 20px; margin: 0 34px 4px 0; line-height: 1.3; word-break: keep-all; }
.back {
  display: inline-flex; align-items: center; gap: 4px; margin: -6px 0 10px -6px; padding: 4px 8px 4px 4px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 600;
}
.back:hover { background: var(--card-2); color: var(--ink); }
.back .ms { font-size: 18px; }
.kind-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.kind-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #999); }
.addr { margin: 10px 0 0; font-size: 14px; display: flex; align-items: flex-start; gap: 6px; }
.addr .ms { font-size: 18px; color: var(--muted); }
.desc { white-space: pre-wrap; line-height: 1.6; margin: 12px 0 0; font-size: 14px; }
.facts { margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 13px; }
.facts dt { color: var(--muted); white-space: nowrap; }
.facts dd { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.facts code { font-family: ui-monospace, monospace; font-size: 12px; background: var(--card-2); padding: 2px 6px; border-radius: 6px; }
.line-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 10px; color: #fff; font-size: 12px; font-weight: 700; background: var(--c); }
.actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-top: 16px; }
/* Things only a logged-in OP can use (the rail's account decides, see /shared/nav.mjs). */
html:not(.is-op) .op-only { display: none !important; }
.actions .btn { flex-direction: column; gap: 4px; padding: 10px 4px 9px; font-size: 12.5px; white-space: nowrap; }
.actions .btn .ms { font-size: 20px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center; text-decoration: none;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px;
  padding: 8px 12px; cursor: pointer; font-size: 13.5px; font-weight: 600;
}
.btn:hover { background: var(--card-2); }
.btn .ms { font-size: 18px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.mini { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 2px; border-radius: 6px; }
.mini:hover { color: var(--ink); background: var(--card-2); }
.mini .ms { font-size: 16px; }
.meta { margin-top: 12px; font-size: 12px; color: var(--muted); }

.results { list-style: none; margin: 0; padding: 6px 0; }
.results h4 { margin: 10px 16px 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.results li button {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  border: 0; background: transparent; padding: 10px 16px; cursor: pointer;
}
.results li button:hover, .results li button:focus-visible { background: var(--card-2); outline: none; }
.results .ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--c, #9ca3af); color: #fff; flex: none; }
.results .ico .ms { font-size: 18px; }
.results .t { font-weight: 600; font-size: 15px; }
.results .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.results .dist { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.results mark { background: none; color: var(--accent); font-weight: 800; }
.results .ico { position: relative; }
/* The number of the row's pin on the map. */
.results .num {
  position: absolute; right: -5px; bottom: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: #2f6fdc; color: #fff; font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px var(--card); font-variant-numeric: tabular-nums;
}
.results li button:hover .num, .results li button.hl .num { background: #ea4335; }
.results li button.hl { background: var(--card-2); }
.results-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 48px 6px 16px;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.results-head .linkish { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; white-space: nowrap; }
.results-head .linkish .ms { font-size: 16px; }
.results-head + .results { padding-top: 0; }
.sub-h { margin: 20px 0 4px; font-size: 13px; font-weight: 700; }
.sub-h .count { color: var(--accent); }
.results.in-card { margin: 0 -18px -10px; padding: 0; }
.results.in-card li button { padding-left: 18px; padding-right: 18px; }
.facts .linkish { text-align: left; }
.empty { padding: 20px 18px; color: var(--muted); font-size: 14px; }

/* The legend, which is also where each kind of feature is shown or hidden. */
.legend-hint { margin: -4px 0 10px; font-size: 13px; line-height: 1.5; color: var(--muted); word-break: keep-all; }
.legend { display: grid; gap: 4px; font-size: 13px; }
.legend section + section { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.legend .lg-head { display: flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; }
.legend .lg-head h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.legend .n, #feature-secs .n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.legend .lg-items { display: grid; gap: 0 12px; }
.legend .lg-items.cols { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.legend .lg-item { display: flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; }
.legend .lg-item .sw { flex: none; width: 34px; display: flex; justify-content: center; }
.legend .lg-label { min-width: 0; word-break: keep-all; line-height: 1.3; }
.legend input[type=checkbox], #feature-secs input { width: 16px; height: 16px; margin: 0; flex: none; }
.legend label:has(input:disabled), #feature-secs label:has(input:disabled) { opacity: .45; cursor: default; }
.legend .lg-pin { width: 22px; height: 22px; }
.legend .lg-pin .ms { font-size: 14px; }
.swatch-line { width: 34px; height: 8px; border-radius: 4px; background: var(--f); box-shadow: 0 0 0 2px var(--c) inset; }
.swatch-line.dash { height: 4px; border-radius: 0; box-shadow: none; background: repeating-linear-gradient(90deg, var(--f) 0 6px, transparent 6px 10px); }
.swatch-line.rail { background: repeating-linear-gradient(90deg, var(--f) 0 5px, var(--c) 5px 10px); box-shadow: 0 0 0 2px var(--c) inset; }
.swatch-area { width: 34px; height: 16px; border-radius: 4px; background: var(--f); border: 1px solid rgba(0, 0, 0, .1); }
.rest-note { margin: 2px 0 6px; font-size: 12px; line-height: 1.5; color: var(--muted); word-break: keep-all; }
.legend-foot { display: flex; gap: 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------- top right, controls, popovers */
#topright { position: fixed; top: 12px; right: 12px; z-index: 10; display: flex; gap: 8px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; text-decoration: none;
  border: 0; border-radius: 20px; background: var(--card); color: var(--ink); box-shadow: var(--shadow);
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.pill .ms { font-size: 18px; }
.pill.ghost { background: rgba(255, 255, 255, .88); cursor: default; font-variant-numeric: tabular-nums; }
html.dark .pill.ghost { background: rgba(35, 39, 46, .9); }

#controls { position: fixed; right: 12px; top: 64px; z-index: 10; display: grid; gap: 8px; justify-items: end; }
.ctl {
  width: 40px; height: 40px; border: 0; background: var(--card); color: var(--ink); box-shadow: var(--shadow);
  border-radius: 10px; display: grid; place-items: center; cursor: pointer;
}
.ctl:hover { background: var(--card-2); }
.ctl[aria-pressed="true"], .ctl[aria-expanded="true"] { background: var(--accent); color: #fff; }
.ctl-group { display: grid; box-shadow: var(--shadow); border-radius: 10px; overflow: hidden; }
.ctl-group .ctl { box-shadow: none; border-radius: 0; }
.ctl-group .ctl + .ctl { border-top: 1px solid var(--line); }

.pop {
  position: fixed; right: 60px; top: 64px; z-index: 11; width: 280px; max-height: calc(100vh - 80px); overflow: auto;
  background: var(--scroller-bg); box-shadow: var(--shadow); border-radius: var(--radius); padding: 12px 14px 14px; font-size: 13px;
}
.pop h3 { margin: 12px 0 8px; font-size: 12px; color: var(--muted); font-weight: 700; }
.pop-close { position: absolute; top: 4px; right: 4px; }
.pop h3:first-child { margin-top: 2px; }
.pop .h3-row { display: flex; align-items: center; justify-content: space-between; margin-right: 0; }
.pop .h3-row .linkish { display: inline-flex; align-items: center; font-size: 12px; }
.pop .h3-row .linkish .ms { font-size: 16px; margin-right: -3px; }
#feature-secs label { cursor: pointer; }
#feature-secs .sec-name { white-space: nowrap; }
#feature-secs + .rest-note { margin: 6px 0 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--card-2); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 0; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
/* Map types and layers as icon tiles (Naver-style); the pressed one is outlined in the accent colour. */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tiles button {
  display: grid; justify-items: center; gap: 3px; min-width: 0; padding: 8px 2px 7px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--muted); cursor: pointer; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.tiles button .ms { font-size: 21px; }
.tiles button:hover { background: var(--card-2); color: var(--ink); }
.tiles button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.tiles.types { grid-template-columns: 1fr 1fr; }
.tiles.types button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 4px; font-size: 13px; }
.tiles.types button .ms { font-size: 20px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.checks label, .row.check { display: flex; align-items: center; gap: 6px; }
.row.check { font-weight: 400; }
.row { display: grid; gap: 4px; margin-top: 8px; font-weight: 600; }
.row input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); }
.pop-links { display: grid; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); justify-items: start; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; font-size: 13px; text-decoration: none; }

#measurebar {
  position: fixed; left: calc(50% + var(--rail, 0px) / 2); bottom: 22px; transform: translateX(-50%); z-index: 10;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; column-gap: 10px; padding: 6px 8px 6px 6px;
  background: var(--card); box-shadow: var(--shadow); border-radius: 14px; font-size: 14px; max-width: calc(100vw - 24px);
}
#measurebar .seg { width: 180px; }
#measure-out { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#measure-times {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 5px; margin: 6px 0 1px; padding: 6px 4px 0;
  border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums;
}
#measure-times .ms { font-size: 16px; }
#measure-times { flex-wrap: wrap; row-gap: 0; }
#measure-times span { white-space: nowrap; }
#measure-clear { white-space: nowrap; }

/* Narrowing a nearby list by kind. */
.subchips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 16px 8px; }
.subchips::-webkit-scrollbar { display: none; }
.subchips button {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.subchips button:hover { background: var(--card-2); }
.subchips .n { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.subchips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.subchips button[aria-pressed="true"] .n { color: rgba(255, 255, 255, .85); }
.results-head + .subchips + .results { padding-top: 0; }
.subchips.fade-r { mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.subchips.fade-l { mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
.subchips.fade-l.fade-r { mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }

/* Legend of the switched-on overlays. */
#layer-legend {
  position: fixed; right: 12px; bottom: 38px; z-index: 6; width: 188px; max-height: calc(100vh - 400px); overflow: auto;
  padding: 10px 12px; background: var(--scroller-bg); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 12px;
}
#layer-legend h4 { margin: 0 26px 6px 0; font-size: 12px; font-weight: 700; color: var(--muted); }
#layer-legend section + section { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
#layer-legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
#layer-legend li { display: flex; align-items: center; gap: 8px; min-height: 18px; }
#layer-legend .pop-close { top: 2px; right: 2px; }
#layer-legend .sw { flex: none; width: 28px; display: flex; justify-content: center; }
.lg-line { flex: none; width: 26px; border-top: 3px solid var(--c); }
.lg-line.dash { border-top-style: dashed; }
.lg-line.wide { border-top-width: 6px; }
.lg-pin { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; }
.lg-pin .ms { font-size: 12px; }
.lg-text { white-space: nowrap; font-size: 11px; }
.lg-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.lg-toggle { display: none; }
body.embed #layer-legend { display: none !important; }

/* Where the middle of the map is (시 › 구 › 동), and re-running a list for the area now on screen. */
#crumbs {
  position: fixed; z-index: 9; display: flex; align-items: center; min-width: 0; height: 40px; padding: 0 6px;
  background: rgba(255, 255, 255, .92); border-radius: 20px; box-shadow: var(--shadow); font-size: 13px; font-weight: 600;
}
html.dark #crumbs { background: rgba(35, 39, 46, .92); }
#crumbs button {
  min-width: 0; border: 0; background: transparent; color: var(--muted); padding: 6px 7px; border-radius: 8px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#crumbs button:last-child { color: var(--ink); }
#crumbs button:hover { background: var(--card-2); color: var(--ink); }
#crumbs .ms { flex: none; font-size: 16px; color: var(--muted); }
#crumbs > .ms:first-child { margin: 0 1px 0 4px; color: var(--accent); font-variation-settings: "FILL" 1; }
@media (min-width: 960px) { #crumbs { top: 16px; left: calc(var(--rail, 0px) + 404px); max-width: calc(100vw - var(--rail, 0px) - 404px - 300px); } }
@media (max-width: 959px) {
  #crumbs { left: calc(var(--rail, 0px) + 12px); bottom: 38px; height: 28px; padding: 0 3px; border-radius: 14px; font-size: 12px; max-width: calc(100vw - 150px); }
  #crumbs button { padding: 3px 6px; }
  body.has-crumbs #minimap { bottom: 72px; }
  body.has-legend #crumbs { max-width: calc(100vw - 230px); }
}
body.measuring #crumbs { display: none; }
#research { position: fixed; left: calc(50% + var(--rail, 0px) / 2); bottom: 24px; transform: translateX(-50%); z-index: 10; background: var(--accent); color: #fff; }
#research:hover { background: #0f8a44; }
@media (min-width: 641px) { body.panel-open #research { left: calc(50% + var(--rail, 0px) / 2 + 196px); } }

#coords {
  position: fixed; left: calc(var(--rail, 0px) + 12px); bottom: 10px; z-index: 5; height: 22px; line-height: 22px;
  background: rgba(255, 255, 255, .9); border-radius: 8px; padding: 0 10px; white-space: nowrap;
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
html.dark #coords { background: rgba(35, 39, 46, .9); }
#minimap { position: fixed; left: calc(var(--rail, 0px) + 12px); bottom: 44px; z-index: 5; width: 200px; height: 150px; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); border: 2px solid var(--card); }

#toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%) translateY(10px); z-index: 30;
  background: #1f2328; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }

/* location pin and players (DOM markers) */
.drop-pin { width: 30px; height: 40px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.drop-pin .ms { font-size: 40px; color: #ea4335; font-variation-settings: "FILL" 1; }
.player { display: flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 12px; font-weight: 700; pointer-events: none; }
.player i { width: 12px; height: 12px; border-radius: 50%; background: #ff5a36; box-shadow: 0 0 0 2px #fff; }
.player span { background: rgba(0, 0, 0, .62); color: #fff; padding: 1px 6px; border-radius: 8px; }

#embed-open { position: fixed; left: 12px; top: 12px; z-index: 10; }
body.embed #side, body.embed #topright, body.embed #btn-measure, body.embed #coords, body.embed #crumbs { display: none !important; }

/* ------------------------------------------------------------- phones */
@media (max-width: 640px) {
  #side { top: 10px; left: 10px; right: 10px; width: auto; max-width: none; max-height: none; }
  #panel { position: fixed; left: 0; right: 0; bottom: 0; max-height: 55vh; border-radius: 16px 16px 0 0; }
  /* The on-screen keyboard covers the bottom of the screen: list results right under the search box. */
  body[data-panel="search"] #panel { top: 112px; max-height: none; }
  body[data-panel="search"] #controls { display: none; }
  #minimap-row { display: none; }
  body.panel-open #measurebar, body.panel-open #coords, body.panel-open #crumbs, body.panel-open #layer-legend { display: none; }
  body.measuring #layer-legend { display: none; }
  #layer-legend { right: 10px; width: 180px; max-height: calc(100vh - 330px); }
  /* Folded into a small button until tapped; unfolded, it takes the place of the place names. */
  #layer-legend:not(.open) { width: auto; padding: 0; border-radius: 16px; }
  #layer-legend:not(.open) > :not(.lg-toggle) { display: none; }
  #layer-legend:not(.open) .lg-toggle {
    display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px 0 9px; border: 0; background: transparent;
    color: var(--ink); font-size: 12.5px; font-weight: 600; cursor: pointer;
  }
  .lg-toggle .ms { font-size: 17px; color: var(--accent); }
  body.has-legend #crumbs { max-width: calc(100vw - 120px); }
  body.legend-open #crumbs { display: none; }
  #crumbs { left: 10px; }
  #topright { display: none; }
  #controls { top: 110px; right: 10px; }
  .pop { right: 10px; left: 10px; width: auto; top: 110px; }
  /* Full width, above the coordinates and the scale bar. */
  #measurebar { left: 10px; right: 10px; bottom: 38px; transform: none; max-width: none; }
  #measurebar .seg { width: 138px; }
  #minimap { display: none; }
}
