/*
 * Nordliebe retailer map: shared stylesheet for login and map views.
 * Loaded directly by PHP; no preprocessor or CSS build step.
 * Design rules and component examples: docs/styleguide.md (repository root).
 *
 * Order: fonts -> tokens/reset -> shared controls -> login -> map components
 * -> touch adjustments -> tablet/mobile overrides -> reduced motion.
 * Base rules describe desktop; responsive overrides stay at the end.
 *
 * Naming: block__element for component parts, block--modifier for variants.
 * app.js controls visibility with hidden and component-scoped .is-open states;
 * ARIA attributes also drive selected, pressed and expanded appearances.
 * Keep state selectors in sync with the markup generated by app.js.
 */

/* Self-hosted Jost subsets: unicode-range selects the file for each character. */

@font-face {
  font-family: Jost;
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(fonts/jost-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Jost;
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(fonts/jost-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Shared design tokens. Brand colors arrive separately through inline --dot. */
:root {
  --color-text: #303030;
  --color-ink: #1C1C1C;
  --color-bg: #FFFFFF;
  --color-surface: #F6F6F6;
  --color-border: #E0E0E0;
  --color-muted: #6B6B6B;
  --color-accent: #F5DB8B;
  --color-accent-hover: #EFCF6A;
  --color-success: #307A07;
  --color-success-bg: #D4E3CB;
  --color-warning: #ED8A00;
  --color-warning-bg: #FDF1E0;
  --color-error: #CB2B2B;
  --color-error-bg: #F3CCCC;

  --font: Jost, "Helvetica Neue", Arial, sans-serif;
  --tracking-caps: 0.18em;
  --shadow-float: 0 2px 12px rgba(0, 0, 0, .08);
  /* Mobile overrides the gutter; header height describes the desktop/tablet row. */
  --control-height: 44px;
  --gutter: 24px;
  --header-height: 64px;
}

/* Baseline sizing and native element reset. */
*, *::before, *::after { box-sizing: border-box; }
/* Component display rules must never override visibility set through hidden. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 400 15px/1.6 var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

/* Shared keyboard focus; inputs and map pins define their own focus treatment. */
:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; }

/* Type styles */

.title {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}
.label {
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}
.small { font-size: 13px; line-height: 1.5; color: var(--color-muted); }

/* Controls: combine .btn with a color modifier and optionally .btn--block. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--control-height);
  padding: 0 24px;
  border: 0;
  border-radius: 0;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms, border-color 150ms;
}
.btn--primary { background: var(--color-accent); }
.btn--primary:hover { background: var(--color-accent-hover); }
.btn--neutral { background: transparent; border: 1px solid var(--color-border); }
.btn--neutral:hover { border-color: var(--color-text); }
.btn:disabled { cursor: default; color: var(--color-muted); border-color: var(--color-border); }
.btn--block { width: 100%; }

.input {
  width: 100%;
  height: var(--control-height);
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: #fff;
  font-size: 15px;
  appearance: none;
}
.input::placeholder { color: var(--color-muted); }
/* Compensate for the thicker border so the text does not shift on focus. */
.input:focus { outline: none; border: 2px solid var(--color-ink); padding: 0 11px; }
.input--error { border-color: var(--color-error); }
.field-error { margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--color-error); }

/* Custom native checkbox: the wrapping label supplies the larger click target. */
.checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
}
.checkbox input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid var(--color-ink);
  border-radius: 0;
  background: #fff;
  appearance: none;
  display: grid;
  place-content: center;
}
.checkbox input:checked { background: var(--color-ink); }
.checkbox input:checked::after {
  content: "";
  width: 10px;
  height: 5px;
  margin-top: -2px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}

/* Login: a centered card with page scrolling available on short viewports. */

