/**
 * استایل صفحه جستجوی نقشه — چیدمان شبیه نشان (سایدبار + نقشه تمام‌ارتفاع).
 *
 * @package JobsDirectoryModern
 */

.jdm-map-search-page .site-footer,
.jdm-map-search-page .jdm-site-footer,
.jdm-map-search-page .site-nav {
  display: none !important;
}

.jdm-map-search-page,
.jdm-map-search-page #site-content {
  padding: 0;
  margin: 0;
  max-width: none;
  height: 100%;
}

html:has(body.jdm-map-search-page),
body.jdm-map-search-page {
  height: 100%;
  overflow: hidden;
}

/**
 * نقشه تمام‌صفحه؛ سایدبار شناور با فاصله ۵۰px از راست/بالا/پایین.
 */
.jdm-mapapp {
  --jdm-map-sidebar: min(400px, calc(100% - 100px));
  --jdm-map-float-gap: 20px;
  position: relative;
  display: block;
  width: 100%;
  height: 100dvh;
  min-height: 420px;
  background: var(--color-jdm-bg, #ecfdf5);
  overflow: hidden;
}

.jdm-mapapp__sidebar {
  position: absolute;
  top: var(--jdm-map-float-gap);
  bottom: var(--jdm-map-float-gap);
  inset-inline-start: var(--jdm-map-float-gap);
  width: var(--jdm-map-sidebar);
  max-width: calc(100% - (var(--jdm-map-float-gap) * 2));
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow: hidden;
  background: #e9edf7;
  border: 1px solid #d8deeb;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  z-index: 5;
}

/* نوار آیکون (همبرگر / لوگو / ثبت آگهی) بالای جستجو */
.jdm-mapapp__toolbar {
  display: grid;
  grid-template-columns: 2.5rem 1fr 2.5rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem 0.35rem;
}

.jdm-mapapp__tool-btn,
.jdm-mapapp__tool-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #0f172a;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: background 0.15s ease, color 0.15s ease;
}

.jdm-mapapp__tool-btn:hover,
.jdm-mapapp__tool-brand:hover {
  background: #fff;
  color: #059669;
}

.jdm-mapapp__tool-btn:focus-visible,
.jdm-mapapp__tool-brand:focus-visible {
  outline: 2px solid #059669;
  outline-offset: 2px;
}

.jdm-mapapp__tool-brand {
  justify-self: center;
  width: auto;
  min-width: 2.5rem;
  padding-inline: 0.35rem;
  background: transparent;
  box-shadow: none;
}

.jdm-mapapp__tool-logo {
  display: block;
  width: auto;
  height: 52px;
  max-width: 160px;
  object-fit: contain;
}

.jdm-mapapp__tool-icon {
  display: inline-flex;
  line-height: 0;
}

.jdm-mapapp__tool-icon svg {
  display: block;
}

