/* ============================================================================
   map.css — NEC "Digital Terroir" Map UI
   Standalone full-viewport layout. Does not inherit base.html styles.
   ============================================================================ */

/* ── CSS custom properties (earth-tone palette) ─────────────────────────── */
:root {
  --nec-green:       #5d8a3c;
  --nec-green-dark:  #3a5c27;
  --nec-green-light: #9aab8a;
  --nec-amber:       #c17f24;
  --nec-cream:       #f5f0e8;
  --nec-paper:       #ede8de;
  --nec-bark:        #6b5e4e;
  --nec-bark-light:  #a09386;
  --nec-ink:         #2a231a;
  --nec-ink-light:   #4a3f34;

  --nav-height:      44px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --scrubber-expanded-base-height: 104px;
  --scrubber-day-detail-base-height: 204px;
  --scrubber-collapsed-base-height: 40px;
  --scrubber-height: calc(var(--scrubber-expanded-base-height) + var(--safe-bottom));
  --sidebar-width:   320px;
  --sidebar-width-sm: 280px;
  --sidebar-toggle-rail-width: 30px;
  --vendor-sidebar-rail-width: var(--sidebar-toggle-rail-width);
  --vendor-sidebar-toggle-width: var(--sidebar-toggle-rail-width);
  --sidebar-collapsed-width: 0px;
  --sidebar-active-width: 0px;
  --spatial-sidebar-rail-width: var(--sidebar-toggle-rail-width);
  --spatial-sidebar-content-width: min(220px, calc(100vw - var(--sidebar-active-width) - var(--spatial-sidebar-rail-width) - 24px));
  --spatial-sidebar-width: calc(var(--spatial-sidebar-content-width) + var(--spatial-sidebar-rail-width));
  --spatial-sidebar-active-width: var(--spatial-sidebar-width);
  --vendor-details-width: 320px;
  --vendor-details-expanded-width: calc(100vw - var(--vendor-results-active-width) - var(--sidebar-active-width) - var(--spatial-sidebar-active-width));
  --vendor-details-active-width: 0px;
  --vendor-results-width: 360px;
  --vendor-results-active-width: var(--vendor-results-width);
  --sidebar-transition: 0.22s ease;
}

body.sidebar-collapsed {
  --sidebar-active-width: var(--sidebar-collapsed-width);
  --vendor-results-active-width: var(--vendor-sidebar-rail-width);
}

body.spatial-sidebar-collapsed {
  --spatial-sidebar-active-width: var(--spatial-sidebar-rail-width);
}

body.has-details-open {
  --vendor-details-active-width: var(--vendor-details-width);
}

body.has-hamlet-parcel-open {
  --vendor-details-active-width: var(--vendor-details-width);
}

body.has-hamlet-parcel-modal-open {
  overflow: hidden;
}

body.has-details-open.vendor-details-expanded {
  --vendor-details-active-width: var(--vendor-details-expanded-width);
}

body.sidebar-search-open {
  --vendor-results-active-width: var(--vendor-results-width);
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--nec-ink);
  background: var(--nec-cream);
  /* No padding-bottom override needed — this is a full-viewport app */
  overflow: hidden;
  height: 100dvh;
}

body.scrubber-collapsed {
  --scrubber-height: calc(var(--scrubber-collapsed-base-height) + var(--safe-bottom));
}

body.scrubber-day-detail-open:not(.scrubber-collapsed) {
  --scrubber-height: calc(var(--scrubber-day-detail-base-height) + var(--safe-bottom));
}

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.map-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(245, 240, 232, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(106, 94, 78, 0.15);
}

.map-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--nec-ink);
  text-decoration: none;
}
.map-nav__brand:hover { color: var(--nec-green); }

.map-nav__links {
  display: flex;
  gap: 20px;
}
.map-nav__links a {
  color: var(--nec-bark);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.map-nav__links a:hover,
.map-nav__links a.active { color: var(--nec-green-dark); }

/* ── Map shell: full viewport minus nav and scrubber ────────────────────── */
#map-shell {
  position: fixed;
  top: var(--nav-height);
  bottom: var(--scrubber-height);
  left: 0;
  right: 0;
  isolation: isolate;
}

#map-canvas {
  position: absolute;
  top: 0;
  right: calc(var(--sidebar-active-width) + var(--spatial-sidebar-active-width) + var(--vendor-details-active-width));
  bottom: 0;
  left: var(--vendor-results-active-width);
  z-index: 0;
  transition: left var(--sidebar-transition), right var(--sidebar-transition);
}

#map-canvas.map-canvas--failed {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(245, 240, 232, 0.92), rgba(245, 240, 232, 0.92)),
    repeating-linear-gradient(135deg, rgba(106, 94, 78, 0.08) 0 1px, transparent 1px 18px);
}

.map-runtime-error {
  width: min(440px, 100%);
  border: 1px solid rgba(106, 94, 78, 0.18);
  border-radius: 6px;
  background: rgba(255, 252, 247, 0.92);
  box-shadow: 0 18px 44px rgba(42, 35, 26, 0.16);
  padding: 18px;
  color: var(--nec-ink);
}

.map-runtime-error h2 {
  margin: 0 0 8px;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 24px;
  line-height: 1.1;
}

.map-runtime-error p {
  margin: 0;
  color: var(--nec-ink-light);
  font-size: 13px;
  line-height: 1.45;
}

.map-runtime-error p + p {
  margin-top: 8px;
}

.map-runtime-error__detail {
  color: var(--nec-bark);
  font-size: 11px;
}

.map-runtime-error__reload {
  margin-top: 14px;
  border: 1px solid var(--nec-green-dark);
  border-radius: 4px;
  background: var(--nec-green);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
}

.map-runtime-error__reload:hover {
  background: var(--nec-green-dark);
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
#sidebar {
  position: absolute;
  top: 0;
  left: 0;
  right: auto;
  bottom: 0;
  width: var(--vendor-results-active-width);
  background: rgba(245, 240, 232, 0.96);
  backdrop-filter: blur(8px);
  border-right: 1px solid rgba(106, 94, 78, 0.15);
  display: flex;
  flex-direction: column;
  padding-right: var(--vendor-sidebar-toggle-width);
  overflow: hidden;
  z-index: 122;
  transition:
    width var(--sidebar-transition),
    background var(--sidebar-transition),
    padding-right var(--sidebar-transition);
}

body.sidebar-collapsed #sidebar {
  padding-right: 0;
  pointer-events: auto;
}

body.sidebar-search-open #sidebar {
  top: 0;
  left: 0;
  right: auto;
  bottom: 0;
  width: var(--vendor-results-width);
  max-height: none;
  background: rgba(245, 240, 232, 0.96);
  backdrop-filter: none;
  border-right: 1px solid rgba(106, 94, 78, 0.15);
  border-left: 0;
  border-top: 0;
  border-bottom: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  pointer-events: auto;
  z-index: 140;
}

body.sidebar-collapsed #sidebar .map-search-bar,
body.sidebar-collapsed #sidebar .vendor-search-wrap,
body.sidebar-collapsed #sidebar #sidebar-list {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

body.sidebar-search-open #sidebar .map-search-bar,
body.sidebar-search-open #sidebar .vendor-search-wrap,
body.sidebar-search-open #sidebar #sidebar-list {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

body.sidebar-search-open #sidebar #sidebar-list {
  background: transparent;
}

.map-search-bar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(106, 94, 78, 0.14);
  background: transparent;
  box-shadow: none;
}

.map-search-bar:focus-within {
  background: rgba(255, 252, 247, 0.42);
}

.map-search-bar__icon {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(61, 54, 45, 0.72);
  border-radius: 999px;
}

.map-search-bar__icon::after {
  content: '';
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: rgba(61, 54, 45, 0.72);
  transform: rotate(45deg);
  transform-origin: left center;
}

.map-search-bar__input {
  min-width: 0;
}

.vendor-sidebar-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--vendor-sidebar-toggle-width);
  border: 0;
  border-left: 1px solid rgba(106, 94, 78, 0.14);
  border-radius: 0;
  background: rgba(245, 240, 232, 0.98);
  color: var(--nec-bark);
  cursor: pointer;
  box-shadow: none;
  transition: background var(--sidebar-transition), color var(--sidebar-transition);
}

.vendor-sidebar-toggle:hover,
.spatial-sidebar__toggle:hover {
  background: rgba(255, 252, 247, 0.96);
  color: var(--nec-green-dark);
}

.vendor-sidebar-toggle:focus-visible,
.spatial-sidebar__toggle:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: -4px;
}

.vendor-sidebar-toggle__icon,
.spatial-sidebar__toggle-icon {
  width: 8px;
  height: 8px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateX(1px) rotate(135deg);
  transition: transform var(--sidebar-transition);
}

body.sidebar-collapsed .vendor-sidebar-toggle {
  width: var(--vendor-sidebar-rail-width);
  border-left: 0;
  border-right: 1px solid rgba(106, 94, 78, 0.14);
  background: rgba(245, 240, 232, 0.98);
}

body.sidebar-collapsed .vendor-sidebar-toggle__icon {
  transform: translateX(-1px) rotate(-45deg);
}

.map-control-drawer {
  position: absolute;
  right: calc(var(--sidebar-active-width) + 66px);
  bottom: 16px;
  z-index: 134;
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100vw - var(--sidebar-active-width) - 92px));
  max-height: min(620px, calc(100% - 32px));
  background: rgba(245, 240, 232, 0.97);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(106, 94, 78, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(42, 35, 26, 0.18);
  overflow: hidden;
}

.map-control-drawer--layers {
  left: 8px;
  right: auto;
  top: 132px;
  bottom: auto;
  width: min(380px, calc(100vw - var(--sidebar-active-width) - 24px));
  height: auto;
  max-height: calc(100% - 148px);
  background: rgba(245, 240, 232, 0.82);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(106, 94, 78, 0.12);
  border-radius: 6px;
  box-shadow: 0 10px 26px rgba(42, 35, 26, 0.09);
  color: var(--nec-ink);
  transform-origin: top left;
  z-index: 101;
}

