/* Map layers menu (app.ui.addMapToggle): one dock button, a small menu of switches above the
   dock. */
.map-layers-btn { position: relative; }
.map-layers-btn .ml-count {
  min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--gold);
  color: #1a1208; font-size: 10px; line-height: 15px; text-align: center;
}
.map-layers-pop {
  align-self: flex-end; width: 240px; max-width: calc(100vw - 16px); max-height: 60vh;
  overflow-y: auto; padding: 4px 0 6px;
}
.ml-head {
  padding: 4px 12px 6px; font: normal 11px var(--serif); letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold); border-bottom: 1px solid var(--line);
  margin-bottom: 3px;
}
.ml-row {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 12px; min-height: 36px;
  cursor: pointer; text-align: left; background: none; border: 0; font-size: 12.5px;
  color: var(--ink-dim);
}
.ml-row:hover, .ml-row:focus-visible { background: rgba(201,164,92,.1); }
.ml-row.on { color: var(--ink); }
.ml-ic { display: inline-grid; place-items: center; width: 18px; flex: none; }
.ml-lbl { flex: 1; }
.ml-switch {
  position: relative; width: 28px; height: 16px; border-radius: 8px; background: rgba(0,0,0,.4);
  border: 1px solid rgba(201,164,92,.4); flex: none;
}
.ml-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--ink-dim); transition: left .12s;
}
.ml-row.on .ml-switch { background: #5a4a24; border-color: var(--gold-bright); }
.ml-row.on .ml-switch::after { left: 14px; background: var(--gold-bright); }
/* The details toggle matters beside a docked dashboard (advisors), where the legend is a compact
   strip at the top right of the map, and on phones, where the note folds behind it. */
.lg-more { display: none; width: 20px; height: 20px; font-size: 14px; line-height: 1; }
@media (min-width: 701px) {
  body.dock-open .lg-more { display: inline-grid; place-items: center; }
  body.dock-open #legend {
    position: absolute; right: 0; bottom: calc(100vh - 12px - var(--topbar-h) - 10px);
    transform: translateY(100%);
  }
  body.dock-open #legend:not(.expanded) { width: 230px; padding: 5px 8px 4px; }
  body.dock-open #legend:not(.expanded) .lg-ic { width: 20px; height: 20px; }
  body.dock-open #legend:not(.expanded) .title { font-size: 13px; }
  body.dock-open #legend:not(.expanded) :is(.desc, .lg-hist, .lg-meta, .lg-hint) { display: none; }
  body.dock-open #legend:not(.expanded) .band-mark { top: -3px; }
  body.dock-open #legend:not(.expanded) .ticks span:nth-child(2n) { display: none; }
  body.dock-open #legend:not(.expanded) .lg-unit { display: block; }
}
/* On a phone the docked dashboard is a bottom sheet over the legend: the legend (and its
   estimate mark, which the map's tooltip relies on) moves to a compact strip under the top bar. */
@media (max-width: 700px) {
  body.dock-open #legend {
    position: absolute; left: 0; right: 0; bottom: calc(100vh - var(--topbar-h) - 8px);
    transform: translateY(100%);
  }
  body.dock-open #legend :is(.desc, .lg-hist, .lg-meta, .lg-hint) { display: none; }
  body.dock-open #legend:not(.expanded) .lg-note { display: none; }
}
