.pss-detail-links a,
.leaflet-container a {
  color: #223146!important;
}

/* Map popup: studio logo + text */
.leaflet-popup-content .pss-popup-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
}

.leaflet-popup-content .pss-popup-logo-wrap {
  flex: 0 0 auto;
  width: 56px;
  max-width: 38%;
}

.leaflet-popup-content .pss-studio-logo--popup {
  display: block;
  width: 100%;
  height: auto;
  max-height: 72px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid #ddd;
  background: #fff;
}

.leaflet-popup-content .pss-popup-body {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.leaflet-popup-content .pss-popup-body strong {
  word-break: break-word;
}
.polestar-studio-search-container {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color: #1d2327;
  line-height: 1.5;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 30px;
  position: relative;
}

.polestar-studio-search-container *,
.polestar-studio-search-container *::before,
.polestar-studio-search-container *::after {
  box-sizing: border-box;
}

.polestar-studio-search-container svg {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  vertical-align: middle;
  overflow: visible;
  pointer-events: none;
}

.polestar-studio-search-container svg circle,
.polestar-studio-search-container svg line,
.polestar-studio-search-container svg path,
.polestar-studio-search-container svg polyline,
.polestar-studio-search-container svg polygon,
.polestar-studio-search-container svg rect {
  fill: none !important;
  stroke: inherit !important;
  stroke-width: inherit !important;
  visibility: visible !important;
}

.pss-layout {
  display: flex;
  height: 80vh;
  min-height: 480px;
  max-height: 900px;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  width: 100%;
}

/* ── Map (now first / left) ── */
.pss-map-area {
  flex: 1;
  min-width: 0;
  position: relative;
}

.pss-map {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* ── Toggle button ── */
.pss-sidebar-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 6px;
  background: #fff;
  box-shadow: #f6a800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f6a800;
  transition: background 0.15s, color 0.15s, right 0.3s ease;
}

.pss-sidebar-toggle svg {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px;
  min-height: 20px;
}

.pss-sidebar-toggle:hover, .pss-sidebar-toggle:focus {
  background: #f6a800;
  color: #fff;
}



/* ── Sidebar (now second / right) ── */
.pss-sidebar {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #dcdcde;
  overflow: hidden;
  transition: width 0.3s ease, opacity 0.25s ease;
}

.pss-layout.pss-collapsed .pss-sidebar {
  width: 0;
  opacity: 0;
  border-left: none;
  overflow: hidden;
}

.pss-search-header {
  padding: 20px 20px 0;
  flex-shrink: 0;
}

.pss-title {
  font-size: 1.35em;
  font-weight: 700;
  margin: 0 0 6px;
}

.pss-subtitle {
  font-size: 0.9em;
  color: #50575e;
  margin: 0 0 12px;
}

.pss-filters {
  padding: 8px 20px 16px;
  border-bottom: 1px solid #f0f0f1;
  flex-shrink: 0;
}

.pss-filters-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0 0 8px;
  padding: 8px 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92em;
  font-weight: 600;
  color: #1d2327;
  text-align: left;
  transition: color 0.15s, background 0.15s;
}

.pss-filters-toggle:hover,
.pss-filters-toggle:focus {
  color:#1d2327;
  background-color: #fff;
  outline: none;
}

.pss-filters-toggle:focus-visible {
  box-shadow: 0 0 0 2px #f6a800;
}

.pss-filters-toggle-label {
  flex: 1;
}

.pss-filters-chevron {
  flex-shrink: 0;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  min-height: 18px;
  color: #50575e;
  transition: transform 0.25s ease, color 0.15s;
}

.pss-filters-toggle:hover .pss-filters-chevron,
.pss-filters-toggle:focus .pss-filters-chevron {
  color: #f6a800;
}

.pss-filters-collapsed .pss-filters-chevron {
  transform: rotate(-90deg);
}

.pss-filters-body {
  overflow: hidden;
  max-height: 1200px;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  opacity: 1;
}

.pss-filters-collapsed .pss-filters-body {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.pss-filters-collapsed {
  padding-bottom: 8px;
}

.pss-field {
  margin-bottom: 12px;
}

.pss-field label {
  display: block;
  font-size: 0.82em;
  font-weight: 600;
  margin-bottom: 4px;
  color: #3c434a;
}

.pss-field input[type="text"],
.pss-field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  font-size: 0.9em;
  box-sizing: border-box;
  background: #fff;
}

.pss-field input[type="text"]:focus,
.pss-field select:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
  outline: none;
}

.pss-location-row {
  display: flex;
  gap: 6px;
}

.pss-location-row input {
  flex: 1;
  min-width: 0;
}

.pss-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  background: #f6f7f7;
  cursor: pointer;
  color: #50575e;
  transition: background 0.15s, color 0.15s;
}

.pss-btn-icon:hover {
  background: #2271b1;
  color: #fff;
  border-color: #2271b1;
}

.pss-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.pss-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85em;
  cursor: pointer;
  white-space: nowrap;
}

.pss-checkbox-label input[type="checkbox"] {
  margin: 0;
}

