/* === chips === */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip:hover { background: var(--brand-soft); border-color: var(--brand); }
.chip.is-selected {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}
.chip.is-selected:hover { background: var(--brand-dark); }

.chip-other-input {
  margin-top: var(--space-2);
  width: 100%;
  max-width: 360px;
}

/* === counter === */
.counter {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}
.counter__btn {
  width: 36px;
  height: 36px;
  border: 0;
  background: var(--surface);
  font-size: var(--fs-lg);
  line-height: 1;
  color: var(--text);
}
.counter__btn:hover { background: var(--brand-soft); color: var(--brand); }
.counter__btn:disabled { color: var(--text-faint); cursor: not-allowed; background: var(--surface); }
.counter__input {
  width: 64px;
  text-align: center;
  border: 0 !important;
  border-left: 1px solid var(--border) !important;
  border-right: 1px solid var(--border) !important;
  border-radius: 0 !important;
  padding: 0 !important;
  height: 36px;
}

.counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  gap: var(--space-3);
}
.counter-row__label { color: var(--text); font-size: var(--fs-sm); }

/* === range-slider === */
.range-slider {
  position: relative;
  height: 40px;
  margin: var(--space-3) 0;
}
.range-slider__track {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  left: 0; right: 0;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
}
.range-slider__fill {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  height: 4px;
  background: var(--brand);
  border-radius: 999px;
}
.range-slider input[type="range"] {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 40px;
  margin: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none; appearance: none;
}
.range-slider input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--brand);
  cursor: grab;
  box-shadow: var(--shadow-sm);
}
.range-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--brand);
  cursor: grab;
}
.range-slider__values {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-sm);
  color: var(--text-soft);
  margin-top: var(--space-2);
}
.range-slider__values strong { color: var(--brand); }

/* === modal === */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  max-width: 420px; width: 90%;
  box-shadow: var(--shadow);
}
.modal__title { margin: 0 0 var(--space-3); font-size: var(--fs-lg); font-weight: 700; }
.modal__body { margin: 0 0 var(--space-5); color: var(--text-soft); }
.modal__actions { display: flex; gap: var(--space-3); justify-content: flex-end; }

/* === toast === */
.toast {
  position: fixed;
  bottom: var(--space-5);
  left: 50%; transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1100;
  animation: toast-in 0.2s ease;
}
.toast--error { background: var(--error); }
.toast--success { background: var(--success); }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 767px) {
  .counter__btn { width: 44px; height: 44px; }
  .counter__input { height: 44px; }
}

/* === subway-picker === */
.subway-picker { display: flex; flex-direction: column; gap: var(--space-3); }
.subway-picker__search {
  position: relative;
}
.subway-picker__search input {
  width: 100%;
}
.subway-picker__suggestions {
  position: absolute;
  top: 100%; left: 0; right: 0;
  max-height: 240px; overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 10;
}
.subway-picker__suggestion {
  padding: var(--space-3);
  cursor: pointer;
  font-size: var(--fs-sm);
}
.subway-picker__suggestion:hover { background: var(--brand-soft); }
.subway-picker__suggestion .lines { color: var(--text-soft); margin-left: var(--space-2); }

.subway-picker__map-wrap {
  position: relative;
  width: 100%;
  height: 360px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
}
.subway-picker__map {
  width: 100%;
  height: 100%;
  background: var(--surface);
}
@media (max-width: 767px) { .subway-picker__map-wrap { height: 60vh; } }

.subway-picker__expand-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: white;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  box-shadow: var(--shadow-sm);
  padding: 0;
}
.subway-picker__expand-btn:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}

.subway-picker__hint {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: white;
  border: 1px solid var(--brand);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  user-select: none;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.subway-picker__hint.is-visible {
  opacity: 1;
  pointer-events: auto;
  animation: subway-picker-bounce 1.6s ease-in-out infinite;
}
.subway-picker__hint:hover {
  background: var(--brand-soft);
}
@keyframes subway-picker-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  .subway-picker__hint.is-visible { animation: none; }
}