.login { min-height: 100dvh; background: var(--color-surface); }
.login__main {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px 16px;
}
.login__card {
  width: 100%;
  max-width: 360px;
  padding: 32px;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.login__logo { width: 220px; height: auto; margin: 0 auto 32px; }
.login__card .title { text-align: center; margin-bottom: 32px; }
.login__card .label { margin-bottom: 8px; }
.login__card .checkbox { margin: 12px 0 16px; }
.login__footer { font-size: 13px; line-height: 1.5; color: var(--color-muted); text-align: center; }

/* crm.php: the login card as waiting page while the browser extension reads CentralStation. */
.handoff { align-items: center; text-align: center; }
.handoff .loader__spinner { margin-bottom: 16px; }
/* Reserves the line for the count, so the card keeps its height when it appears. */
.handoff .small { min-height: 1.5em; }

/*
 * Map page layout: fixed-height viewport, 400px sidebar and flexible map.
 * minmax(0, 1fr) / min-height: 0 let children shrink so results scroll inside
 * their panel instead of making the entire page taller than the viewport.
 *
 * App layers: loader 5, notice 25, header 26, sheet 35, mobile list 40.
 * Header children with z-index 30 (search suggestions) stay inside the header's stacking
 * context, so the header itself must sit above the notice that opens right below it.
 * Google Maps panes manage map overlays separately; a modal dialog opened
 * with showModal() uses the browser top layer, above normal z-index layers.
 */

.app {
  height: 100dvh;
  overflow: hidden;
  display: grid;
  /* The notice row is empty (height 0) while no notice is shown. */
  grid-template: var(--header-height) auto minmax(0, 1fr) / 400px minmax(0, 1fr);
  grid-template-areas: "header header" "notice notice" "side map";
}

.header {
  grid-area: header;
  position: relative;
  z-index: 26;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--color-border);
  background: #fff;
}
.header__logo { flex: none; width: 140px; height: auto; }
.header__actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.header__actions form { margin: 0; }
.header__list, .header__menu { display: none; }
.header__menu {
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  background: none;
}
.header__menu svg, .search__icon { fill: none; stroke: currentColor; stroke-width: 1.5; }

/* Search: reserve space for clear/search icons; suggestions anchor to the field. */

.search {
  position: relative;
  flex: 1;
  max-width: 480px;
  align-self: stretch;
  display: flex;
  align-items: center;
  padding-left: var(--gutter);
}
.search__input { padding-right: 76px; }
.search__input:focus { padding-right: 75px; }
.search__input::-webkit-search-cancel-button { display: none; }
.search__icon { position: absolute; right: 12px; width: 20px; height: 20px; pointer-events: none; }
.search__clear {
  position: absolute;
  right: 40px;
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--color-muted);
}
.search__clear:hover { color: var(--color-text); }

.suggestions {
  position: absolute;
  top: calc(50% + 26px);
  left: var(--gutter);
  right: 0;
  z-index: 30;
  max-height: min(480px, 70dvh);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-float);
}
.suggestions__group { padding: 12px 16px 4px; color: var(--color-muted); }
.suggestion {
  display: block;
  width: 100%;
  padding: 8px 16px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
/* Keyboard selection from app.js uses the same appearance as pointer hover. */
.suggestion[aria-selected="true"], .suggestion:hover { background: var(--color-surface); }
.suggestion__name { display: block; font-weight: 500; line-height: 1.4; }
.suggestion__detail { display: block; font-size: 13px; line-height: 1.5; color: var(--color-muted); }
.suggestions__none { padding: 8px 16px 12px; font-size: 13px; color: var(--color-muted); }

/* Sidebar: filters and result list */

.sidebar {
  grid-area: side;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-border);
  background: #fff;
}
.filters { padding: 16px var(--gutter); border-bottom: 1px solid var(--color-border); }
/* Mobile replaces desktop chips with a dropdown of native checkboxes. */
.filters__toggle, .brand-choices { display: none; }
/* CRM selection: replaces the brand filter while active. */
.crm { padding: 16px var(--gutter); border-bottom: 1px solid var(--color-border); background: var(--color-accent); }
.crm__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crm__clear { padding: 4px 0; border: 0; background: none; font-size: 13px; text-decoration: underline; color: var(--color-ink); }
.crm__text { margin: 4px 0 0; font-size: 13px; color: var(--color-ink); }
.filters__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.filters__all { font-size: 13px; color: var(--color-muted); }
.filters__all button { padding: 4px 0; border: 0; background: none; font-size: 13px; text-decoration: underline; color: var(--color-text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  white-space: nowrap;
  transition: background-color 150ms, border-color 150ms;
}
.chip:hover { border-color: var(--color-text); }
/* app.js synchronizes pressed chips and checked mobile choices. */
.chip[aria-pressed="true"] { background: var(--color-accent); border-color: var(--color-accent); }
.chip__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot); }
.chip__count { color: var(--color-muted); letter-spacing: 0; font-weight: 400; }
.chip[aria-pressed="true"] .chip__count { color: var(--color-text); }

/* The heading stays visible while .results owns vertical scrolling. */
.list { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 49px;
  padding: 12px var(--gutter);
  border-bottom: 1px solid var(--color-border);
}
.list__close { display: none; }
.results { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
/* Let the separate empty-state paragraph follow the heading without a gap. */
.results:empty { flex: none; }
.results__empty { padding: 16px var(--gutter); color: var(--color-muted); }
.result {
  padding: 16px var(--gutter);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background-color 150ms;
}
.result:hover { background: var(--color-surface); }
.result[aria-current="true"] { box-shadow: inset 3px 0 0 var(--color-ink); }
.result__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.result__name { font-weight: 500; line-height: 1.4; }
/* Same number and color as the pin on the map. */
.result__number {
  min-width: 24px;
  height: 24px;
  margin-right: 10px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--dot, var(--color-ink));
  color: #fff;
  font: 500 12px/1 var(--font);
}
.result__distance { flex: none; font-size: 13px; color: var(--color-muted); }
.result .tags { margin-top: 8px; }