.map-control-drawer[hidden] {
  display: none;
}

.spatial-sidebar {
  position: absolute;
  top: 0;
  right: var(--sidebar-active-width);
  bottom: 0;
  z-index: 140;
  width: var(--spatial-sidebar-active-width);
  padding: 0;
  border-left: 1px solid rgba(106, 94, 78, 0.14);
  background: rgba(245, 240, 232, 0.96);
  box-shadow: none;
  overflow: hidden;
  transition: width var(--sidebar-transition), right var(--sidebar-transition);
}

.spatial-sidebar__toggle {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--spatial-sidebar-rail-width);
  height: auto;
  border: 0;
  border-right: 1px solid rgba(106, 94, 78, 0.14);
  border-radius: 0;
  background: rgba(245, 240, 232, 0.98);
  color: var(--nec-bark);
  cursor: pointer;
  box-shadow: none;
  transition: background var(--sidebar-transition), color var(--sidebar-transition);
}

.spatial-sidebar__toggle-icon {
  transform: translateX(2px) rotate(-45deg);
}

body.spatial-sidebar-collapsed .spatial-sidebar__toggle-icon {
  transform: translateX(-2px) rotate(135deg);
}

.spatial-sidebar__content {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  margin-left: var(--spatial-sidebar-rail-width);
  transition: opacity var(--sidebar-transition), visibility var(--sidebar-transition);
}

body.spatial-sidebar-collapsed .spatial-sidebar__content {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.map-context-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  min-height: 180px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid rgba(106, 94, 78, 0.14);
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  color: var(--nec-ink);
}

.map-context-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 8px 10px 6px;
  border-bottom: 1px solid rgba(106, 94, 78, 0.1);
}

.map-context-tab {
  min-height: 26px;
  border: 1px solid rgba(106, 94, 78, 0.2);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.44);
  color: var(--nec-bark);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.map-context-tab:hover,
.map-context-tab.is-active {
  border-color: var(--nec-green);
  background: var(--nec-green);
  color: white;
}

.map-context-tab:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
}

.map-context-panel__body {
  min-height: 0;
  overflow: hidden;
  padding: 0 10px 10px;
}

.map-context-panel .map-control-drawer {
  position: static;
  width: auto;
  height: auto;
  max-height: none;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  transform: none;
}

.map-context-panel .map-control-drawer__header {
  display: none;
}

.map-context-panel .map-control-drawer__body {
  overflow: visible;
  padding: 0;
}

.map-control-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(106, 94, 78, 0.12);
}

.map-control-drawer__eyebrow {
  margin: 0 0 2px;
  color: var(--nec-bark-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-control-drawer__title {
  margin: 0;
  color: var(--nec-ink);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.map-control-drawer__close {
  border: 1px solid rgba(106, 94, 78, 0.22);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.8);
  color: var(--nec-bark);
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
}

.map-control-drawer__close:hover {
  background: var(--nec-paper);
  color: var(--nec-ink);
}

.map-control-drawer__close:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
}

.map-control-drawer__body {
  overflow-y: auto;
  padding: 12px 14px 14px;
}

.map-control-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 0;
  border-top: 1px solid rgba(106, 94, 78, 0.1);
}

.map-control-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.map-control-section__title {
  margin: 0;
  color: var(--nec-bark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.map-control-section__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.map-control-section__summary::-webkit-details-marker {
  display: none;
}

.map-control-section__summary::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(106, 94, 78, 0.18);
  border-radius: 999px;
  background: rgba(93, 138, 60, 0.08);
  color: var(--nec-green-dark);
  font-size: 12px;
  font-weight: 700;
}

.map-control-section[open] > .map-control-section__summary::before {
  content: '-';
}

.map-control-section__summary:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
}

.map-control-section__details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
}

.sidebar-controls {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(106, 94, 78, 0.1);
  flex-shrink: 0;
  transition: opacity var(--sidebar-transition), visibility var(--sidebar-transition);
}

.sidebar-panel,
.sidebar-subpanel {
  margin-top: 10px;
  border: 1px solid rgba(106, 94, 78, 0.12);
  border-radius: 12px;
  background: rgba(255, 252, 247, 0.72);
  overflow: hidden;
}

.sidebar-panel__summary,
.sidebar-subpanel__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.sidebar-panel__summary {
  padding: 10px 12px;
}

.sidebar-subpanel__summary {
  padding: 9px 10px;
}

.sidebar-panel__summary::-webkit-details-marker,
.sidebar-subpanel__summary::-webkit-details-marker {
  display: none;
}

.sidebar-panel__summary::before,
.sidebar-subpanel__summary::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(106, 94, 78, 0.16);
  color: var(--nec-green-dark);
  background: rgba(93, 138, 60, 0.08);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-panel[open] > .sidebar-panel__summary::before,
.sidebar-subpanel[open] > .sidebar-subpanel__summary::before {
  content: '-';
}

.sidebar-panel__summary:focus-visible,
.sidebar-subpanel__summary:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: -2px;
}

.sidebar-panel__title,
.sidebar-subpanel__title {
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--nec-bark-light);
}

.sidebar-panel__body {
  padding: 0 12px 12px;
}

.sidebar-panel__body > *:first-child,
.sidebar-subpanel__body > *:first-child {
  margin-top: 0;
}

.sidebar-subpanel__body {
  padding: 0 10px 10px;
}

.sidebar-mode-note {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--nec-bark-light);
}

.mode-toggle {
  display: flex;
  gap: 4px;
}

.mode-btn {
  flex: 1;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid var(--nec-bark-light);
  border-radius: 4px;
  background: transparent;
  color: var(--nec-bark);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.mode-btn.active,
.mode-btn:hover {
  background: var(--nec-green);
  color: white;
  border-color: var(--nec-green-dark);
}
.mode-btn:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
}
.mode-btn:disabled,
.mode-btn[aria-disabled="true"] {
  cursor: not-allowed;
  color: var(--nec-bark-light);
  background: rgba(106, 94, 78, 0.04);
  border-color: rgba(106, 94, 78, 0.18);
}
.mode-btn:disabled:hover,
.mode-btn[aria-disabled="true"]:hover {
  background: rgba(106, 94, 78, 0.04);
  color: var(--nec-bark-light);
  border-color: rgba(106, 94, 78, 0.18);
}

#sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  transition: opacity var(--sidebar-transition), visibility var(--sidebar-transition);
}

.vendor-search-wrap {
  padding: 4px 12px 8px;
  transition: opacity var(--sidebar-transition), visibility var(--sidebar-transition);
}

.vendor-search-input {
  width: 100%;
  padding: 0;
  font-size: 13px;
  font-family: inherit;
  border: 0;
  background: transparent;
  color: var(--nec-ink);
  outline: none;
}

.vendor-search-input::placeholder {
  color: rgba(106, 94, 78, 0.74);
}

.sidebar-count {
  padding: 4px 12px 8px;
  font-size: 11px;
  color: var(--nec-bark-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-state-note {
  padding: 0 12px 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--nec-bark);
}

.sidebar-hint, .sidebar-empty {
  padding: 16px 12px;
  color: var(--nec-bark-light);
  font-size: 13px;
  line-height: 1.5;
}

.vendor-list { list-style: none; }

.vendor-item {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(106, 94, 78, 0.08);
  cursor: pointer;
  transition: background 0.1s, box-shadow 0.1s;
}
.vendor-item:hover { background: var(--nec-paper); }
.vendor-item:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: -2px;
}
.vendor-item.is-selected {
  background: rgba(93, 138, 60, 0.10);
  box-shadow: inset 3px 0 0 var(--nec-green);
}

.vendor-item__header {
  display: flex;
  align-items: center;
  gap: 6px;
}
.vendor-item__name {
  font-weight: 500;
  font-size: 13px;
  color: var(--nec-ink);
}
.vendor-item__meta {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  font-size: 11px;
  color: var(--nec-bark-light);
}
.vendor-item__recipe-link {
  margin-top: 3px;
}
.link-subtle {
  font-size: 11px;
  color: var(--nec-green);
  text-decoration: none;
}
.link-subtle:hover { text-decoration: underline; }
.link-subtle:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
}

/* ── Details panel ───────────────────────────────────────────────────────── */
#details-panel {
  position: fixed;
  top: var(--nav-height);
  right: calc(var(--sidebar-active-width) + var(--spatial-sidebar-active-width));
  bottom: var(--scrubber-height);
  width: var(--vendor-details-width);
  z-index: 170;
  background: var(--nec-cream);
  border-left: 1px solid rgba(106, 94, 78, 0.15);
  border-right: 1px solid rgba(106, 94, 78, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
  transition:
    right var(--sidebar-transition),
    width var(--sidebar-transition);
}
body.vendor-details-expanded #details-panel {
  width: var(--vendor-details-expanded-width);
}
#details-panel[hidden] { display: none; }

#hamlet-parcel-panel {
  position: fixed;
  top: var(--nav-height);
  right: calc(var(--sidebar-active-width) + var(--spatial-sidebar-active-width));
  bottom: var(--scrubber-height);
  width: var(--vendor-details-width);
  z-index: 168;
  background: var(--nec-cream);
  border-left: 1px solid rgba(106, 94, 78, 0.15);
  border-right: 1px solid rgba(106, 94, 78, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
  transition: right var(--sidebar-transition), width var(--sidebar-transition);
}

#hamlet-parcel-panel[hidden] { display: none; }

.hamlet-map-parcel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: auto;
}

.hamlet-map-parcel__header {
  padding-left: 30px;
  margin-bottom: 14px;
}

.hamlet-map-parcel__eyebrow {
  margin: 0 0 5px;
  color: var(--nec-amber);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hamlet-map-parcel__title {
  margin: 0;
  color: var(--nec-ink);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.06;
}

.hamlet-map-parcel__address {
  margin: 5px 0 0;
  color: var(--nec-bark-light);
  font-size: 12px;
  line-height: 1.35;
}

.hamlet-map-parcel__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 14px;
}