.subway-picker__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}
.subway-picker__map-wrap.is-expanded {
  position: fixed;
  inset: 24px;
  width: auto;
  height: auto;
  z-index: 1001;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
@media (max-width: 767px) {
  .subway-picker__map-wrap.is-expanded { inset: 12px; }
}

.subway-picker__selected {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  min-height: 32px;
}
.subway-picker__pill {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  font-size: var(--fs-sm);
}
.subway-picker__pill button {
  border: 0; background: transparent; color: var(--brand);
  cursor: pointer; padding: 0; font-size: var(--fs-base); line-height: 1;
}

/* === station-marker (custom map overlay) === */
.station-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}
.station-marker:hover {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}
.station-marker.is-selected {
  transform: scale(1.1);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  z-index: 50;
}

.station-marker__inner {
  display: flex;
  flex-direction: column;
  border-radius: 3px;
  overflow: hidden;
  background: #1a1a1a;
}
.station-marker.is-selected .station-marker__inner {
  box-shadow: 0 0 0 1px var(--marker-accent);
}
.station-marker:hover .station-marker__inner {
  box-shadow: 0 0 0 1px var(--marker-accent-soft);
}
.station-marker.is-selected:hover .station-marker__inner {
  box-shadow: 0 0 0 1px var(--marker-accent);
}

.station-marker__lines {
  display: flex;
  flex-direction: column;
}
.station-marker__line {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: white;
  padding: 1px 6px;
  line-height: 14px;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.station-marker__name {
  font-size: 11px;
  font-weight: 700;
  color: white;
  background: #1a1a1a;
  padding: 1px 6px;
  line-height: 16px;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.station-marker__dot {
  display: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  border: 2px solid #555;
}
.station-marker.is-selected .station-marker__dot {
  border-color: var(--marker-accent);
  background: var(--marker-accent-bg);
}

/* Zoom: medium = name only (hide line stack) */
.station-marker.zoom-medium .station-marker__lines { display: none; }

/* Zoom: far = dot only (hide inner box) */
.station-marker.zoom-far .station-marker__inner { display: none; }
.station-marker.zoom-far .station-marker__dot { display: block; }
.station-marker.zoom-far { padding: 0; }

@media (max-width: 767px) {
  .station-marker__line { font-size: 11px; line-height: 16px; }
  .station-marker__name { font-size: 12px; line-height: 18px; }
}

/* === subway picker toolbar (clear button) === */
.subway-picker__toolbar {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-2);
}
.subway-picker__clear-btn {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-soft);
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.subway-picker__clear-btn:hover {
  color: var(--error);
  border-color: var(--error);
}

/* === chip info trigger (?) === */
.chip__info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: var(--space-2);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  cursor: help;
  transition: background 0.15s ease, color 0.15s ease;
}
.chip__info:hover,
.chip__info:focus {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  outline: none;
}
.chip.is-selected .chip__info {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
}
.chip.is-selected .chip__info:hover,
.chip.is-selected .chip__info:focus {
  background: white;
  color: var(--brand);
  border-color: white;
}

/* === info tooltip (hover popover) === */
.info-tooltip {
  position: fixed;
  z-index: 1100;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow);
  max-width: 360px;
  width: max-content;
  pointer-events: none;
}
.info-tooltip__desc {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.info-tooltip__note {
  margin: 0 0 var(--space-3);
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 500;
}
.info-tooltip__images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}
.info-tooltip__image {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}
.info-tooltip__image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  background: var(--surface);
}
.info-tooltip__image figcaption {
  font-size: 10px;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.2;
}

@media (max-width: 767px) {
  .info-tooltip { max-width: calc(100vw - 24px); }
}

/* Single-handle slider value label — right-aligned only */
.range-slider__values--single { justify-content: flex-end; }

/* Bigger building images in info-tooltip (1.5x) */
.info-tooltip { max-width: 580px; }
@media (max-width: 767px) {
  .info-tooltip { max-width: calc(100vw - 24px); }
}