.pss-field-row {
  display: flex;
  gap: 12px;
}

.pss-field-half {
  flex: 1;
  min-width: 0;
}

.pss-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.pss-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: #f6a800;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  flex: 1;
  justify-content: center;
}

.pss-btn-primary:hover {
  background: #d99200;
}

.pss-btn-secondary {
  padding: 9px 14px;
  background: #f6f7f7;
  color: #50575e;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  font-size: 0.9em;
  cursor: pointer;
  transition: background 0.15s;
}

.pss-btn-secondary:hover {
  background: #dcdcde;
}

/* ── Results ── */
.pss-results-info {
  padding: 10px 20px;
  font-size: 0.85em;
  color: #50575e;
  border-bottom: 1px solid #f0f0f1;
  background: #f6f7f7;
  flex-shrink: 0;
}

.pss-results-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.pss-result-item {
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f1;
  cursor: pointer;
  transition: background 0.12s;
}

.pss-result-item:hover,
.pss-result-item.pss-active {
  background: #f0f6fc;
}

.pss-result-name {
  font-weight: 600;
  font-size: 0.95em;
  margin-bottom: 2px;
}

.pss-result-address {
  font-size: 0.82em;
  color: #646970;
  margin-bottom: 4px;
}

.pss-result-meta {
  display: flex;
  gap: 12px;
  font-size: 0.78em;
  color: #787c82;
}

.pss-result-distance {
  font-weight: 600;
  color: #2271b1;
}

.pss-result-grads {
  color: #50575e;
}

.pss-result-inner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.pss-result-logo-col {
  flex: 0 0 auto;
  width: 88px;
  max-width: 32%;
}

.pss-studio-logo--result {
  display: block;
  width: 100%;
  height: auto;
  max-height: 96px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #e2e4e7;
  background: #fff;
}

.pss-result-body {
  flex: 1;
  min-width: 0;
}

.pss-no-results {
  padding: 30px 20px;
  text-align: center;
  color: #787c82;
}

.pss-pagination {
  padding: 10px 20px;
  display: flex;
  gap: 6px;
  justify-content: center;
  border-top: 1px solid #f0f0f1;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.pss-page-btn {
  padding: 4px 10px;
  border: 1px solid #dcdcde;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  font-size: 0.82em;
  color: #2271b1;
}

.pss-page-btn:hover {
  background: #f0f6fc;
}

.pss-page-btn.pss-current {
  background: #2271b1;
  color: #fff;
  border-color: #2271b1;
}

/* ── Detail overlay ── */
.pss-studio-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pss-studio-detail-panel {
  background: #fff;
  border-radius: 8px;
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.pss-detail-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  color: #787c82;
  line-height: 1;
}

.pss-detail-close:hover {
  color: #1d2327;
  background-color: transparent!important;
}

.pss-detail-logo-wrap {
  margin: 0 0 16px;
  text-align: center;
}

.pss-studio-logo--detail {
  display: block;
  max-width: 100%;
  width: auto;
  max-height: min(40vh, 220px);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #e2e4e7;
  background: #fafafa;
}

.pss-detail-name {
  font-size: 1.3em;
  font-weight: 700;
  margin: 0 0 8px;
}

/* Host Site badge */
.pss-host-badge {
  display: inline-block;
  font-size: 0.65em;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: #FF875D;
  color: #fff;
  vertical-align: middle;
  letter-spacing: 0.3px;
  line-height: 1.5;
}

.pss-detail-address {
  font-size: 0.9em;
  color: #646970;
  margin-bottom: 12px;
}

.pss-detail-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.pss-detail-links a {
  font-size: 0.85em;
  color: #2271b1;
  text-decoration: none;
}

.pss-detail-links a:hover {
  text-decoration: underline;
}

.pss-detail-section-title {
  font-size: 0.9em;
  font-weight: 700;
  margin: 16px 0 8px;
  border-bottom: 1px solid #f0f0f1;
  padding-bottom: 4px;
}

.pss-detail-grad-list {
  list-style: none;
  padding: 0!important;
  margin: 0;
}

.pss-detail-grad-item {
  padding: 8px 0;
  font-size: 0.88em;
  border-bottom: 1px solid #f6f7f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.pss-detail-grad-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pss-detail-grad-name {
  font-weight: 600;
}

.pss-detail-grad-role {
  color: #646970;
  font-size: 0.9em;
}

.pss-detail-grad-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #f8a800;
  color: #fff !important;
  border-radius: 4px;
  font-size: 0.82em;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s;
}

.pss-detail-grad-profile-btn:hover {
  background: #135e96;
  color: #fff !important;
  text-decoration: none !important;
}

.pss-detail-grad-profile-btn svg {
  display: inline-block !important;
  width: 14px !important;
  height: 14px !important;
  fill: none !important;
  stroke: currentColor !important;
  vertical-align: middle;
}

/* "Are you the owner?" in results list */
.pss-claim-owner {
  margin-top: 6px;
}

.pss-claim-owner-link {
  font-size: 0.8em;
  color: #f6a800;
  text-decoration: none;
  font-weight: 600;
}