.hamlet-map-parcel__facts div {
  border-left: 2px solid rgba(93, 138, 60, 0.28);
  padding-left: 8px;
}

.hamlet-map-parcel__facts dt {
  color: var(--nec-bark-light);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hamlet-map-parcel__facts dd {
  margin: 2px 0 0;
  color: var(--nec-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.hamlet-map-parcel__note {
  margin: 0 0 14px;
  border: 1px solid rgba(106, 94, 78, 0.16);
  border-radius: 7px;
  background: rgba(255, 252, 247, 0.58);
  color: var(--nec-ink-light);
  font-size: 12px;
  line-height: 1.45;
  padding: 10px;
}

.hamlet-map-parcel__parcel-list {
  margin: 0 0 14px;
}

.hamlet-map-parcel__parcel-list h3 {
  margin: 0 0 7px;
  color: var(--nec-bark-light);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hamlet-map-parcel__parcel-list ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hamlet-map-parcel__parcel-list li {
  display: grid;
  gap: 2px;
  border: 1px solid rgba(106, 94, 78, 0.14);
  border-radius: 6px;
  background: rgba(255, 252, 247, 0.52);
  padding: 8px;
}

.hamlet-map-parcel__parcel-list strong {
  color: var(--nec-ink);
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.hamlet-map-parcel__parcel-list span {
  color: var(--nec-bark-light);
  font-size: 11px;
  line-height: 1.3;
}

.hamlet-map-parcel__workspace-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-top: auto;
  border: 1px solid var(--nec-green-dark);
  border-radius: 6px;
  background: var(--nec-green-dark);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  padding: 8px 10px;
}

.hamlet-map-parcel__workspace-link:hover,
.hamlet-map-parcel__workspace-link:focus-visible {
  background: var(--nec-green);
  border-color: var(--nec-green);
}

.details-close {
  position: absolute;
  top: 10px;
  left: 10px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--nec-bark);
  line-height: 1;
  padding: 4px;
}
.details-close:hover { color: var(--nec-ink); }
.details-close:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
  border-radius: 4px;
}

.details-expand {
  position: absolute;
  top: 10px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(106, 94, 78, 0.18);
  border-radius: 8px;
  padding: 0;
  background: rgba(255, 253, 247, 0.78);
  color: var(--nec-green-dark);
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(47, 42, 35, 0.05);
}
.details-expand:hover {
  border-color: rgba(93, 138, 60, 0.38);
  background: rgba(93, 138, 60, 0.08);
  color: var(--nec-green);
}
.details-expand:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
}
.details-expand__glyph {
  display: inline-block;
  line-height: 1;
}

.vendor-detail {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.vendor-detail__header {
  flex: 0 0 auto;
  margin-bottom: 12px;
  padding-left: 30px;
}
.vendor-detail__name {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--nec-ink);
  margin-bottom: 2px;
}
.vendor-detail__location {
  font-size: 12px;
  color: var(--nec-bark-light);
}
.vendor-detail__url {
  font-size: 12px;
  color: var(--nec-green);
  text-decoration: none;
  display: inline-block;
  margin-top: 2px;
}
.vendor-detail__desc {
  flex: 0 0 auto;
  font-size: 13px;
  line-height: 1.55;
  color: var(--nec-ink-light);
  margin-bottom: 12px;
}

.vendor-detail__section { margin-top: 14px; }
.vendor-detail__section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--nec-bark-light);
  margin-bottom: 6px;
}
.vendor-detail__section--collapsible {
  position: relative;
  flex: 0 0 auto;
  border: 1px solid rgba(106, 94, 78, 0.08);
  border-radius: 10px;
  background: rgba(252, 249, 242, 0.7);
  padding: 8px 10px 6px;
}

.vendor-detail__section--available[open] {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.vendor-detail__section--available[open] > .ingredient-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: max(180px, calc(100dvh - var(--nav-height) - var(--scrubber-height) - 250px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(93, 138, 60, 0.5) rgba(106, 94, 78, 0.08);
}

.vendor-detail__section--products[open] > .product-list {
  max-height: 44vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
}

body.vendor-details-expanded #details-panel .vendor-detail__section--available[open] > .ingredient-list,
body.vendor-details-expanded #details-panel .vendor-detail__section--products[open] > .product-list,
body.vendor-details-expanded #details-panel .vendor-detail__recipes[open] > .vendor-recipe-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  column-gap: 14px;
  row-gap: 2px;
}

body.vendor-details-expanded #details-panel .vendor-detail__section--available[open] > .ingredient-list,
body.vendor-details-expanded #details-panel .vendor-detail__section--products[open] > .product-list {
  max-height: max(220px, calc(100dvh - var(--nav-height) - var(--scrubber-height) - 250px));
}

body.vendor-details-expanded #details-panel .vendor-recipe-item {
  min-width: 0;
}

.vendor-detail__section-summary {
  display: flex;
  align-items: baseline;
  gap: 6px;
  list-style: none;
  cursor: pointer;
  padding-right: 36px;
  user-select: none;
}
.vendor-detail__section-summary::-webkit-details-marker {
  display: none;
}
.vendor-detail__section-summary::before {
  content: '+';
  color: var(--nec-bark-light);
  font-size: 13px;
  line-height: 1;
  width: 10px;
  flex: 0 0 10px;
}
.vendor-detail__section--collapsible[open] .vendor-detail__section-summary::before {
  content: '-';
}
.vendor-detail__section-summary-label,
.vendor-detail__section-summary-count,
.vendor-detail__section-summary-context {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.vendor-detail__section-summary-label {
  color: var(--nec-bark-light);
  font-weight: 600;
}
.vendor-detail__section-summary-count {
  color: var(--nec-bark);
}
.vendor-detail__section-summary-context {
  color: var(--nec-bark-light);
}
.vendor-detail__section-summary:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
  border-radius: 4px;
}
.available-subcat-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 3px;
  min-height: 18px;
  margin: 5px 42px 7px 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 1px;
  scrollbar-width: none;
}
.available-subcat-filters::-webkit-scrollbar {
  display: none;
}
.available-subcat-filter {
  --ingredient-accent: rgba(106, 94, 78, 0.34);
  --ingredient-accent-bg: rgba(106, 94, 78, 0.05);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  min-height: 18px;
  border: 1px solid rgba(106, 94, 78, 0.13);
  border-radius: 999px;
  padding: 1px 5px;
  background: rgba(255, 253, 247, 0.72);
  color: var(--nec-bark);
  cursor: pointer;
  font: inherit;
  font-size: 8px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.available-subcat-filter:hover,
.available-subcat-filter.is-active {
  border-color: color-mix(in srgb, var(--ingredient-accent) 52%, rgba(106, 94, 78, 0.18));
  background: var(--ingredient-accent-bg);
  color: var(--nec-ink);
}
.available-subcat-filter:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
}
.available-subcat-filter__dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 999px;
  background: var(--ingredient-accent);
}
.available-subcat-filter__count {
  color: var(--nec-bark-light);
  font-weight: 500;
}
.vendor-detail__section--collapsible .ingredient-list,
.vendor-detail__section--collapsible .product-list,
.vendor-detail__section--collapsible .vendor-recipe-list,
.vendor-detail__recipe-system-link {
  margin-top: 8px;
}

.availability-curve-actions {
  display: flex;
  justify-content: flex-end;
  position: absolute;
  top: 6px;
  right: 10px;
  margin: 0;
}

.availability-curve-actions__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(106, 94, 78, 0.18);
  border-radius: 8px;
  padding: 0;
  background: rgba(255, 253, 247, 0.78);
  color: var(--nec-green-dark);
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(47, 42, 35, 0.05);
}

.availability-curve-actions__toggle:hover {
  border-color: rgba(93, 138, 60, 0.38);
  background: rgba(93, 138, 60, 0.08);
  color: var(--nec-green);
}

.availability-curve-actions__toggle:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
}

.availability-curve-actions__glyph {
  display: inline-block;
  line-height: 1;
  filter: grayscale(1) saturate(0) contrast(1.05);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ingredient-list, .product-list { list-style: none; }
.ingredient-group-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ingredient-group {
  --ingredient-accent: rgba(106, 94, 78, 0.34);
  --ingredient-accent-bg: rgba(106, 94, 78, 0.05);
  min-width: 0;
}
.ingredient-group[hidden] {
  display: none;
}
.ingredient-group__heading {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 4px;
  color: var(--nec-bark-light);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.2;
  text-transform: uppercase;
}
.ingredient-group__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 999px;
  background: var(--ingredient-accent);
}
.ingredient-group__count {
  color: var(--nec-bark);
  font-weight: 600;
}
.ingredient-group__items {
  list-style: none;
}
.ingredient-item, .product-item {
  --ingredient-accent: rgba(106, 94, 78, 0.34);
  --ingredient-accent-bg: rgba(106, 94, 78, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 6px 0 6px 9px;
  font-size: 13px;
  border-bottom: 1px solid rgba(106, 94, 78, 0.06);
  border-left: 3px solid var(--ingredient-accent);
  background: linear-gradient(90deg, var(--ingredient-accent-bg), rgba(255, 253, 247, 0) 46%);
}
.ingredient-item[hidden],
.product-item[hidden] {
  display: none;
}
.ingredient-accent--greens {
  --ingredient-accent: #5d8a3c;
  --ingredient-accent-bg: rgba(93, 138, 60, 0.08);
}
.ingredient-accent--herbs {
  --ingredient-accent: #2f7f6b;
  --ingredient-accent-bg: rgba(47, 127, 107, 0.08);
}
.ingredient-accent--flowers {
  --ingredient-accent: #b6803d;
  --ingredient-accent-bg: rgba(182, 128, 61, 0.1);
}
.ingredient-accent--roots {
  --ingredient-accent: #a85f44;
  --ingredient-accent-bg: rgba(168, 95, 68, 0.09);
}
.ingredient-accent--fruit {
  --ingredient-accent: #9a6fbd;
  --ingredient-accent-bg: rgba(154, 111, 189, 0.08);
}
.ingredient-accent--mushrooms {
  --ingredient-accent: #8b7762;
  --ingredient-accent-bg: rgba(139, 119, 98, 0.09);
}
.ingredient-accent--dairy {
  --ingredient-accent: #6d90a8;
  --ingredient-accent-bg: rgba(109, 144, 168, 0.08);
}
.ingredient-accent--protein {
  --ingredient-accent: #9c5858;
  --ingredient-accent-bg: rgba(156, 88, 88, 0.08);
}
.ingredient-accent--grain {
  --ingredient-accent: #b8944f;
  --ingredient-accent-bg: rgba(184, 148, 79, 0.09);
}
.ingredient-item__row, .product-item__row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ingredient-item__category {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 999px;
  background: var(--ingredient-accent);
  box-shadow: 0 0 0 2px rgba(255, 253, 247, 0.82);
}
.ingredient-item__name, .product-item__name { flex: 1; }
.ingredient-item__confidence { color: var(--nec-green); }
.product-item__unit { color: var(--nec-bark-light); font-size: 11px; }
.product-item__price { color: var(--nec-ink-light); }
.product-item__certs {
  font-size: 10px;
  color: var(--nec-green);
  background: rgba(93, 138, 60, 0.08);
  padding: 1px 4px;
  border-radius: 3px;
}

.availability-curve {
  margin-top: 3px;
}

.availability-curve__summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--nec-bark-light);
  cursor: pointer;
  font-size: 9px;
  letter-spacing: 0.05em;
  line-height: 1.2;
  list-style: none;
  text-transform: uppercase;
  user-select: none;
}

