.leaflet-control-attribution {
  background: rgba(255, 252, 243, 0.8) !important;
  color: var(--ink-soft) !important;
  font-size: 10px !important;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow);
  border-radius: var(--radius-card) !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  width: 38px !important;
  height: 38px !important;
  line-height: 38px !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  border: none !important;
  font-weight: 700;
  transition: background-color 160ms ease, color 160ms ease;
}

.leaflet-control-zoom a:hover {
  background: var(--marigold) !important;
  color: var(--ink) !important;
}

.leaflet-control-zoom-in {
  border-bottom: 1px solid var(--line) !important;
}

.leaflet-bar {
  border: none !important;
}

.leaflet-popup-content-wrapper {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.leaflet-popup-content {
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  text-align: center;
  margin: 10px 12px;
}

.leaflet-popup-tip {
  background: var(--surface);
}

.popup-photo {
  width: 100%;
  max-width: 220px;
  border-radius: 12px;
  margin-bottom: 6px;
}

.popup-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
}

.popup-rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--marigold-deep);
  font-weight: 700;
  font-size: var(--text-xs);
}

.popup-rating .material-symbols-outlined {
  font-size: 14px;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.popup-hours {
  font-size: var(--text-xs);
  color: var(--ink-soft);
}

/* directions panel (Leaflet Routing Machine) */
.leaflet-routing-container {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  border: none;
  max-width: 340px;
  z-index: 99998;
  position: fixed;
  right: 12px;
  top: 100px;
  bottom: 220px;
  max-height: calc(100vh - 340px);
  overflow-y: auto;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  transition: all 300ms ease;
  touch-action: none;
  user-select: none;
  cursor: grab;
  pointer-events: auto;
  will-change: transform;
}

.leaflet-routing-container.leaflet-routing-container-hidden {
  max-width: 44px;
  max-height: 44px;
  padding: 0;
  cursor: pointer;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  border-radius: 50%;
  z-index: 999999 !important;
  pointer-events: auto !important;
  position: fixed !important;
}

.leaflet-routing-container.leaflet-routing-container-hidden > *:not(.leaflet-routing-close):not(.routing-fab-icon) {
  display: none;
}

/* real DOM element rather than a ::before ligature — more reliable, and
   avoids fighting the header ::before grabber-bar rule below for the same
   pseudo-element */
.routing-fab-icon {
  display: none;
}

.leaflet-routing-container.leaflet-routing-container-hidden .routing-fab-icon {
  display: flex;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--paper);
  pointer-events: none;
}

.leaflet-routing-container.leaflet-routing-container-hidden:hover {
  background: var(--marigold);
}

.leaflet-routing-container.leaflet-routing-container-hidden:hover .routing-fab-icon {
  color: var(--ink);
}

/* toolbar (grabber + mode toggle + close) is a real flow element, prepended
   as the container's first child — this guarantees the header/instructions
   that follow it in the DOM are pushed down and can never be overlapped,
   unlike the previous absolute-positioned icons that overlapped route text */
.routing-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 0;
}

.leaflet-routing-container.leaflet-routing-container-hidden .routing-toolbar {
  display: none;
}

.routing-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.routing-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.routing-summary-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink);
  background: var(--paper-dim);
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.routing-summary-badge[hidden] {
  display: none;
}

.routing-cancel-btn {
  height: 34px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--rust);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  flex: none;
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
  transition: transform 140ms ease;
}

.routing-cancel-btn:hover {
  background: #9c4327;
}

.routing-cancel-btn:active {
  transform: scale(0.95);
}

.leaflet-routing-close {
  position: static;
  background: var(--paper-dim);
  color: var(--ink);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 160ms ease;
  flex: none;
  padding: 0;
}

.leaflet-routing-close .material-symbols-outlined {
  font-size: 20px;
}

.leaflet-routing-close:hover {
  background: var(--marigold);
}

.leaflet-routing-container [class*="collapse"] {
  display: none !important;
}

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

.routing-mode-toggle button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--paper-dim);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 140ms ease, color 140ms ease;
}

.routing-mode-toggle button .material-symbols-outlined {
  font-size: 20px;
}

.routing-mode-toggle button:hover:not(.active) {
  background: var(--paper);
  color: var(--ink);
}

.routing-mode-toggle button.active {
  background: var(--marigold);
  color: var(--ink);
}

.leaflet-routing-header {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  padding: 6px 16px 10px;
}

.leaflet-routing-alternatives {
  background: var(--surface);
}

.leaflet-routing-alt table {
  width: 100%;
  border-collapse: collapse;
}

.leaflet-routing-instruction {
  color: var(--ink);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.leaflet-routing-alt-minimized {
  display: none;
}

.leaflet-routing-container td {
  padding: 10px 8px;
}

.leaflet-routing-container tr {
  border-bottom: 1px solid var(--line);
}

.leaflet-routing-container tr:last-child {
  border-bottom: none;
}

.leaflet-routing-container tr:hover td {
  background: var(--paper-dim);
}

.leaflet-routing-icon {
  filter: sepia(1) saturate(3) hue-rotate(-10deg) brightness(0.9);
}
