/* "Show on map" panel, the hidden-pieces chip and the toolbar badge (view-filter.js) */
.vf-badge {
  position: absolute; top: 1px; right: 1px; min-width: 15px; height: 15px; padding: 0 3px; box-sizing: border-box;
  font: 600 10px/15px var(--font-ui); color: var(--c-accent-ink); background: var(--c-accent); pointer-events: none;
}
.vf-badge[hidden] { display: none; }
.vf-panel {
  position: absolute; z-index: 4; top: 66px; left: 50%; transform: translateX(-50%);
  width: 300px; max-width: calc(100% - 24px); max-height: calc(100% - 80px); overflow: auto; box-sizing: border-box;
  padding: var(--sp-3) var(--sp-5) var(--sp-4);
  background: var(--c-float); border: 1px solid var(--c-line-strong);
  box-shadow: 0 0 0 3px var(--c-float-ring), 0 10px 24px rgba(0, 0, 0, .6);
  font-size: var(--fs-sm);
}
.vf-panel[hidden] { display: none; }
.vf-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-2); color: var(--c-heading); }
.vf-x { min-height: 0; width: 28px; height: 28px; padding: 0; border-color: transparent; }
.vf-row { display: flex; align-items: center; gap: var(--sp-3); min-height: 28px; margin: 0; cursor: pointer; }
.vf-row .vf-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vf-n { color: var(--c-text-faint); font-variant-numeric: tabular-nums; }
.vf-row:has(input:disabled) { opacity: .5; cursor: default; }
.vf-tags { margin: 0 0 var(--sp-2) 22px; }
.vf-tags > summary { cursor: pointer; color: var(--c-text-muted); min-height: 24px; display: list-item; }
.vf-tag-btns { display: flex; gap: var(--sp-5); margin: var(--sp-1) 0 var(--sp-2); }
.vf-tag-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--sp-5); }
.vf-tag { min-height: 26px; }
.vf-sub { margin: var(--sp-4) 0 var(--sp-1); padding-top: var(--sp-3); border-top: 1px solid var(--c-line); color: var(--c-text-muted); }
.vf-note { margin-top: var(--sp-3); color: var(--c-text-faint); font-size: var(--fs-xs); line-height: 1.4; }
.vf-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); margin-top: var(--sp-3); }
.vf-sum { color: var(--c-text-muted); }

.vf-chip {
  position: absolute; z-index: 3; left: 14px; bottom: 14px; display: flex; align-items: stretch;
  background: var(--c-float); border: 1px solid var(--c-line-strong); box-shadow: 0 6px 16px rgba(0, 0, 0, .5);
  font-size: var(--fs-sm);
}
.vf-chip[hidden] { display: none; }
.vf-chip button { min-height: 30px; padding: 0 var(--sp-4); border: 0; background: none; }
.vf-chip .vf-chip-text { color: var(--c-text-muted); }
.vf-chip .vf-chip-text:hover { color: var(--c-text); }
.vf-chip .vf-chip-all { border-left: 1px solid var(--c-line); color: var(--c-select); }

@media (max-width: 720px) {
  /* the toolbar is along the bottom on phones: the panel opens above it and the chip sits top left */
  .vf-panel { top: auto; bottom: 66px; left: 8px; right: 8px; width: auto; max-width: none; transform: none; max-height: calc(100% - 80px); }
  .vf-row { min-height: 36px; }
  .vf-tag { min-height: 34px; }
  .vf-x { width: 36px; height: 36px; }
  .vf-chip { left: 8px; top: 8px; bottom: auto; }
  .vf-chip button { min-height: 36px; }
}

/* Colour key: what the map's colours mean (matches editor.js MAP and colorFor) */
.vf-key { margin-top: var(--sp-3); border-top: 1px dotted var(--c-line); padding-top: var(--sp-3); font-size: var(--fs-sm); }
.vf-key > summary { cursor: pointer; color: var(--c-text-muted); }
.vf-key-list { list-style: none; margin: var(--sp-3) 0 0; padding: 0; display: grid; gap: var(--sp-2); }
.vf-key-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: var(--sp-3); align-items: center; line-height: 1.3; }
.vf-sw { width: 16px; height: 12px; display: inline-block; border: 1px solid rgba(0, 0, 0, .55); }
.vf-sw-func { background: var(--c-map-interactive); }
.vf-sw-deco { background: linear-gradient(90deg, hsl(30 55% 58%) 0 25%, hsl(110 55% 58%) 25% 50%, hsl(200 55% 58%) 50% 75%, hsl(285 55% 58%) 75%); opacity: .8; }
.vf-sw-faint { background: hsl(110 55% 58% / .2); border-color: hsl(110 55% 58%); }
.vf-sw-sel { background: transparent; border: 2px solid var(--c-select); }
.vf-sw-off { background: transparent; border: 1.5px dashed var(--c-danger); border-radius: 50%; width: 14px; height: 14px; }
.vf-sw-floor { background: var(--c-map-floor); border-color: var(--c-line-strong); }
.vf-sw-rust { background: var(--c-map-floor-unsure); border-color: var(--c-line-strong); }