.availability-curve__summary::-webkit-details-marker {
  display: none;
}

.availability-curve__summary::before {
  content: '+';
  display: inline-block;
  width: 8px;
  color: var(--nec-green);
}

.availability-curve[open] .availability-curve__summary::before {
  content: '-';
}

.availability-curve__summary:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
  border-radius: 4px;
}

.availability-curve__panel {
  margin-top: 4px;
  padding: 6px 7px 5px;
  border: 1px solid rgba(106, 94, 78, 0.08);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.68);
}

.availability-curve__chart {
  display: block;
  width: 100%;
  height: 50px;
}

.availability-curve__base {
  fill: rgba(106, 94, 78, 0.14);
}

.availability-curve__area {
  fill: rgba(93, 138, 60, 0.18);
}

.availability-curve__line {
  fill: none;
  stroke: var(--nec-green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.availability-curve__today {
  stroke: var(--nec-amber);
  stroke-width: 2;
}

.availability-curve__months {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 1px;
  color: var(--nec-bark-light);
  font-size: 9px;
}

.availability-curve__months span:last-child {
  text-align: right;
}

.availability-curve__months span:nth-child(2),
.availability-curve__months span:nth-child(3),
.availability-curve__months span:nth-child(4) {
  text-align: center;
}

.availability-curve__note {
  margin: 5px 0 0;
  color: var(--nec-bark-light);
  font-size: 10px;
  line-height: 1.35;
}

.vendor-recipe-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vendor-recipe-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid rgba(106, 94, 78, 0.1);
  border-radius: 10px;
  background: rgba(252, 249, 242, 0.9);
  padding: 10px;
}

.vendor-recipe-thumb-link {
  flex: 0 0 auto;
}

.vendor-recipe-thumb {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(106, 94, 78, 0.12);
  background: rgba(106, 94, 78, 0.06);
}

.vendor-recipe-card {
  min-width: 0;
  flex: 1 1 auto;
}

.vendor-recipe-source {
  margin: 0 0 3px;
  color: var(--nec-bark-light);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vendor-recipe-link,
.vendor-detail__recipes-link a {
  color: var(--nec-green-dark);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.45;
}

.vendor-recipe-link {
  display: inline-block;
  font-weight: 600;
}

.vendor-recipe-description {
  margin: 4px 0 0;
  color: var(--nec-ink-light);
  font-size: 11px;
  line-height: 1.5;
}

.vendor-recipe-link:hover,
.vendor-detail__recipes-link a:hover {
  text-decoration: underline;
}

.vendor-detail__recipes-link {
  margin-top: 8px;
}

/* ── Harvest sparkline (SVG bar in details panel) ────────────────────────── */
.harvest-sparkline {
  display: block;
  width: 100%;
  height: 6px;
  margin-top: 4px;
  overflow: visible;
}

/* ── Type filter buttons ─────────────────────────────────────────────────── */
.type-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.type-btn {
  padding: 3px 7px;
  font-size: 11px;
  font-family: inherit;
  border: 1px solid var(--nec-bark-light);
  border-radius: 12px;
  background: transparent;
  color: var(--nec-bark);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.type-btn.active {
  background: rgba(93, 138, 60, 0.12);
  color: var(--nec-green-dark);
  border-color: var(--nec-green-light);
}
.type-btn:hover:not(.active) { background: var(--nec-paper); }
.type-btn:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
}

.distributor-filter {
  margin-top: 10px;
}

.distributor-filter__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.distributor-filter__label {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--nec-bark-light);
}

.distributor-filter__clear {
  border: none;
  background: transparent;
  color: var(--nec-green-dark);
  cursor: pointer;
  font-size: 11px;
  padding: 0;
}

.distributor-filter__clear:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
  border-radius: 4px;
}

.distributor-filter__options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.distributor-filter__hint {
  font-size: 12px;
  line-height: 1.45;
  color: var(--nec-bark-light);
}

.distributor-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid rgba(106, 94, 78, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--nec-bark);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
}

.distributor-btn:hover {
  background: var(--nec-paper);
}

.distributor-btn.active {
  border-color: rgba(42, 35, 26, 0.2);
  background: rgba(42, 35, 26, 0.08);
  color: var(--nec-ink);
}

.distributor-btn:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
}

.distributor-btn__swatch {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: 0 0 9px;
  border: 1px solid rgba(42, 35, 26, 0.18);
}

.distributor-btn__label {
  max-width: 138px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.distributor-btn__count {
  color: var(--nec-bark-light);
  font-variant-numeric: tabular-nums;
}

.distributor-btn__swatch[data-color-index="0"] { background: #b85c38; }
.distributor-btn__swatch[data-color-index="1"] { background: #2f7f6d; }
.distributor-btn__swatch[data-color-index="2"] { background: #3f6f9f; }
.distributor-btn__swatch[data-color-index="3"] { background: #c17f24; }
.distributor-btn__swatch[data-color-index="4"] { background: #7c8f35; }
.distributor-btn__swatch[data-color-index="5"] { background: #a24d5f; }
.distributor-btn__swatch[data-color-index="6"] { background: #5f6d7a; }
.distributor-btn__swatch[data-color-index="7"] { background: #8b5e34; }

/* ── Ingredient filter (search + chips) ─────────────────────────────────── */
/* Map point inspector */
#map-point-overlay {
  position: relative;
  z-index: 1;
  flex: 0 0 268px;
  width: 100%;
  pointer-events: none;
}

#map-point-overlay .map-inspector {
  background: transparent;
  backdrop-filter: none;
  border: 0;
  border-radius: 0;
  padding: 10px 12px;
  box-shadow: none;
  pointer-events: auto;
  height: 100%;
  overflow-y: auto;
}

.map-inspector {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 220px;
  color: var(--nec-ink);
}

.map-inspector__title {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nec-bark-light);
}

.map-inspector__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.map-inspector__unpin {
  border: 1px solid rgba(106, 94, 78, 0.22);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.82);
  color: var(--nec-bark);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  line-height: 1;
  padding: 4px 8px;
}

.map-inspector__unpin:hover {
  background: var(--nec-paper);
  color: var(--nec-ink);
}

.map-inspector__unpin:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
}

.map-point-pin-marker {
  width: 24px;
  height: 24px;
  border: 2px solid var(--nec-amber);
  border-radius: 50%;
  background: rgba(255, 252, 247, 0.62);
  box-shadow:
    0 0 0 3px rgba(255, 252, 247, 0.88),
    0 0 0 7px rgba(193, 127, 36, 0.24),
    0 8px 18px rgba(42, 35, 26, 0.22);
  pointer-events: none;
}

.map-point-pin-marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nec-amber);
  transform: translate(-50%, -50%);
}

.map-inspector__coords,
.map-inspector__row,
.map-inspector__note {
  margin: 0;
}

.map-inspector__coords {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--nec-bark-light);
}

.map-inspector__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.map-inspector__label {
  color: var(--nec-bark-light);
}

.map-inspector__value {
  color: var(--nec-ink);
  font-weight: 600;
  text-align: right;
}

.map-inspector__note {
  font-size: 11px;
  line-height: 1.45;
  color: var(--nec-bark);
}

.map-inspector__metric-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.map-inspector__metric-card {
  min-width: 0;
  padding: 7px 7px 6px;
  border: 1px solid rgba(106, 94, 78, 0.12);
  border-radius: 6px;
  background: rgba(255, 252, 247, 0.48);
}

.map-inspector__metric-card[tabindex="0"] {
  cursor: help;
}

.map-inspector__metric-card:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
}

.map-inspector__metric-label {
  margin: 0 0 3px;
  color: var(--nec-bark-light);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.map-inspector__metric-value {
  margin: 0;
  color: var(--nec-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.14;
  overflow-wrap: anywhere;
}

.map-inspector__context-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.map-inspector__context-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(106, 94, 78, 0.14);
  border-radius: 6px;
  background: rgba(255, 252, 247, 0.54);
}

.map-inspector__context-heading {
  margin: 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nec-bark-light);
}

