/* Locker map picker (web/locker-picker.mjs). Colours resolve through the
   host page's tokens when it has them, so dark mode follows the host. */
.locker-picker {
  --lp-border: var(--border, #d1d5db);
  --lp-line: var(--line-soft, #f0f0f0);
  --lp-bg: var(--bg-card, #ffffff);
  --lp-hover: var(--bg-hover, #f3f4f6);
  --lp-muted: var(--muted, #6b7280);
  --lp-accent: var(--accent, #4f46e5);
  --lp-accent-soft: var(--accent-soft, #eef2ff);
  /* Pin colours are the map's own, the same in light and dark: dark teal
     and brown, the cool and warm complements of the cream map, with the
     chosen pin the one strong warm colour on it. */
  --lp-locker: #2c5a63;
  --lp-cluster: #24474f;
  --lp-point: #765448;
  --lp-selected: #c8553d;
  --lp-here: #2563eb;
  container-type: inline-size;
  border: 1px solid var(--lp-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--lp-bg);
}

.locker-picker__body {
  display: grid;
  grid-template-columns: minmax(14rem, 20rem) 1fr;
  height: 26rem;
}

.locker-picker__side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--lp-border);
}

.locker-picker__query {
  position: relative;
  margin: 0.5rem;
}

.locker-picker__search {
  width: 100%;
  padding: 0.4rem 1.8rem 0.4rem 0.4rem;
  box-sizing: border-box;
}

/* The picker's own × stands in for the browser's, which not every one draws. */
.locker-picker__search::-webkit-search-cancel-button {
  display: none;
}

.locker-picker__clear {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  transform: translateY(-50%);
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--lp-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.locker-picker__clear:hover {
  background: var(--lp-hover);
  color: inherit;
}

.locker-picker__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.8rem;
  padding: 0 0.5rem 0.3rem;
  font-size: 0.85rem;
}

.locker-picker__locate {
  margin-left: auto;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--lp-border);
  border-radius: 4px;
  background: var(--lp-bg);
  color: var(--lp-accent);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.locker-picker__locate:disabled {
  color: var(--lp-muted);
  cursor: default;
}

.locker-picker__status {
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
  color: var(--lp-muted);
  border-bottom: 1px solid var(--lp-line);
}

.locker-picker__results {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
}

.locker-picker__result button {
  display: grid;
  gap: 0.1rem;
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: 0;
  border-bottom: 1px solid var(--lp-line);
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.locker-picker__result button:hover {
  background: var(--lp-hover);
}

.locker-picker__result strong {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.locker-picker__result span {
  font-size: 0.8rem;
  color: var(--lp-muted);
}

.locker-picker__result .locker-picker__distance {
  flex-shrink: 0;
  font-weight: normal;
  white-space: nowrap;
}

.locker-picker__result .locker-picker__nocard {
  font-size: 0.75rem;
  font-style: italic;
}

.locker-picker__result--selected button {
  background: var(--lp-accent-soft);
  box-shadow: inset 3px 0 0 var(--lp-selected);
}

.locker-picker__map {
  position: relative;
  min-height: 0;
  /* Keeps the map's own controls under the host's overlays. */
  isolation: isolate;
}

.locker-picker__notice {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 3;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--lp-border);
  border-radius: 4px;
  background: var(--lp-bg);
  font-size: 0.8rem;
  color: var(--lp-muted);
}

@container (max-width: 640px) {
  .locker-picker__body {
    grid-template-columns: 1fr;
    grid-template-rows: 13rem 20rem;
    height: auto;
  }

  .locker-picker__side {
    border-right: 0;
    border-bottom: 1px solid var(--lp-border);
  }
}
