body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header-link-wrap {
  margin-top: 8px;
}

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 330px 1fr;
  min-height: 0;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
  box-shadow: 8px 0 16px rgba(23, 45, 82, 0.06);
}

.field { margin-bottom: 12px; }

select, input, button { width: 100%; }

.check-field {
  margin-top: 4px;
}

.check-option {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #cfd9e7;
  border-radius: 12px;
  background: #f8fbff;
  color: #26426c;
  cursor: pointer;
}

.check-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.check-option span {
  font-size: 0.92rem;
  color: #223652;
}

.meta {
  margin-top: 16px;
  padding: 12px;
  line-height: 1.5;
}

.meta strong { color: #0f6cff; }

.seo-note {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #ffffff;
  color: #3b4b66;
  font-size: 0.9rem;
  line-height: 1.45;
}

.seo-note h2 {
  margin: 0 0 8px;
  color: #182236;
  font-size: 1rem;
}

.seo-note p {
  margin: 0 0 8px;
}

.seo-note p:last-child {
  margin-bottom: 0;
}

#map {
  width: 100%;
  height: calc(100vh - 95px);
}

.leaflet-popup-content {
  margin: 10px 12px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.marker-logo {
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 2px solid #d4deed;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.marker-logo__inner {
  box-sizing: border-box;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(var(--logo-scale, 1));
  transform-origin: center center;
}

.marker-logo img {
  width: 100% !important;
  height: 100% !important;
  max-width: 34px !important;
  max-height: 34px !important;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.leaflet-container .leaflet-marker-pane .marker-logo img {
  width: 100% !important;
  height: 100% !important;
  max-width: 34px !important;
  max-height: 34px !important;
}

.marker-logo .brand-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.marker-logo--logo {
  width: 40px;
  height: 40px;
  padding: 0;
  background: #ffffff;
}

.marker-logo--fallback {
  width: 40px;
  height: 40px;
  padding: 0;
  background: #40516d;
}

.marker-logo--fallback .brand-text { color: #f8f9fa; }

.marker-logo--wide img {
  max-width: 100%;
  max-height: 100%;
}

.marker-logo--tall img {
  max-width: 100%;
  max-height: 100%;
}

.marker-logo--wide .marker-logo__inner {
  width: 34px;
  height: 26px;
}

.marker-logo--tall .marker-logo__inner {
  width: 28px;
  height: 34px;
}

.cluster-badge {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.cluster-cheap { background: #1b9e77; }
.cluster-mid { background: #66a61e; }
.cluster-high { background: #e6ab02; }
.cluster-expensive { background: #d95f02; }
.cluster-na { background: #6c757d; }

.popup-no-prices { color: #70809b; }

.popup-separator {
  border-color: #d8e2f0;
  opacity: 1;
}

.popup-detail-link {
  display: inline-block;
  margin-top: 8px;
  text-decoration: none;
  background: #0f6cff;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
  }

  #map { height: 70vh; }
}

@media (max-width: 640px) {
  .sidebar {
    padding: 12px;
    max-height: none;
  }

  .field {
    margin-bottom: 10px;
  }

  .seo-note {
    display: none;
  }

  #map {
    height: 64vh;
  }

  .leaflet-popup-content {
    max-width: 260px;
    font-size: 0.84rem;
  }
}

.leaflet-popup-content a.popup-detail-link,
.leaflet-popup-content a.popup-detail-link:visited,
.leaflet-popup-content a.popup-detail-link:hover,
.leaflet-popup-content a.popup-detail-link:active {
  color: #ffffff !important;
}