.map-inspector__context-primary {
  margin: 0;
  color: var(--nec-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.map-inspector__context-fact {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  min-width: 0;
}

.map-inspector__context-label {
  color: var(--nec-bark-light);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.map-inspector__context-value {
  color: var(--nec-ink-light);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.map-inspector__details-btn {
  width: 100%;
  border: 1px solid rgba(93, 138, 60, 0.38);
  border-radius: 4px;
  background: rgba(93, 138, 60, 0.12);
  color: var(--nec-green-dark);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 8px;
  text-align: center;
}

.map-inspector__details-btn--compact {
  margin-top: auto;
  padding: 4px 6px;
  font-size: 10px;
}

.map-inspector__details-btn:hover {
  background: rgba(93, 138, 60, 0.2);
}

.map-inspector__details-btn:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
}

.ecoregion-description-drawer {
  position: fixed;
  top: auto;
  left: calc(var(--vendor-results-active-width) + 16px);
  right: var(--ecoregion-drawer-right, calc(var(--spatial-sidebar-active-width) + var(--vendor-details-active-width) + 16px));
  bottom: calc(var(--scrubber-height) + var(--ecoregion-drawer-bottom, 16px));
  height: min(440px, calc(100dvh - var(--nav-height) - var(--scrubber-height) - 32px));
  z-index: 180;
  background: rgba(245, 240, 232, 0.86);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(106, 94, 78, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(42, 35, 26, 0.16);
  overflow: hidden;
  transition: left var(--sidebar-transition), right var(--sidebar-transition), bottom var(--sidebar-transition);
}

.ecoregion-description-drawer[hidden] {
  display: none;
}

body.has-details-open .ecoregion-description-drawer {
  right: var(--ecoregion-drawer-right, calc(var(--spatial-sidebar-active-width) + var(--vendor-details-active-width) + 16px));
}

.ecoregion-description-drawer__inner {
  max-width: 1120px;
  height: 100%;
  margin: 0 auto;
  padding: 0 22px 18px;
  overflow-y: auto;
}

.ecoregion-description-drawer__header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -22px 8px;
  padding: 12px 22px 10px;
  background: rgba(245, 240, 232, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(106, 94, 78, 0.12);
  box-shadow: 0 8px 18px rgba(245, 240, 232, 0.72);
}

.ecoregion-description-drawer__eyebrow,
.ecoregion-description-drawer__subtitle,
.ecoregion-description-drawer__note,
.ecoregion-description-drawer__section p {
  margin: 0;
}

.ecoregion-description-drawer__eyebrow {
  color: var(--nec-bark-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.ecoregion-description-drawer__title {
  margin: 3px 0 0;
  color: var(--nec-ink);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 23px;
  line-height: 1.08;
}

.ecoregion-description-drawer__subtitle {
  margin-top: 2px;
  color: var(--nec-bark);
  font-size: 11px;
}

.ecoregion-description-drawer__close {
  border: 1px solid rgba(106, 94, 78, 0.22);
  border-radius: 4px;
  background: rgba(255, 252, 247, 0.8);
  color: var(--nec-bark);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  padding: 5px 9px;
}

.ecoregion-description-drawer__close:hover {
  background: var(--nec-paper);
  color: var(--nec-ink);
}

.ecoregion-description-drawer__close:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
}

.ecoregion-description-drawer__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.ecoregion-description-drawer__fact {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  border: 1px solid rgba(106, 94, 78, 0.12);
  border-radius: 4px;
  background: rgba(255, 252, 247, 0.54);
  padding: 5px 8px;
}

.ecoregion-description-drawer__fact dt {
  color: var(--nec-bark-light);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ecoregion-description-drawer__fact dd {
  margin: 0;
  color: var(--nec-ink);
  font-size: 11px;
  font-weight: 700;
}

.ecoregion-description-drawer__section {
  border-top: 1px solid rgba(106, 94, 78, 0.12);
  padding: 12px 0;
}

.ecoregion-description-drawer__section--description {
  padding-top: 14px;
}

.ecoregion-description-drawer__section h3 {
  margin: 0 0 5px;
  color: var(--nec-green-dark);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ecoregion-description-drawer__section p,
.ecoregion-description-drawer__note {
  color: var(--nec-ink-light);
  font-size: 13px;
  line-height: 1.5;
  max-width: 88ch;
}

.ecoregion-description-drawer__section p + p {
  margin-top: 8px;
}

.ecoregion-description-drawer__lede {
  color: var(--nec-ink);
  font-size: 14px;
  line-height: 1.48;
}

.ecoregion-description-drawer__more {
  max-width: 88ch;
  margin-top: 8px;
}

.ecoregion-description-drawer__more summary {
  color: var(--nec-green-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.ecoregion-description-drawer__more summary:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
}

.ecoregion-description-drawer__more p {
  margin-top: 8px;
}

.ecoregion-description-drawer__source {
  display: inline-block;
  margin-top: 6px;
  color: var(--nec-green-dark);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.ecoregion-description-drawer__source:hover {
  text-decoration: underline;
}

#ingredient-filter {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#ingredient-filter[hidden] {
  display: none;
}

.ingredient-search-input {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid rgba(106, 94, 78, 0.3);
  border-radius: 4px;
  background: var(--nec-cream);
  color: var(--nec-ink);
  outline: none;
}
.ingredient-search-input:focus {
  border-color: var(--nec-green);
  box-shadow: 0 0 0 2px rgba(93, 138, 60, 0.15);
}

.ingredient-results {
  list-style: none;
  border: 1px solid rgba(106, 94, 78, 0.18);
  border-radius: 4px;
  background: white;
  max-height: 180px;
  overflow-y: auto;
}
.ingredient-results.is-empty { display: none; }

.ingredient-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(106, 94, 78, 0.06);
}
.ingredient-result:last-child { border-bottom: none; }
.ingredient-result:hover,
.ingredient-result:focus { background: var(--nec-paper); outline: none; }
.ingredient-result--empty {
  color: var(--nec-bark-light);
  cursor: default;
  font-style: italic;
}
.ingredient-result__name { flex: 1; color: var(--nec-ink); }
.ingredient-result__group {
  font-size: 10px;
  color: var(--nec-bark-light);
  margin-left: 6px;
}

.ingredient-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 0;
}

.ingredient-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 2px 8px;
  font-size: 11px;
  background: rgba(193, 127, 36, 0.12);
  color: var(--nec-ink-light);
  border: 1px solid rgba(193, 127, 36, 0.3);
  border-radius: 12px;
}
.ingredient-chip__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--nec-bark);
  font-size: 11px;
  padding: 0;
  line-height: 1;
}
.ingredient-chip__remove:hover { color: var(--nec-ink); }

/* ── Legend ─────────────────────────────────────────────────────────────── */
#map-legend {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  background: rgba(245, 240, 232, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(106, 94, 78, 0.12);
  border-radius: 6px;
  padding: 10px 12px;
  min-width: 140px;
}
#map-legend[hidden] { display: none; }
.legend-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--nec-bark-light);
  margin-bottom: 6px;
}
.legend-items { list-style: none; }
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--nec-ink-light);
  padding: 2px 0;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-dot--verified   { background: var(--nec-green-dark); }
.legend-dot--active     { background: var(--nec-green); }
.legend-dot--estimated  { background: var(--nec-green-light); opacity: 0.65; }
.legend-dot--ingredient { background: var(--nec-amber); }

/* ── Time scrubber ───────────────────────────────────────────────────────── */
#time-scrubber {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--scrubber-height);
  background: rgba(245, 240, 232, 0.97);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(106, 94, 78, 0.15);
  color: var(--nec-ink);
  font-family: 'EB Garamond', Georgia, serif;
  padding: 8px 16px calc(8px + var(--safe-bottom));
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scrubber-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: relative;
}

.scrubber-labels {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  font-size: 12px;
}