.pss-claim-owner-link:hover {
  text-decoration: underline;
  color: #d99200;
}

/* "Are you the owner?" in detail overlay */
.pss-detail-claim {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e0e0e0;
  text-align: center;
}

.pss-detail-claim-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: #fff;
  border: 2px solid #f6a800;
  color: #f6a800;
  border-radius: 6px;
  font-size: 0.88em;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.pss-detail-claim-link:hover {
  background: #f6a800;
  color: #fff;
}

.pss-detail-claim-link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}

.pss-loading {
  text-align: center;
  padding: 20px;
  color: #787c82;
}

/* Mobile view toggle buttons — hidden by default, shown on mobile only */
.pss-mobile-view-btn {
  display: none;
}

.pss-mobile-list-footer {
  display: none;
}

/* ── Tablet (sidebar stacks below map) ── */
@media (max-width: 1024px) {
  .pss-layout {
    flex-direction: column;
    height: auto;
    max-height: none;
    min-height: 0;
  }

  .pss-map-area {
    position: relative;
    height: 50vh;
    min-height: 320px;
    order: 1;
  }

  .pss-sidebar {
    width: 100% !important;
    opacity: 1 !important;
    flex-shrink: 0;
    border-left: none;
    border-top: 1px solid #dcdcde;
    max-height: none;
    overflow: visible;
    order: 2;
    transition: none;
  }

  .pss-layout.pss-collapsed .pss-sidebar {
    width: 100% !important;
    opacity: 1 !important;
    border-left: none;
    overflow: visible;
  }

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

  .pss-results-list {
    max-height: 30vh;
    overflow-y: auto;
  }

  .pss-map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
}

/* ── Mobile: two-mode layout (List / Map) ── */
@media (max-width: 600px) {
  .pss-search-header {
    padding: 16px 16px 0;
  }

  .pss-title {
    font-size: 1.15em;
  }

  .pss-subtitle {
    font-size: 0.82em;
  }

  .pss-filters {
    padding: 6px 16px 10px;
  }

  .pss-filters:not(.pss-filters-collapsed) {
    padding-bottom: 14px;
  }

  .pss-field-row {
    flex-direction: column;
    gap: 0;
  }

  .pss-result-item {
    padding: 12px 16px;
  }

  .pss-result-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .pss-result-logo-col {
    width: 100%;
    max-width: none;
    text-align: center;
  }

  .pss-studio-logo--result {
    max-width: min(220px, 100%);
    max-height: 120px;
    margin: 0 auto;
  }

  .pss-results-info {
    padding: 8px 16px;
  }

  .pss-studio-detail-panel {
    padding: 20px;
    max-height: 85vh;
  }

  /* --- Default: List mode (sidebar visible, map hidden) --- */
  .pss-map-area {
    display: none;
    height: 100vh;
    min-height: 300px;
  }

  .pss-sidebar {
    display: flex !important;
    width: 100% !important;
    opacity: 1 !important;
    border-left: none;
    border-top: none;
    overflow: visible;
    flex-direction: column;
  }

  .pss-layout.pss-collapsed .pss-sidebar {
    width: 100% !important;
    opacity: 1 !important;
    overflow: visible;
  }

  /* Reorder: results info + list first, then search form */
  .pss-search-header { order: 3; }
  .pss-filters        { order: 4; }
  .pss-results-info   { order: 1; }
  .pss-results-list   { order: 2; max-height: none; overflow-y: visible; }
  .pss-pagination      { order: 5; }
  .pss-mobile-list-footer { order: 6; }

  .pss-results-list:empty ~ .pss-search-header { order: 1; }
  .pss-results-list:empty ~ .pss-filters       { order: 2; }

  /* "View on Map" button in list mode */
  .pss-mobile-list-footer {
    display: block;
    padding: 12px 16px 16px;
    text-align: center;
  }

  .pss-mobile-list-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: 24px;
    background: #f6a800;
    color: #fff;
    font-size: 0.9em;
    font-weight: 600;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    white-space: nowrap;
  }

  .pss-mobile-list-btn:hover {
    background: #d99200;
  }

  .pss-mobile-list-btn svg {
    width: 18px !important;
    height: 18px !important;
    stroke: #fff !important;
  }

  /* --- Map mode --- */
  .pss-layout.pss-mobile-map-view .pss-map-area {
    display: block;
    height: 100vh;
    flex: 1;
  }

  .pss-layout.pss-mobile-map-view .pss-sidebar {
    display: none !important;
  }

  /* "List" button floating on the map */
  .pss-mobile-map-btn {
    display: none;
    align-items: center;
    gap: 6px;
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 10px 24px;
    border: none;
    border-radius: 24px;
    background: #f6a800;
    color: #fff;
    font-size: 0.9em;
    font-weight: 600;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    white-space: nowrap;
  }

  .pss-mobile-map-btn:hover {
    background: #d99200;
  }

  .pss-mobile-map-btn svg {
    width: 18px !important;
    height: 18px !important;
    stroke: #fff !important;
  }

  .pss-layout.pss-mobile-map-view .pss-mobile-map-btn {
    display: flex;
  }
}