/* Brand tags: --dot supplies the brand color; --off marks an inactive brand. */

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  white-space: nowrap;
}
.tag__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.tag--off { color: var(--color-muted); }
.tag--off .tag__dot { background: #BDBDBD; }

/*
 * Map and pins: app.js positions DOM overlays through Google Maps OverlayView.
 * --dot is a brand color; pins/list numbers fall back to ink for multiple brands.
 * --size is the cluster diameter calculated by app.js, including its px unit.
 */

.map { grid-area: map; min-height: 0; background: var(--color-surface); }

/* Covers the map until the map and the retailers are ready. */
.loader {
  grid-area: map;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 13px;
}
.loader__spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-ink);
  border-radius: 50%;
  animation: loader-spin .9s linear infinite;
}
@keyframes loader-spin { to { transform: rotate(360deg); } }

/* Compact map-style control inserted into the Google Maps controls by app.js. */
.map-switch {
  display: flex;
  margin: 12px;
  border: 1px solid var(--color-border);
  background: #fff;
  box-shadow: var(--shadow-float);
}
.map-switch__btn {
  height: 32px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--color-muted);
  font: 500 11px/1 var(--font);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  transition: background-color 150ms, color 150ms;
}
.map-switch__btn:hover { color: var(--color-ink); }
.map-switch__btn[aria-pressed="true"] { background: var(--color-accent); color: var(--color-ink); }

/* Keep the 44px hit target independent of the smaller visible .pin__dot. */
.pin {
  position: absolute;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* The pin layer places left/top at the location; pins sit centered on it. */
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.pin:focus-visible { outline: none; }
.pin:focus-visible .pin__dot { outline: 2px solid var(--color-ink); outline-offset: 2px; }
.pin__dot {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--dot, var(--color-ink));
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  color: #fff;
  font: 500 12px/1 var(--font);
  line-height: 1;
  transition: transform 150ms;
}
.pin--numbered .pin__dot { width: auto; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; }
/* Outlined instead of filled, so a cluster's count does not read as a list number. */
.pin--cluster .pin__dot {
  width: var(--size);
  height: var(--size);
  border-color: var(--color-ink);
  background: #fff;
  color: var(--color-ink);
  font-size: 13px;
}
.pin--active .pin__dot { transform: scale(1.3); }
/* Searched address: a location needle, unlike the round retailer pins; the tip marks the spot. */
.place-pin {
  position: absolute;
  width: 32px;
  height: 42px;
  transform: translate(-50%, -100%);
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35));
}
.place-pin svg { display: block; width: 100%; height: 100%; }
.place-pin path { fill: var(--color-ink); stroke: #fff; stroke-width: 2; }
.place-pin circle { fill: var(--color-accent); }

/*
 * Retailer details share .entry markup in two containers: .info in Google's
 * floatPane on desktop, .sheet at the viewport bottom on mobile. app.js chooses
 * the container using matchMedia('(max-width: 767px)'); CSS alone does not switch it.
 */

.info {
  position: absolute;
  width: 320px;
  max-height: 420px;
  overflow-y: auto;
  padding: 16px;
  /* The map container sets Google's own font. */
  font: 400 15px/1.6 var(--font);
  color: var(--color-text);
  background: #fff;
  box-shadow: var(--shadow-float), 0 0 0 1px rgba(0, 0, 0, .04);
  transform: translate(-50%, calc(-100% - 20px));
  cursor: auto;
}
.entry + .entry { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--color-border); }
.entry__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.entry__name { font-size: 17px; font-weight: 500; line-height: 1.35; }
.entry .tags { margin: 8px 0 12px; }
.entry__contact { margin: 12px 0 0; display: grid; grid-template-columns: 20px 1fr; column-gap: 8px; }
.entry__contact dt { color: var(--color-muted); font-size: 12px; font-weight: 500; line-height: 24px; }
.entry__contact dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.entry__contact a { text-decoration: none; }
.entry__contact a:hover { text-decoration: underline; }
.entry__actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.close {
  flex: none;
  width: 32px;
  height: 32px;
  margin: -6px -8px 0 0;
  border: 0;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--color-muted);
}
.close:hover { color: var(--color-text); }

/* Safe-area padding clears the device home indicator; long content scrolls here. */
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  max-height: 60dvh;
  overflow-y: auto;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: #fff;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, .12);
}
.sheet .entry__contact { grid-template-columns: 24px 1fr; }
.sheet .entry__contact dt, .sheet .entry__contact dd { min-height: 44px; display: flex; align-items: center; }
.sheet .entry__contact a { display: flex; align-items: center; min-height: 44px; width: 100%; }
.sheet .entry__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-top: 0; padding-top: 4px; }
.sheet .entry__actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  text-decoration: none;
}