.scrubber-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.scrubber-season-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.scrubber-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--nec-bark);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.scrubber-filter-toggle input {
  accent-color: var(--nec-green);
}
.scrubber-filter-toggle span {
  line-height: 1.2;
}
.scrubber-active-card {
  min-width: 150px;
  color: var(--nec-ink);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  left: 50%;
  margin-left: 0;
  position: absolute;
  text-align: center;
  transform: translateX(-50%);
  padding: 0 10px;
  white-space: nowrap;
}
.scrubber-collapse {
  border: 1px solid rgba(106, 94, 78, 0.22);
  background: rgba(245, 240, 232, 0.92);
  color: var(--nec-bark);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  min-height: 28px;
  min-width: 78px;
  padding: 5px 13px 5px 9px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-content: center;
}
.scrubber-collapse:hover {
  background: var(--nec-paper);
}
.scrubber-collapse:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
}
.scrubber-collapse__chevron {
  width: 13px;
  height: 13px;
  background: url("../../recipes/favicon.3b670e850f47.svg") center center / contain no-repeat;
  border: 0;
  transform: rotate(0deg);
  transition: transform 160ms ease;
}
.scrubber-collapse.is-collapsed .scrubber-collapse__chevron {
  transform: rotate(180deg);
}
.scrubber-active-card__week {
  color: var(--nec-ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}
.scrubber-active-card__range,
.scrubber-active-card__separator {
  color: var(--nec-bark);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.scrubber-active-card__separator {
  color: rgba(106, 94, 78, 0.66);
  font-size: 14px;
}

.scrubber-track {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scrubber-btn {
  background: none;
  border: 1px solid var(--nec-bark-light);
  border-radius: 4px;
  color: var(--nec-bark);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  padding: 3px 7px;
  flex-shrink: 0;
}
.scrubber-btn:hover:not(:disabled) { background: var(--nec-paper); }
.scrubber-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.scrubber-week-timeline {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.scrubber-day-detail-toggle {
  border: 1px solid rgba(106, 94, 78, 0.22);
  background: rgba(255, 251, 243, 0.68);
  color: var(--nec-bark);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  min-height: 22px;
  padding: 4px 9px 4px 7px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
}

.scrubber-day-detail-toggle:hover {
  background: rgba(239, 232, 219, 0.95);
}

.scrubber-day-detail-toggle:focus-visible {
  outline: 2px solid var(--nec-green-dark);
  outline-offset: 2px;
}

.scrubber-day-detail-toggle__chevron {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transform: rotate(0deg);
  transition: transform 140ms ease;
}

.scrubber-day-detail-toggle.is-open .scrubber-day-detail-toggle__chevron {
  transform: rotate(180deg);
}

.scrubber-week-track {
  display: grid;
  grid-template-columns: repeat(53, minmax(0, 1fr));
  gap: 2px;
  align-items: center;
  min-height: 20px;
}

.scrubber-week-track[data-week-count="52"] {
  grid-template-columns: repeat(52, minmax(0, 1fr));
}

.scrubber-week-segment {
  justify-self: center;
  min-width: 0;
  width: clamp(14px, 68%, 22px);
  height: 12px;
  border: 1px solid rgba(106, 94, 78, 0.16);
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.68);
  color: transparent;
  cursor: pointer;
  font-size: 0;
  font-weight: 650;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, color 120ms ease, font-size 120ms ease, height 120ms ease, width 120ms ease;
}
.scrubber-week-segment:hover {
  background: rgba(239, 232, 219, 0.95);
  border-color: rgba(106, 94, 78, 0.28);
}
.scrubber-week-segment.is-active {
  width: clamp(22px, 78%, 26px);
  height: 20px;
  background: var(--nec-green);
  border-color: var(--nec-green-dark);
  color: #fff;
  font-size: 11px;
  box-shadow: inset 0 0 0 2px rgba(255, 251, 243, 0.45);
}
.scrubber-week-segment:focus-visible {
  outline: 2px solid var(--nec-green-dark);
  outline-offset: 2px;
  position: relative;
  z-index: 1;
}

.scrubber-day-detail {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
  padding: 7px 0 0 42px;
  border-top: 1px solid rgba(106, 94, 78, 0.08);
}

.scrubber-day-detail[hidden] {
  display: none;
}

.scrubber-day-detail:not(.is-open) {
  padding-top: 4px;
}

.scrubber-day-month {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.scrubber-day-month__label {
  color: var(--nec-bark-light);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  text-align: center;
}

.scrubber-day-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  color: rgba(106, 94, 78, 0.58);
  font-family: var(--nec-sans, inherit);
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.scrubber-day-detail:not(.is-open) .scrubber-day-weekdays,
.scrubber-day-detail:not(.is-open) .scrubber-day-grid {
  display: none;
}

.scrubber-day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: 15px;
  gap: 2px;
  align-items: center;
  min-height: 100px;
}

.scrubber-day-segment {
  justify-self: center;
  align-self: center;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(106, 94, 78, 0.10);
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.46);
  color: rgba(106, 94, 78, 0.66);
  cursor: pointer;
  font-size: 8px;
  font-family: var(--nec-sans, inherit);
  font-weight: 700;
  line-height: 1;
  padding: 0;
  position: relative;
  transition: background 120ms ease, box-shadow 120ms ease, color 120ms ease, font-size 120ms ease, transform 120ms ease;
}

.scrubber-day-segment:hover {
  background: rgba(239, 232, 219, 0.96);
  color: var(--nec-ink);
  transform: scale(1.08);
}

.scrubber-day-segment.is-active {
  width: 18px;
  height: 18px;
  background: var(--nec-green);
  border-color: var(--nec-green-dark);
  color: #fff;
  font-size: 9px;
  box-shadow: inset 0 0 0 2px rgba(255, 251, 243, 0.45);
  z-index: 1;
}

.scrubber-day-spacer {
  min-width: 0;
}

.scrubber-day-segment:focus-visible {
  outline: 2px solid var(--nec-green-dark);
  outline-offset: 2px;
  z-index: 2;
}

.scrubber-range-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

body.scrubber-collapsed #time-scrubber {
  padding-top: 4px;
  padding-bottom: calc(4px + var(--safe-bottom));
  gap: 0;
  cursor: pointer;
}

body.scrubber-collapsed .scrubber-body {
  display: none;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
}
.badge--verified {
  background: rgba(93, 138, 60, 0.12);
  color: var(--nec-green-dark);
}

/* ── MapLibre attribution override (keep minimal) ───────────────────────── */
.maplibregl-ctrl-attrib {
  background: transparent !important;
  box-shadow: none !important;
  color: rgba(61, 54, 45, 0.76);
  font-size: 10px !important;
  text-shadow:
    0 1px 2px rgba(255, 252, 247, 0.92),
    0 -1px 2px rgba(255, 252, 247, 0.72);
}

.maplibregl-ctrl-attrib a {
  color: rgba(55, 93, 43, 0.9);
}

.maplibregl-ctrl-attrib.maplibregl-compact {
  background: transparent !important;
}

.maplibregl-ctrl-attrib.maplibregl-compact button {
  background-color: rgba(245, 240, 232, 0.48);
  border-radius: 999px;
}

/* ── Sidebar mobile toggle (hidden on desktop) ─────────────────────────── */
.sidebar-mobile-toggle {
  display: none;
}

/* ── Mobile: sidebar becomes bottom sheet ───────────────────────────────── */
@media (max-width: 900px) {
  :root {
    --sidebar-peek: 48px;
    --sidebar-expanded: 50vh;
    --vendor-results-active-width: 0px;
  }

  body.sidebar-collapsed {
    --vendor-results-active-width: 0px;
  }

  /* Navbar: hide non-essential links */
  .map-nav__link--desktop { display: none; }
  .map-nav__links { gap: 10px; }

  /* Map shell fills above scrubber — sidebar overlays on top */
  #map-shell {
    bottom: var(--scrubber-height);
  }

  #map-canvas {
    left: 0;
  }

  .map-search-bar {
    width: 100%;
    min-width: 0;
  }

  .vendor-sidebar-toggle {
    display: none;
  }

  /* Sidebar: bottom-sheet, starts collapsed at peek height */
  #sidebar {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: var(--sidebar-peek);
    border-left: none;
    border-top: 1px solid rgba(106, 94, 78, 0.15);
    border-radius: 14px 14px 0 0;
    transition: height 0.25s ease;
  }

  #sidebar .sidebar-controls,
  #sidebar #sidebar-list {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
  }

  body.sidebar-mobile-open #sidebar {
    height: var(--sidebar-expanded);
  }

  body.sidebar-search-open #sidebar {
    left: 10px;
    right: 10px;
    bottom: calc(var(--sidebar-peek) + 58px);
    width: auto;
    height: auto;
    max-height: min(56vh, calc(100% - var(--sidebar-peek) - 74px));
    border-radius: 8px;
    border: 1px solid rgba(106, 94, 78, 0.18);
  }

  body.sidebar-mobile-open #sidebar .sidebar-controls,
  body.sidebar-search-open #sidebar .sidebar-controls,
  body.sidebar-mobile-open #sidebar .vendor-search-wrap,
  body.sidebar-search-open #sidebar .vendor-search-wrap,
  body.sidebar-mobile-open #sidebar #sidebar-list {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

  body.sidebar-search-open #sidebar #sidebar-list {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

  /* Mobile toggle handle — visible only on mobile */
  .sidebar-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--sidebar-peek);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
  }

  .sidebar-mobile-toggle__handle {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--nec-bark-light);
    opacity: 0.6;
  }

  .sidebar-mobile-toggle:active .sidebar-mobile-toggle__handle {
    opacity: 1;
  }

  /* Details panel: full-width bottom sheet overlaying sidebar */
  #details-panel {
    right: 0;
    left: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    height: 60vh;
    border-left: none;
    border-top: 1px solid rgba(106, 94, 78, 0.15);
    border-radius: 14px 14px 0 0;
    z-index: 120;
  }

  body.vendor-details-expanded #details-panel {
    width: 100%;
  }

  body.vendor-details-expanded #details-panel .vendor-detail__section--available[open] > .ingredient-list,
  body.vendor-details-expanded #details-panel .vendor-detail__section--products[open] > .product-list,
  body.vendor-details-expanded #details-panel .vendor-detail__recipes[open] > .vendor-recipe-list {
    grid-template-columns: 1fr;
  }

  #map-point-overlay {
    flex-basis: 240px;
  }

  #map-point-overlay .map-inspector {
    height: 100%;
  }

  .map-control-drawer {
    left: 10px;
    right: 10px;
    bottom: calc(var(--sidebar-peek) + 58px);
    width: auto;
    max-height: min(56vh, calc(100% - var(--sidebar-peek) - 74px));
  }

  .map-control-drawer--layers {
    left: 8px;
    right: 8px;
    top: 132px;
    bottom: auto;
    width: auto;
    height: auto;
    max-height: calc(100% - var(--sidebar-peek) - 86px);
    border-left: 1px solid rgba(106, 94, 78, 0.18);
    border-top: 1px solid rgba(106, 94, 78, 0.18);
    border-radius: 6px;
  }

  body.sidebar-mobile-open .map-control-drawer {
    bottom: calc(var(--sidebar-expanded) + 58px);
    max-height: min(42vh, calc(100% - var(--sidebar-expanded) - 74px));
  }

  .map-inspector__context-grid {
    grid-template-columns: 1fr;
  }

  .map-inspector__metric-grid {
    grid-template-columns: 1fr;
  }

  .ecoregion-description-drawer {
    left: 0;
    right: 0;
  }

  body.has-details-open .ecoregion-description-drawer {
    right: 0;
  }

  .ecoregion-description-drawer__inner {
    padding: 0 14px 18px;
  }

  .ecoregion-description-drawer__header {
    margin: 0 -14px 8px;
    padding: 10px 14px 8px;
  }

  .ecoregion-description-drawer__title {
    font-size: 20px;
  }

  .ecoregion-description-drawer__facts {
    gap: 5px;
  }

  .ecoregion-description-drawer__fact {
    padding: 5px 7px;
  }

  /* Scrubber: stack labels vertically */
  .scrubber-header {
    gap: 8px;
  }

  .scrubber-labels {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .scrubber-season-wrap,
  .scrubber-active-card {
    width: 100%;
  }

  .scrubber-active-card {
    left: auto;
    margin-left: 0;
    position: static;
    transform: none;
  }
}