.jdm-mapapp__tool-cta {
  background: var(--color-jdm-primary, #059669);
  color: #fff;
}

.jdm-mapapp__tool-cta:hover {
  background: #047857;
  color: #fff;
}

.jdm-mapapp__tool-spacer {
  width: 2.5rem;
  height: 2.5rem;
}

/* سرچ + متا ثابت؛ فقط لیست اسکرول می‌خورد */
.jdm-mapapp__head {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 3;
  background: #e9edf7;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.jdm-mapapp__search {
  padding: 0.875rem 1rem 0.5rem;
}

.jdm-mapapp__search-label {
  position: relative;
  display: flex;
  align-items: center;
}

.jdm-mapapp__search-icon {
  position: absolute;
  inset-inline-start: 0.75rem;
  display: inline-flex;
  color: var(--color-jdm-muted-text, #047857);
  pointer-events: none;
}

.jdm-mapapp__input {
  width: 100%;
  border: 1px solid var(--color-jdm-border, #e2e8f0);
  border-radius: 14px;
  background: var(--color-jdm-soft, #f0fdf4);
  color: var(--color-jdm-fg, #064e3b);
  font: inherit;
  font-size: 0.9375rem;
  padding-block: 0.75rem;
  padding-inline-start: 2.5rem;
  padding-inline-end: 6.75rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.jdm-mapapp__input:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.3);
  background: #fff;
}

/* تعداد نتایج داخل باکس جستجو */
.jdm-mapapp__count {
  position: absolute;
  inset-inline-end: 2.35rem;
  max-width: 42%;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in oklab, var(--color-jdm-primary, #059669) 12%, #fff);
  color: var(--color-jdm-primary, #059669);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.jdm-mapapp__clear {
  position: absolute;
  inset-inline-end: 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-jdm-muted-text, #047857);
  cursor: pointer;
}

.jdm-mapapp__clear:hover {
  background: var(--color-jdm-soft, #f0fdf4);
}

.jdm-mapapp__search-label:not(.has-value) .jdm-mapapp__count,
.jdm-mapapp__search-label:has(.jdm-mapapp__clear[hidden]) .jdm-mapapp__count {
  inset-inline-end: 0.65rem;
}

.jdm-mapapp__search-label:not(.has-value) .jdm-mapapp__input,
.jdm-mapapp__search-label:has(.jdm-mapapp__clear[hidden]) .jdm-mapapp__input {
  padding-inline-end: 5.5rem;
}

/* نوار اسلایدی دسته‌ها — بدون باکس، با آیکون و جداکننده | */
.jdm-mapapp__cats {
  padding: 0 0 0.55rem;
  border-bottom: 1px solid #d8deeb;
}

.jdm-mapapp__cats-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  padding: 0 1rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.jdm-mapapp__cats-track.is-dragscroll {
  cursor: grab;
  touch-action: pan-x;
  user-select: none;
}

.jdm-mapapp__cats-track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.jdm-mapapp__cats-track::-webkit-scrollbar {
  height: 3px;
}

.jdm-mapapp__cats-track::-webkit-scrollbar-thumb {
  background: #c4c4c4;
  border-radius: 999px;
}

.jdm-mapapp__cat {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.35rem;
  scroll-snap-align: start;
  margin: 0;
  padding: 0.35rem 0.7rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--color-jdm-fg, #064e3b);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.jdm-mapapp__cat + .jdm-mapapp__cat {
  padding-inline-start: 1.15rem;
}

.jdm-mapapp__cat + .jdm-mapapp__cat::before {
  content: '|';
  position: absolute;
  inset-inline-start: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-weight: 400;
  font-size: 0.85rem;
  line-height: 1;
  pointer-events: none;
}

.jdm-mapapp__cat-icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--color-jdm-muted-text, #047857);
}

.jdm-mapapp__cat-icon svg {
  display: block;
}

.jdm-mapapp__cat-label {
  display: inline;
}

.jdm-mapapp__cat:hover {
  color: var(--color-jdm-primary, #059669);
  background: transparent;
}

.jdm-mapapp__cat:hover .jdm-mapapp__cat-icon {
  color: var(--color-jdm-primary, #059669);
}

.jdm-mapapp__cat:focus-visible {
  outline: 2px solid var(--color-jdm-primary, #059669);
  outline-offset: 2px;
  border-radius: 4px;
}

.jdm-mapapp__cat.is-active {
  background: transparent;
  border: 0;
  color: var(--color-jdm-primary, #059669);
}

.jdm-mapapp__cat.is-active .jdm-mapapp__cat-icon {
  color: var(--color-jdm-primary, #059669);
}

@media (prefers-reduced-motion: reduce) {
  .jdm-mapapp__cat {
    transition: none;
  }
}

.jdm-mapapp__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem 1rem;
  background: #e9edf7;
}

.jdm-mapapp__list.is-dragscroll {
  cursor: grab;
  touch-action: pan-y;
}

.jdm-mapapp__list.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.jdm-mapapp__list.is-dragging .jdm-mapapp__item {
  pointer-events: none;
}

.jdm-mapapp__item {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  grid-template-rows: auto auto;
  gap: 0.35rem 0.75rem;
  width: 100%;
  text-align: start;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 0.625rem;
  color: inherit;
  font: inherit;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.jdm-mapapp__item:hover,
.jdm-mapapp__item.is-active {
  background: #fff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.jdm-mapapp__item-main {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  grid-column: 1 / -1;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.jdm-mapapp__item-main:focus-visible {
  outline: 2px solid var(--color-jdm-primary, #059669);
  outline-offset: 2px;
  border-radius: 10px;
}

.jdm-mapapp__item:focus-visible {
  outline: 2px solid var(--color-jdm-primary, #059669);
  outline-offset: 2px;
}

.jdm-mapapp__thumb {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, #d1fae5, #a7f3d0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-jdm-primary, #059669);
}

.jdm-mapapp__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.jdm-mapapp__thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--color-jdm-primary, #059669);
  opacity: 0.9;
}

.jdm-mapapp__thumb-ph svg {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}

.jdm-mapapp__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.jdm-mapapp__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-jdm-fg, #064e3b);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.jdm-mapapp__tagline {
  font-size: 0.75rem;
  color: var(--color-jdm-muted-text, #047857);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jdm-mapapp__address {
  font-size: 0.75rem;
  color: #64748b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.jdm-mapapp__rating {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-jdm-accent, #d97706);
}

.jdm-mapapp__foot {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
  margin-top: 0.1rem;
}

.jdm-mapapp__stats {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: var(--color-jdm-muted-text, #047857);
  font-size: 0.75rem;
  font-weight: 600;
}

.jdm-mapapp__stat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.jdm-mapapp__stat svg {
  flex-shrink: 0;
  color: var(--color-jdm-accent, #d97706);
}

.jdm-mapapp__contact {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.3rem;
  margin-inline-start: auto;
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--color-jdm-border, #e2e8f0);
  background: #fff;
  color: var(--color-jdm-primary, #059669);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.jdm-mapapp__contact:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.jdm-mapapp__contact:focus-visible {
  outline: 2px solid var(--color-jdm-primary, #059669);
  outline-offset: 2px;
}

.jdm-mapapp__contact svg {
  flex-shrink: 0;
}

.jdm-mapapp__empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--color-jdm-muted-text, #047857);
  font-size: 0.875rem;
}

.jdm-mapapp__map-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  min-width: 0;
  background: #d1fae5;
}

.jdm-mapapp__map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.jdm-mapapp__search-area {
  position: absolute;
  top: 0.875rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-jdm-primary, #059669);
  box-shadow: 0 8px 24px rgba(6, 78, 59, 0.22);
  transition: transform 0.15s ease, background 0.15s ease;
}

.jdm-mapapp__search-area:hover {
  background: var(--color-jdm-secondary, #10b981);
  transform: translateX(-50%) translateY(-1px);
}

.jdm-mapapp__search-area[hidden] {
  display: none !important;
}

.jdm-mapapp__mobile-tabs {
  display: none;
}

/* پین لوکیشن روی نقشه */
.jdm-map-pin-wrap {
  background: transparent !important;
  border: 0 !important;
}

.jdm-map-pin {
  display: block;
  width: 32px;
  height: 48px;
  line-height: 0;
  filter: drop-shadow(0 3px 6px rgba(6, 78, 59, 0.35));
  transition: transform 0.18s ease;
  transform-origin: 50% 100%;
  cursor: pointer;
}

.jdm-map-pin__svg {
  display: block;
  overflow: visible;
}

.jdm-map-pin__body {
  fill: var(--color-jdm-primary, #059669);
  stroke: #fff;
  stroke-width: 1.25;
}

.jdm-map-pin__dot {
  fill: #fff;
}

.jdm-map-pin__shadow {
  fill: rgba(6, 78, 59, 0.28);
}

.jdm-map-pin.is-active {
  transform: scale(1.18);
  filter: drop-shadow(0 4px 10px rgba(217, 119, 6, 0.45));
  z-index: 2;
}

.jdm-map-pin.is-active .jdm-map-pin__body {
  fill: var(--color-jdm-accent, #d97706);
}

.jdm-map-popup {
  min-width: 160px;
  max-width: 220px;
  font-family: inherit;
}

.jdm-map-popup__title {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #064e3b;
}

.jdm-map-popup__link {
  font-size: 0.75rem;
  font-weight: 600;
  color: #059669;
  text-decoration: none;
}

.jdm-map-popup__link:hover {
  text-decoration: underline;
}

/* کارت غنی کنار مارکر */
.leaflet-popup.jdm-leaflet-popup {
  /* فضای کافی برای کارت + ستون نظرات */
  margin-bottom: 12px;
}

.leaflet-popup.jdm-leaflet-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 16px;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

/* محدود کردن ارتفاع کل پاپ‌آپ به ارتفاع نقشه تا از بالا بیرون نزند */
.leaflet-popup.jdm-leaflet-popup .leaflet-popup-content {
  margin: 0;
  width: auto !important;
  overflow: visible;
}

.leaflet-popup.jdm-leaflet-popup .leaflet-popup-tip {
  background: #fff;
  box-shadow: 0 2px 8px rgba(6, 78, 59, 0.12);
}

.jdm-map-card {
  position: relative;
  width: max-content;
  max-width: min(620px, 94vw);
  font-family: inherit;
}

/* ستون اصلی کارت کسب‌وکار */
.jdm-map-card:not(.has-tips) {
  width: 240px;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.jdm-map-card__detail {
  box-sizing: border-box;
  width: 240px;
  height: 260px;
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(6, 78, 59, 0.2);
  overflow: hidden;
}

.jdm-map-card.has-tips {
  display: flex;
  flex-direction: row;
  /* از بالا تراز شود تا ستون نظرات به سمت پایین رشد کند، نه زیر هدر */
  align-items: flex-start;
  gap: 0.65rem;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.jdm-map-card.has-tips .jdm-map-card__detail {
  align-self: flex-start;
}

.jdm-map-card.has-tips .jdm-map-card__tips {
  flex: 0 0 296px;
  align-self: flex-start;
}

.jdm-map-card__banner {
  display: block;
  flex: 0 0 110px;
  width: 100%;
  height: 110px;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
}

.jdm-map-card__banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.jdm-map-card__banner--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #d1fae5, #a7f3d0);
}

.jdm-map-card__banner-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--color-jdm-primary, #059669);
  opacity: 0.9;
}

.jdm-map-card__banner-ph svg {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
}

.jdm-map-card__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.75rem 0.875rem 0.875rem;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.jdm-map-card__title {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #064e3b;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.jdm-map-card__stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: #047857;
}

.jdm-map-card__count {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--color-jdm-accent, #d97706);
}

.jdm-map-card__link {
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 700;
  color: #059669;
  text-decoration: none;
}

.jdm-map-card__link:hover {
  text-decoration: underline;
}

/* ستون نظرات — دو باکس زیر هم؛ ارتفاع مطابق متن کامل، بدون اسکرول */
.jdm-map-card__tips {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 296px;
  max-height: none;
  overflow: visible;
  padding-bottom: 2px;
}

.jdm-map-card__tip {
  box-sizing: border-box;
  width: 296px;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.75rem 0.7rem 0.8rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--color-jdm-border, #e2e8f0);
  box-shadow: 0 10px 28px rgba(6, 78, 59, 0.14);
  overflow: visible;
  animation: jdm-tip-in 0.35s ease both;
}

.jdm-map-card__tip--2 {
  animation-delay: 0.1s;
}

.jdm-map-card__tip-avatar {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.4rem;
  background: linear-gradient(145deg, #059669, #10b981);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
  border: 2px solid #fff;
}

.jdm-map-card__tip-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.jdm-map-card__tip-avatar-fallback {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.jdm-map-card__tip-body {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  overflow: visible;
}

/* نام بالای ستاره — فشرده نمی‌شود */
.jdm-map-card__tip-head {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  width: 100%;
  margin-bottom: 0.35rem;
}

.jdm-map-card__tip-name {
  display: block;
  width: 100%;
  margin: 0;
  font-weight: 700;
  color: #064e3b;
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.jdm-map-card__tip-stars {
  display: block;
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--color-jdm-accent, #d97706);
  line-height: 1.2;
  flex: 0 0 auto;
}

.jdm-map-card__tip-text {
  margin: 0;
  flex: 0 0 auto;
  width: 100%;
  max-height: none;
  font-size: 0.75rem;
  line-height: 1.55;
  color: #475569;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow: visible;
  text-align: center;
}

@keyframes jdm-tip-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 900px) {
  .jdm-map-card.has-tips {
    flex-direction: column;
    align-items: center;
    width: min(296px, 78vw);
    gap: 0.55rem;
  }

  .jdm-map-card.has-tips .jdm-map-card__detail {
    width: 100%;
    max-width: 296px;
    height: 260px;
    flex: 0 0 auto;
  }

  .jdm-map-card.has-tips .jdm-map-card__tips {
    width: 100%;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
  }

  .jdm-map-card__tip {
    width: 100%;
    max-width: 296px;
    height: auto;
    min-height: 0;
  }

  .leaflet-popup.jdm-leaflet-popup .leaflet-popup-content {
    width: auto !important;
  }
}

.leaflet-container {
  font-family: inherit;
  background: #d1fae5;
}

@media (max-width: 900px) {
  .jdm-mapapp {
    --jdm-map-float-gap: 16px;
    --jdm-map-sidebar: calc(100% - (var(--jdm-map-float-gap) * 2));
    position: relative;
  }

  .jdm-mapapp__sidebar {
    inset-inline-end: var(--jdm-map-float-gap);
    width: auto;
    max-width: none;
    z-index: 5;
  }

  .jdm-mapapp.is-map-view .jdm-mapapp__sidebar {
    visibility: hidden;
    pointer-events: none;
  }

  .jdm-mapapp:not(.is-map-view) .jdm-mapapp__map-wrap {
    visibility: hidden;
    pointer-events: none;
  }

  .jdm-mapapp.is-map-view .jdm-mapapp__map-wrap {
    visibility: visible;
    pointer-events: auto;
    z-index: 4;
  }

  .jdm-mapapp__mobile-tabs {
    display: flex;
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 28px rgba(6, 78, 59, 0.15);
    border: 1px solid var(--color-jdm-border, #e2e8f0);
  }

  .jdm-mapapp__tab {
    cursor: pointer;
    border: 0;
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    background: transparent;
    color: var(--color-jdm-muted-text, #047857);
  }

  .jdm-mapapp__tab.is-active {
    background: var(--color-jdm-primary, #059669);
    color: #fff;
  }

  .jdm-mapapp__search-area {
    top: auto;
    bottom: 4.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jdm-mapapp__item,
  .jdm-mapapp__input,
  .jdm-mapapp__search-area,
  .jdm-map-pin,
  .jdm-map-card__tip {
    transition: none;
    animation: none;
  }
}