/* Sync feedback: success by default, --error on failure; dialog uses native backdrop. */

.notice {
  grid-area: notice;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px var(--gutter);
  background: var(--color-success-bg);
}
.notice--error { background: var(--color-error-bg); }
.notice__close { width: 32px; height: 32px; border: 0; background: none; font-size: 22px; line-height: 1; }

.dialog {
  width: calc(100% - 32px);
  max-width: 440px;
  padding: 24px;
  border: 0;
  border-radius: 0;
  box-shadow: var(--shadow-float);
}
.dialog::backdrop { background: rgba(0, 0, 0, .4); }
.dialog .title { margin-bottom: 16px; }
.warning { padding: 12px 16px; background: var(--color-warning-bg); border-left: 3px solid var(--color-warning); }
.dialog__options { margin: 8px 0; }
.dialog .small { margin-top: 12px; }
.dialog__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 24px; }

/* Larger filter targets for touch input, independently of viewport width. */
@media (pointer: coarse) {
  .chip { height: 44px; }
}

/* Compact header on tablets and small laptops; keep the sidebar until the mobile breakpoint. */

@media (min-width: 768px) and (max-width: 1199px) {
  .header { gap: 16px; }
  .search { max-width: none; min-width: 0; }
  .header__menu { display: block; flex: none; }
  .header__actions {
    position: absolute;
    top: var(--header-height);
    right: var(--gutter);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 16px;
    background: #fff;
    box-shadow: var(--shadow-float);
  }
  .header__actions.is-open { display: flex; }
  .header__actions .btn { width: 100%; }
}

/*
 * Mobile: keep this 767px boundary aligned with app.js's mobile media query.
 * Header, filters and map stack vertically; the result list becomes a fixed
 * full-screen overlay. .is-open reveals menu, filters or list in their own scope.
 */

@media (max-width: 767px) {
  :root { --gutter: 16px; }

  .login__card { padding: 24px; }

  .app {
    grid-template: auto auto minmax(0, 1fr) / minmax(0, 1fr);
    grid-template-areas: "header" "side" "map";
  }

  .header { flex-wrap: wrap; gap: 8px 12px; padding: 8px var(--gutter); }
  .header__logo { width: 120px; }
  .header__list { display: inline-flex; margin-left: auto; padding: 0 16px; }
  .header__menu { display: block; margin-right: -10px; }
  .search { order: 10; flex-basis: 100%; max-width: none; padding-left: 0; }
  .suggestions { left: 0; top: calc(100% + 4px); max-height: 60dvh; }

  .header__actions {
    position: absolute;
    top: 60px;
    right: var(--gutter);
    z-index: 30;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 16px;
    background: #fff;
    box-shadow: var(--shadow-float);
  }
  .header__actions.is-open { display: flex; }
  .header__actions .btn { width: 100%; }

  .sidebar { border-right: 0; border-bottom: 1px solid var(--color-border); }
  .filters {
    position: relative;
    padding: 8px var(--gutter);
    border-bottom: 0;
  }
  .filters__toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    background: #fff;
    text-align: left;
  }
  .filters__summary { margin-left: auto; font-size: 13px; color: var(--color-muted); }
  .filters__toggle svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
  .filters__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  /* Float choices over the map without consuming more grid height when opened. */
  .filters__options {
    display: none;
    position: absolute;
    top: 100%;
    left: var(--gutter);
    right: var(--gutter);
    z-index: 30;
    max-height: min(440px, calc(100dvh - 190px));
    overflow-y: auto;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    background: #fff;
    box-shadow: var(--shadow-float);
  }
  .filters.is-open .filters__options { display: block; }
  .filters__head { margin-bottom: 4px; }
  .filters__all button { min-height: 44px; padding: 0 8px; }
  .filters .chips { display: none; }
  .brand-choices { display: flex; flex-direction: column; }
  .brand-choice { padding: 0 4px; }
  .brand-choice__name { font-size: 12px; font-weight: 500; letter-spacing: var(--tracking-caps); }
  .brand-choice .chip__count { margin-left: auto; font-size: 13px; }
  .brand-choice .chip__dot { flex: none; }
  .crm { padding: 8px var(--gutter); }
  .crm__clear { min-height: 44px; }

  /* Take the list out of the sidebar flow; app.js toggles it via the List button. */
  .list {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    background: #fff;
  }
  .list.is-open { display: flex; }
  .list__close { display: inline-flex; }

  .notice { grid-area: auto; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
}

/* Final override: disable transitions and spinner rotation on reduced-motion systems. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .loader__spinner { animation: none; }
}