.retail-subcat-filter {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.retail-subcat-filter__label {
  color: var(--nec-bark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.retail-subcat-filter__select {
  width: 100%;
  padding: 7px 9px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid rgba(106, 94, 78, 0.3);
  border-radius: 6px;
  background: var(--nec-cream);
  color: var(--nec-ink);
}

.retail-subcat-filter__select:focus {
  border-color: var(--nec-green);
  box-shadow: 0 0 0 2px rgba(93, 138, 60, 0.15);
  outline: none;
}

.retail-subcat-filter__select:disabled {
  color: var(--nec-bark-light);
  background: rgba(106, 94, 78, 0.06);
  cursor: not-allowed;
}

.retail-subcat-filter__hint {
  margin: 0;
  color: var(--nec-bark-light);
  font-size: 11px;
  line-height: 1.4;
}

.basemap-filter {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.basemap-filter__label {
  margin: 0;
  color: var(--nec-bark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.basemap-toggle {
  display: flex;
  gap: 4px;
}

.basemap-btn {
  flex: 1;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid var(--nec-bark-light);
  border-radius: 4px;
  background: transparent;
  color: var(--nec-bark);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.basemap-btn:hover,
.basemap-btn.active {
  background: var(--nec-green);
  color: white;
  border-color: var(--nec-green-dark);
}

.basemap-btn:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 2px;
}

.basemap-btn:disabled,
.basemap-btn[aria-disabled="true"] {
  cursor: not-allowed;
  color: var(--nec-bark-light);
  background: rgba(106, 94, 78, 0.04);
  border-color: rgba(106, 94, 78, 0.18);
}

.basemap-btn:disabled:hover,
.basemap-btn[aria-disabled="true"]:hover {
  background: rgba(106, 94, 78, 0.04);
  color: var(--nec-bark-light);
  border-color: rgba(106, 94, 78, 0.18);
}

.basemap-filter__hint {
  margin: 0;
  color: var(--nec-bark-light);
  font-size: 11px;
  line-height: 1.4;
}

.spatial-layer-filter {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.map-control-section.basemap-filter,
.map-control-section.spatial-layer-filter {
  margin-top: 0;
}

.map-control-drawer--layers .map-control-drawer__body {
  overflow-y: visible;
  padding: 0 12px 8px;
}

.map-control-drawer--layers .map-control-section {
  gap: 5px;
  padding: 6px 0;
}

.map-control-drawer--layers .spatial-layer-filter {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.map-control-drawer--layers .spatial-layer-filter > .map-control-section__title {
  grid-column: 1 / -1;
}

.map-control-drawer--layers .map-control-drawer__header {
  padding: 8px 12px 1px;
  border-bottom: 0;
}

.map-control-drawer--layers .map-control-drawer__eyebrow {
  display: none;
}

.map-control-drawer--layers .map-control-drawer__title {
  color: var(--nec-bark-light);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.map-control-drawer--layers .map-control-drawer__close {
  background: rgba(255, 252, 247, 0.82);
  font: inherit;
  font-size: 10px;
  line-height: 1;
  padding: 4px 8px;
}

.map-control-drawer--layers .map-control-section__title {
  color: var(--nec-bark-light);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.map-control-drawer--layers .basemap-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 4px;
}

.map-control-drawer--layers .basemap-option {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.map-control-drawer--layers .basemap-btn {
  min-height: 24px;
  padding: 4px 8px;
  border-color: rgba(106, 94, 78, 0.22);
  background: rgba(255, 252, 247, 0.44);
  color: var(--nec-ink);
  font-size: 10px;
  font-weight: 700;
  justify-content: center;
  border-radius: 999px;
  text-transform: uppercase;
}

.map-control-drawer--layers .basemap-btn.active,
.map-control-drawer--layers .basemap-btn:hover {
  border-color: var(--nec-green);
  background: var(--nec-green);
  box-shadow: none;
  color: white;
}

.map-layer-row {
  position: relative;
  display: grid;
  grid-template-columns: auto 24px minmax(0, 1fr) minmax(84px, 112px);
  align-items: center;
  gap: 5px;
  min-height: 31px;
  padding: 4px 6px;
  border: 1px solid rgba(106, 94, 78, 0.12);
  border-radius: 7px;
  background: rgba(255, 252, 247, 0.68);
}

.map-layer-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.map-layer-item + .map-layer-item {
  margin-top: 4px;
}

.map-control-drawer--layers .spatial-layer-filter .map-layer-item + .map-layer-item {
  margin-top: 0;
}

.map-layer-item > .map-layer-row {
  grid-template-columns: auto 24px minmax(0, 1fr);
  border-radius: 7px 7px 0 0;
}

.map-layer-row--basemap-child {
  grid-template-columns: auto 18px minmax(0, 1fr);
  min-height: 28px;
  border-radius: 6px;
  padding: 3px 5px;
}

.map-layer-row:hover {
  background: rgba(237, 232, 222, 0.72);
}

.map-layer-row > input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin: 0;
}

.map-layer-row__icon {
  display: block;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(106, 94, 78, 0.14);
  border-radius: 6px;
  background: rgba(237, 232, 222, 0.8);
}

.map-layer-row__icon--terrain {
  background:
    radial-gradient(circle at 70% 30%, rgba(107, 94, 78, 0.34), transparent 32%),
    linear-gradient(135deg, #d4c5ad, #8ba275);
}

.map-layer-row__icon--parcels {
  background:
    linear-gradient(135deg, transparent 0 42%, rgba(37, 79, 60, 0.62) 43% 47%, transparent 48%),
    linear-gradient(45deg, rgba(111, 145, 111, 0.92) 0 52%, rgba(222, 207, 164, 0.9) 52% 100%);
}

.map-layer-row__icon--zones {
  background:
    linear-gradient(90deg, #79b8df 0 25%, #83cb9f 25% 50%, #d9df6e 50% 75%, #f5a957 75% 100%);
}

.map-layer-row__icon--ecoregions {
  background:
    linear-gradient(135deg, transparent 0 45%, rgba(61, 54, 45, 0.35) 45% 48%, transparent 48%),
    linear-gradient(45deg, #8fbf9f 0 33%, #d2b978 33% 66%, #9db8ce 66% 100%);
}

.map-layer-row__icon--soils {
  background:
    radial-gradient(circle at 30% 34%, #6aa36f 0 20%, transparent 21%),
    radial-gradient(circle at 72% 62%, #bd7a58 0 22%, transparent 23%),
    linear-gradient(135deg, #d6b15f, #78b89a);
}

.map-layer-row__icon--contours {
  background:
    repeating-radial-gradient(ellipse at center, transparent 0 5px, rgba(78, 66, 54, 0.56) 6px 7px),
    #f5f0e8;
}

.hamlet-parcel-browse-trigger {
  min-height: 26px;
  border: 1px solid rgba(61, 102, 49, 0.24);
  border-top: 0;
  border-radius: 0 0 7px 7px;
  background: rgba(255, 252, 247, 0.58);
  color: var(--nec-green-dark);
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.hamlet-parcel-browse-trigger:hover,
.hamlet-parcel-browse-trigger:focus-visible {
  background: rgba(93, 138, 60, 0.12);
  border-color: rgba(61, 102, 49, 0.42);
}

.hamlet-parcel-modal {
  position: fixed;
  top: var(--nav-height);
  right: calc(var(--sidebar-active-width) + var(--spatial-sidebar-active-width) + var(--vendor-details-active-width));
  bottom: var(--scrubber-height);
  left: var(--vendor-results-active-width);
  z-index: 310;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
}

.hamlet-parcel-modal[hidden] {
  display: none;
}

.hamlet-parcel-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(33, 31, 27, 0.38);
}

.hamlet-parcel-modal__surface {
  position: relative;
  display: flex;
  width: min(860px, calc(100vw - 36px));
  max-height: min(720px, calc(100dvh - 36px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(106, 94, 78, 0.2);
  border-radius: 8px;
  background: var(--nec-cream);
  box-shadow: 0 20px 70px rgba(33, 31, 27, 0.28);
}

.hamlet-parcel-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(106, 94, 78, 0.12);
  padding: 18px 20px 14px;
}

.hamlet-parcel-modal__eyebrow {
  margin: 0 0 5px;
  color: var(--nec-amber);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hamlet-parcel-modal__title {
  margin: 0;
  color: var(--nec-ink);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
}

.hamlet-parcel-modal__description {
  margin: 6px 0 0;
  color: var(--nec-bark-light);
  font-size: 13px;
}

.hamlet-parcel-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid rgba(106, 94, 78, 0.16);
  border-radius: 7px;
  background: rgba(255, 252, 247, 0.7);
  color: var(--nec-bark);
  cursor: pointer;
  font-family: inherit;
  font-size: 22px;
  line-height: 1;
}

.hamlet-parcel-modal__close:hover,
.hamlet-parcel-modal__close:focus-visible {
  border-color: rgba(61, 102, 49, 0.34);
  color: var(--nec-green-dark);
}

.hamlet-parcel-browser {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 16px 20px 20px;
}

.hamlet-parcel-browser__toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(130px, 0.7fr) minmax(130px, 0.7fr);
  gap: 10px;
  align-items: end;
}

.hamlet-parcel-browser__actions {
  display: flex;
  gap: 8px;
}

.hamlet-parcel-browser__button {
  min-height: 28px;
  border: 1px solid rgba(61, 102, 49, 0.28);
  border-radius: 6px;
  background: rgba(93, 138, 60, 0.1);
  color: var(--nec-green-dark);
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.hamlet-parcel-browser__button--secondary {
  background: rgba(255, 252, 247, 0.6);
  color: var(--nec-bark);
}

.hamlet-parcel-browser__button:hover,
.hamlet-parcel-browser__button:focus-visible {
  border-color: var(--nec-green);
  background: rgba(93, 138, 60, 0.18);
}

.hamlet-parcel-browser__button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.hamlet-parcel-browser__search {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--nec-bark-light);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hamlet-parcel-browser__filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--nec-bark-light);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hamlet-parcel-browser__search input,
.hamlet-parcel-browser__filter select {
  width: 100%;
  min-height: 28px;
  border: 1px solid rgba(106, 94, 78, 0.18);
  border-radius: 6px;
  background: rgba(255, 252, 247, 0.72);
  color: var(--nec-ink);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0;
  padding: 5px 7px;
  text-transform: none;
}

.hamlet-parcel-browser__count {
  margin: -2px 0 0;
  color: var(--nec-bark-light);
  font-size: 11px;
  font-weight: 700;
}

.hamlet-parcel-browser__list {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(93, 138, 60, 0.5) rgba(106, 94, 78, 0.08);
}

.hamlet-parcel-browser__item {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 2px;
  border: 1px solid rgba(106, 94, 78, 0.14);
  border-radius: 6px;
  background: rgba(255, 252, 247, 0.62);
  color: var(--nec-ink);
  cursor: pointer;
  font-family: inherit;
  padding: 7px 8px;
  text-align: left;
}

.hamlet-parcel-browser__item:hover,
.hamlet-parcel-browser__item:focus-visible,
.hamlet-parcel-browser__item.is-selected {
  border-color: rgba(193, 127, 36, 0.72);
  background: rgba(193, 127, 36, 0.1);
}

.hamlet-parcel-browser__item-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.hamlet-parcel-browser__item-meta,
.hamlet-parcel-browser__item-id {
  color: var(--nec-bark-light);
  font-size: 11px;
  line-height: 1.25;
}

.hamlet-parcel-browser__item-id {
  font-weight: 700;
}

.hamlet-parcel-browser__empty {
  margin: 0;
  border: 1px solid rgba(106, 94, 78, 0.12);
  border-radius: 6px;
  background: rgba(255, 252, 247, 0.5);
  color: var(--nec-bark-light);
  font-size: 11px;
  line-height: 1.35;
  padding: 8px;
}

@media (max-width: 760px) {
  .hamlet-parcel-modal {
    inset: var(--nav-height) 0 var(--scrubber-height);
    align-items: stretch;
    padding: 10px;
  }

  .hamlet-parcel-modal__surface {
    width: 100%;
    max-height: calc(100dvh - 20px);
  }

  .hamlet-parcel-browser__toolbar {
    grid-template-columns: 1fr;
  }
}

.map-layer-row__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.map-layer-row__title {
  color: var(--nec-ink);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.map-layer-row__meta {
  display: none;
}

.map-layer-row__tools {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
}

.map-layer-row__select {
  width: 100%;
  min-width: 0;
}

.map-layer-row__opacity {
  display: grid;
  grid-template-columns: 28px minmax(54px, 1fr);
  align-items: center;
  gap: 5px;
  width: 100%;
  color: var(--nec-bark-light);
  font-size: 9px;
  font-weight: 800;
}

.map-layer-row__opacity .spatial-layer-filter__range-input {
  width: 100%;
  min-width: 0;
}

.map-layer-row.is-disabled {
  opacity: 0.58;
}

.map-layer-options {
  margin-top: -1px;
  border: 1px solid rgba(106, 94, 78, 0.12);
  border-top: 0;
  border-radius: 0 0 7px 7px;
  background: rgba(255, 252, 247, 0.42);
}

.map-layer-options__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 18px;
  padding: 2px 7px 3px 36px;
  color: var(--nec-bark-light);
  cursor: pointer;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  list-style: none;
  text-transform: uppercase;
}

.map-layer-options__summary::-webkit-details-marker {
  display: none;
}

.map-layer-options__summary::after {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(106, 94, 78, 0.18);
  border-radius: 999px;
  background: rgba(93, 138, 60, 0.08);
  color: var(--nec-green-dark);
  font-size: 10px;
  line-height: 1;
}

.map-layer-options[open] > .map-layer-options__summary::after {
  content: '-';
}

.map-layer-options__summary:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: -2px;
}

.map-layer-options__body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 2px 7px 7px 36px;
}

.map-control-drawer--layers .spatial-layer-filter__select,
.map-control-drawer--layers .spatial-layer-filter__range,
.map-control-drawer--layers .spatial-layer-filter__range-input,
.map-control-drawer--layers .soil-theme-legend,
.map-control-drawer--layers .spatial-layer-filter__hint {
  margin-left: 0;
}

.map-layer-advanced {
  border-top: 1px solid rgba(106, 94, 78, 0.12);
  padding-top: 5px;
}

.map-layer-advanced__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
  color: var(--nec-green-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.map-layer-advanced__summary::-webkit-details-marker {
  display: none;
}

.map-layer-advanced__summary::after {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(106, 94, 78, 0.18);
  border-radius: 999px;
  background: rgba(93, 138, 60, 0.08);
}

.map-layer-advanced[open] > .map-layer-advanced__summary::after {
  content: '-';
}

.map-layer-advanced__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 7px;
}

.map-control-drawer--layers .spatial-layer-filter__select {
  padding: 5px 7px;
  font-size: 11px;
}

.map-control-drawer--layers .spatial-layer-filter__range {
  font-size: 10px;
}

.map-control-drawer--layers .spatial-layer-filter__hint {
  font-size: 10px;
}

.map-control-drawer--layers .soil-theme-legend {
  padding: 5px;
}

.spatial-layer-filter__label {
  color: var(--nec-bark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.spatial-layer-filter__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--nec-bark);
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
}

.map-control-drawer--layers .spatial-layer-filter__toggle.map-layer-row {
  display: grid;
}

.spatial-layer-filter__toggle input {
  accent-color: var(--nec-green);
}

.spatial-layer-filter__toggle.is-disabled {
  color: var(--nec-bark-light);
  cursor: not-allowed;
}

.spatial-layer-filter__select {
  width: 100%;
  padding: 7px 9px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid rgba(106, 94, 78, 0.3);
  border-radius: 6px;
  background: var(--nec-cream);
  color: var(--nec-ink);
}

.spatial-layer-filter__select:focus {
  border-color: var(--nec-green);
  box-shadow: 0 0 0 2px rgba(93, 138, 60, 0.15);
  outline: none;
}

.spatial-layer-filter__select:disabled {
  color: var(--nec-bark-light);
  background: rgba(106, 94, 78, 0.06);
  cursor: not-allowed;
}

.spatial-layer-filter__range {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  color: var(--nec-bark);
  font-size: 12px;
  line-height: 1.3;
}

.spatial-layer-filter__range-input {
  width: 100%;
  accent-color: var(--nec-green);
}

.spatial-layer-filter__range-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.spatial-layer-filter__range-input:focus-visible {
  outline: 2px solid var(--nec-green);
  outline-offset: 3px;
}

.spatial-layer-filter__hint {
  margin: 0;
  color: var(--nec-bark-light);
  font-size: 11px;
  line-height: 1.4;
}

.spatial-layer-filter__hint--status {
  color: var(--nec-bark);
}

.soil-theme-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px 7px;
  border: 1px solid rgba(106, 94, 78, 0.16);
  border-radius: 6px;
  background: rgba(255, 252, 246, 0.58);
}

.soil-theme-legend.is-disabled {
  opacity: 0.48;
}

.soil-theme-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--nec-ink-light);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.soil-theme-legend__swatch {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 1px solid rgba(61, 54, 45, 0.22);
  border-radius: 2px;
  background: #b8b1a4;
}

.soil-theme-legend__swatch--prime { background: #6aa36f; }
.soil-theme-legend__swatch--statewide { background: #8fbd6f; }
.soil-theme-legend__swatch--limited { background: #d6b15f; }
.soil-theme-legend__swatch--low { background: #bd7a58; }
.soil-theme-legend__swatch--high-water { background: #4f9bb8; }
.soil-theme-legend__swatch--moderate-water { background: #78b89a; }
.soil-theme-legend__swatch--low-water { background: #c59c62; }
.soil-theme-legend__swatch--hydric { background: #5f91c4; }
.soil-theme-legend__swatch--flood-prone { background: #6aa7bf; }
.soil-theme-legend__swatch--wetness { background: #7db7a4; }
.soil-theme-legend__swatch--well-drained { background: #a7bd72; }
.soil-theme-legend__swatch--earthworks-concern { background: #b87f62; }
.soil-theme-legend__swatch--earthworks-moderate { background: #c5a968; }
.soil-theme-legend__swatch--earthworks-lower { background: #8fae79; }
.soil-theme-legend__swatch--ecological-site { background: #7e9f7a; }
.soil-theme-legend__swatch--inferred-ecology { background: #9aa86f; }
.soil-theme-legend__swatch--unknown { background: #b8b1a4; }

@media (max-width: 640px) {
  .map-layer-row {
    grid-template-columns: auto 22px minmax(0, 1fr);
  }

  .map-layer-row__tools {
    grid-column: 3 / -1;
    justify-content: stretch;
  }

  .map-layer-row__opacity {
    grid-template-columns: 30px minmax(74px, 1fr);
  }
}

.map-context-panel .map-control-drawer {
  position: static;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  width: auto;
  height: auto;
  max-height: none;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  transform: none;
}

/* Fragment error banner */
.fragment-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 4px 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #7c2d12;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 4px;
}
.fragment-error__retry {
  flex-shrink: 0;
  padding: 2px 10px;
  font-size: 11px;
  font-family: inherit;
  color: var(--nec-ink);
  background: var(--nec-cream);
  border: 1px solid rgba(106, 94, 78, 0.3);
  border-radius: 3px;
  cursor: pointer;
}
.fragment-error__retry:hover {
  background: #f0ebe3;
}
