/*
 * Styles for KinkersHub Classifieds plugin
 * Provides a modern, responsive layout with cards and search bar.
 */

/* -------------------------------------------------------------------------- */
/* Rentals: single listing mini map                                           */
/* -------------------------------------------------------------------------- */
.kh-single-map-card {
  margin: 14px 0 10px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,0.04);
}

.kh-single-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
}

.kh-single-map-title {
  font-weight: 600;
  font-size: 14px;
}

.kh-single-map-open {
  font-size: 13px;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,0.05);
}

.kh-single-mini-map {
  height: 220px;
  width: 100%;
}

.kh-single-mini-map .leaflet-container {
  border-radius: 0;
}

.kh-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Logged-out notice cards should breathe below the site header (used by kh_view=new). */
.kh-auth-required--topgap {
  /* Align with other logged-out views (Saved/My Account/Inbox).
     New Listing was sitting slightly lower after the previous spacing fix. */
  margin-top: 12px;
}

/* -------------------------------------------------------------------------- */
/* Rentals: browse index should use the full available width (Zillow-like)    */
/* -------------------------------------------------------------------------- */
/*
 * The global .kh-wrapper card is great for most plugin pages, but the rentals
 * browse experience benefits from using the entire viewport (especially when
 * paired with the new header filters + map toggle).
 */
.kh-wrapper.kh-index-rentals,
.kh-wrapper.kh-index-rentals.kh-rentals-map-view {
  max-width: none;
  width: 100%;
  margin: 0;

  /* Let the page breathe edge-to-edge, then apply spacing inside sections. */
  padding: 0;

  /* Remove the centered “card” framing so it feels like a true app view. */
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;

  /* Full-bleed takeover even when the theme centers page content */
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);

}

/* -------------------------------------------------------------------------- */
/* Rentals Map View: remove wasted top space (theme page title / padding)      */
/* -------------------------------------------------------------------------- */
/*
 * Some themes insert a page title (e.g., “Map view”) and/or extra content padding
 * above the plugin UI. In the rentals map view this creates a large dead zone
 * between the site header and the filter row.
 *
 * We keep this scoped tightly to the rentals map view to avoid affecting other pages.
 */
body.kh-rentals-map-view .entry-header,
body.kh-rentals-map-view .page-header,
body.kh-rentals-map-view .wp-block-post-title,
body.kh-rentals-map-view .wp-block-query-title,
body.kh-rentals-map-view .post-title,
body.kh-rentals-map-view .entry-title,
body.kh-rentals-map-view .page-title,
body.kh-rentals-map-view h1.entry-title,
body.kh-rentals-map-view h1.page-title {
  display: none !important;
}

body.kh-rentals-map-view #content,
body.kh-rentals-map-view .site-content,
body.kh-rentals-map-view .content-area,
body.kh-rentals-map-view main,
body.kh-rentals-map-view .wp-site-blocks {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

body.kh-rentals-map-view .kh-index-rentals .kh-classifieds-header {
  margin-top: 0 !important;
  padding-top: 12px;
}


/* Re-introduce sane horizontal padding for key sections inside the full-width wrapper */
.kh-index-rentals .kh-classifieds-header,
.kh-index-rentals .kh-rentals-map-shell,
.kh-index-rentals .kh-cards,
.kh-index-rentals .kh-pagination {
  padding-left: 24px;
  padding-right: 24px;
}

@media (max-width: 980px) {
  .kh-index-rentals .kh-classifieds-header,
  .kh-index-rentals .kh-rentals-map-shell,
  .kh-index-rentals .kh-cards,
  .kh-index-rentals .kh-pagination {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* Rentals map view layout */
.kh-rentals-map-shell {
  --kh-rentals-list-pct: 34%;
  --kh-rentals-splitter-w: 12px;
  display: grid;
  grid-template-columns: 2fr 1fr; /* map left, list right */
  gap: 0.9rem;
  align-items: stretch;
  width: 100%;
  min-height: 0;
}

/* Rentals: map-only mode (three-way toggle)
   When kh_map_layout=map, we keep the same page + JS behavior, but hide the
   listings panel and splitter so the map can take the full width.
*/
.kh-index-rentals.kh-rentals-map-view.kh-rentals-map-layout-map .kh-rentals-map-shell {
  grid-template-columns: 1fr;
  grid-template-areas: "map";
  gap: 0;
}
.kh-index-rentals.kh-rentals-map-view.kh-rentals-map-layout-map #kh-rentals-map-list,
.kh-index-rentals.kh-rentals-map-view.kh-rentals-map-layout-map .kh-rentals-splitter {
  display: none !important;
}

/* Draggable vertical splitter (desktop/tablet only) */
.kh-rentals-splitter {
  display: none;
}

@media (min-width: 769px) {
  .kh-rentals-map-view .kh-index-rentals .kh-rentals-splitter {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: col-resize;
    user-select: none;
    touch-action: none;
    border-radius: 999px;
    background: rgba(0,0,0,0.06);
  }
  .kh-rentals-map-view .kh-index-rentals .kh-rentals-splitter:before {
    content: '';
    width: 4px;
    height: 26px;
    border-radius: 999px;
    background: rgba(0,0,0,0.22);
    box-shadow: 0 -8px 0 rgba(0,0,0,0.22), 0 8px 0 rgba(0,0,0,0.22);
  }
  .kh-rentals-map-view .kh-index-rentals .kh-rentals-splitter.is-dragging {
    background: rgba(37,99,235,0.18);
  }
}


/* Map View: keep the list narrower so the map always feels dominant */
@media (min-width: 769px) and (max-width: 1023px) {
  .kh-rentals-map-view .kh-index-rentals .kh-rentals-map-shell {
    grid-template-columns: clamp(280px, var(--kh-rentals-list-pct, 38%), 520px) var(--kh-rentals-splitter-w, 12px) minmax(0, 1fr);
    grid-template-areas: "list splitter map";
    gap: 18px;
    padding-left: 0;
    padding-right: 0;
  }

  .kh-rentals-map-view .kh-index-rentals #kh-rentals-map { grid-area: map; }
  .kh-rentals-map-view .kh-index-rentals #kh-rentals-map-list { grid-area: list; }
  .kh-rentals-map-view .kh-index-rentals .kh-rentals-splitter { grid-area: splitter; }
}

/* -------------------------------------------------------------------------- */
/* Map View: unbox the map (full-bleed), keep ads inside a boxed panel (desktop) */
/* -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  /* Stop padding from “boxing” the whole 2-col shell; we’ll pad only the list side */
  .kh-rentals-map-view .kh-index-rentals .kh-rentals-map-shell {
    padding-right: 0;
    padding-left: 0;
    padding-top: 0;
    padding-bottom: 0;
    gap: 24px;
    grid-template-columns: clamp(280px, var(--kh-rentals-list-pct, 34%), 620px) var(--kh-rentals-splitter-w, 12px) minmax(0, 1fr);
    grid-template-areas: "list splitter map";
  }

  /* Re-order without changing markup */
  .kh-rentals-map-view .kh-index-rentals #kh-rentals-map { grid-area: map; }
  .kh-rentals-map-view .kh-index-rentals #kh-rentals-map-list { grid-area: list; }
  .kh-rentals-map-view .kh-index-rentals .kh-rentals-splitter { grid-area: splitter; }

  /* Map should feel like it lives in the browser, not inside a card */
  .kh-rentals-map-view .kh-index-rentals #kh-rentals-map {
    border-radius: 0;
    box-shadow: none;
    background: #eef3f8;
    /* Make sure it can stretch to the far right edge */
    width: 100%;
  }

  /* Listings panel = the “boxed” piece */
  .kh-rentals-map-view .kh-index-rentals #kh-rentals-map-list {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.10);
    border: 1px solid rgba(15, 23, 42, 0.06);
    overflow: auto;
    padding: 14px 12px 18px;
    margin-left: 24px; /* keep breathing room from the left edge */
  }

  /* If we’re showing 2-up cards, keep their container padding reasonable */
  .kh-index-rentals.kh-rentals-map-view #kh-rentals-map-list{
    padding: 14px 12px 18px;
  }
}

/* Zillow-like behavior: keep the map fixed and only scroll the listings panel
   (desktop/tablet only). On mobile we allow normal document scrolling so the
   bottom nav and sheet-style listing drawer don’t get trapped/hidden by
   overflow locking on some devices/browsers.
*/
@media (min-width: 769px) {
  /* Lock the document scroll so only the listings panel scrolls (Zillow style) */
  html.kh-rentals-map-view,
  .kh-rentals-map-view {
    height: 100%;
    overflow: hidden;
  }

  /* Some themes scroll inner wrappers instead of <body>. Force them to stop. */
  .kh-rentals-map-view #page,
  .kh-rentals-map-view .site,
  .kh-rentals-map-view .site-content,
  .kh-rentals-map-view .content-area,
  .kh-rentals-map-view .site-main,
  .kh-rentals-map-view main,
  .kh-rentals-map-view .wp-site-blocks {
    height: 100%;
    overflow: hidden;
  }

  .kh-wrapper.kh-index-rentals.kh-rentals-map-view {
    /* Turn the wrapper into a viewport-sized app shell */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100vh;
  }

  /* Account for the WP admin bar height when logged in */
  body.admin-bar .kh-wrapper.kh-index-rentals.kh-rentals-map-view {
    height: calc(100vh - 32px);
  }
  @media (max-width: 782px) {
    body.admin-bar .kh-wrapper.kh-index-rentals.kh-index-rentals.kh-rentals-map-view,
    body.admin-bar .kh-wrapper.kh-index-rentals.kh-rentals-map-view {
      height: calc(100vh - 46px);
    }
  }
}

/* In the Zillow-like map experience (desktop/tablet) we don’t want the
   page-level footer to force the whole document to scroll. */
@media (min-width: 769px) {
  .kh-wrapper.kh-index-rentals.kh-rentals-map-view + .classicore-footer-wrapper {
    display: none;
  }
}

.kh-index-rentals.kh-rentals-map-view .kh-classifieds-header {
  flex: 0 0 auto;
}

.kh-index-rentals.kh-rentals-map-view .kh-rentals-map-shell {
  flex: 1 1 auto;
  align-items: stretch;
  min-height: 0; /* allow children to size within flex container */
  height: 100%;
}


.kh-index-rentals.kh-rentals-map-view .kh-rentals-map {
  height: 100%;
  min-height: 0;
}

.kh-index-rentals.kh-rentals-map-view .kh-rentals-map-list {
  height: 100%;
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Mobile stability: avoid nested scrolling + viewport-locked heights on the map view.
   Nested scroll containers + mobile browser chrome resizing can cause a jittery
   "shake" when moving between the map and listings. */
@media (max-width: 768px) {
  .kh-index-rentals.kh-rentals-map-view .kh-rentals-map-shell {
    height: auto !important;
    min-height: 0;
  }

  .kh-index-rentals.kh-rentals-map-view .kh-rentals-map {
    height: auto;
    min-height: 0;
  }

  /* Give the map a stable, non-thrashy height on phones */
  .kh-index-rentals.kh-rentals-map-view #kh-rentals-map,
  .kh-index-rentals.kh-rentals-map-view .kh-rentals-map {
    height: clamp(280px, 42vh, 460px);
  }

  /* Let the listings flow with the document instead of an inner scroller */
  .kh-index-rentals.kh-rentals-map-view .kh-rentals-map-list,
  .kh-index-rentals.kh-rentals-map-view #kh-rentals-map-list {
    height: auto !important;
    overflow: visible;
    -webkit-overflow-scrolling: auto;
  }
}

.kh-rentals-map {
  width: 100%;
  height: 100%;
  min-height: 420px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.kh-rentals-map-list {
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.kh-rentals-map-list .kh-card-rental {
  cursor: pointer;
}

.kh-rentals-map-list .kh-card-rental.is-active {
  outline: 2px solid rgba(0,115,170,0.45);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Premium map view: list + cluster styling */
.kh-map-list-loading,
.kh-map-list-empty {
  padding: 12px 10px;
  color: rgba(0,0,0,0.65);
  font-weight: 600;
}

.kh-map-list-hint {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 10px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.7);
  font-weight: 600;
}

/* MapView: Zillow-style results header (For Rent + count) */
.kh-map-list-header{
  isolation: isolate;
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 12px 10px;
  background: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
border-bottom: 1px solid rgba(0,0,0,0.08);
}

.kh-map-list-header-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kh-map-list-pill{
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.03);
  font-weight: 800;
  font-size: 13px;
  color: rgba(0,0,0,0.78);
}

.kh-map-list-header-count{
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(0,0,0,0.70);
}

.kh-rentals-map-list .kh-card-title {
  font-weight: 700;
  margin-top: 4px;
  margin-bottom: 6px;
  color: rgba(0,0,0,0.86);
}

.kh-rentals-map-list .kh-map-card-link {
  display: inline-block;
  margin-top: 8px;
  font-weight: 700;
  text-decoration: none;
  color: #0073aa;
}

.kh-rentals-map-list .kh-map-card-link:hover {
  text-decoration: underline;
}

.kh-map-cluster {
  background: transparent;
}

.kh-map-cluster-bubble {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  background: rgba(0, 115, 170, 0.95);
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  border: 2px solid rgba(255,255,255,0.95);
}

/* Map: price pill markers (no photos; avoids clutter) */
.kh-map-price-icon {
  background: transparent;
  border: 0;
}

.kh-map-price-marker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 8px; /* room for nub */
}

.kh-map-price-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  color: #0b0f14;
  background: rgba(255,255,255,0.96);
  border: 2px solid rgba(255,255,255,0.98);
  box-shadow: 0 14px 30px rgba(0,0,0,0.24);
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kh-map-price-nub {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 10px;
  height: 10px;
  transform: translateX(-50%) rotate(45deg);
  background: rgba(255,255,255,0.96);
  border-right: 2px solid rgba(255,255,255,0.98);
  border-bottom: 2px solid rgba(255,255,255,0.98);
  box-shadow: 8px 8px 18px rgba(0,0,0,0.10);
}

/* Make the marker feel interactive */
.leaflet-marker-icon.leaflet-interactive:hover .kh-map-price-pill,
.leaflet-marker-icon.leaflet-interactive:focus .kh-map-price-pill {
  transform: translateY(-1px);
}


.leaflet-marker-icon.leaflet-interactive .kh-map-price-pill{
  transition: transform 140ms ease;
}
.leaflet-marker-icon.kh-pin-hover .kh-map-price-pill{
  transform: translateY(-1px) scale(1.04);
}

.kh-map-popup {
  min-width: 210px;
}

.kh-map-popup-price {
  font-weight: 800;
  margin-bottom: 4px;
}

.kh-map-popup-title {
  font-weight: 700;
  margin-bottom: 4px;
}

/* Map view: City search bar */
.kh-mapview-toolbar {
  padding: 10px 0 0 0;
}

.kh-mapview-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kh-mapview-search-input {
  flex: 1 1 260px;
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.10);
  outline: none;
  background: #fff;
}

.kh-mapview-search-input:focus {
  border-color: rgba(0,115,170,0.45);
  box-shadow: 0 0 0 3px rgba(0,115,170,0.12);
}

.kh-mapview-search-btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,115,170,0.95);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.kh-mapview-search-btn:hover {
  filter: brightness(0.98);
}

.kh-mapview-search-status {
  font-weight: 700;
  color: rgba(0,0,0,0.65);
}

.kh-map-popup-loc {
  color: rgba(0,0,0,0.65);
  margin-bottom: 8px;
}

.kh-map-popup-link {
  font-weight: 800;
  text-decoration: none;
  color: #0073aa;
}

.kh-map-popup-link:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .kh-rentals-map-shell {
    grid-template-columns: 1fr;
  }
  .kh-rentals-map {
    height: 52vh;
    min-height: 320px;
  }
  .kh-rentals-map-list {
    max-height: none;
  }
}

/* Rentals: Pin-drop map picker (Leaflet) */
.kh-map-picker {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  background: #ffffff;
}

.kh-map-picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.kh-map-picker__title {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.kh-map-picker__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.kh-map-picker__help {
  margin: 0.45rem 0 0.65rem;
  font-size: 0.9rem;
  opacity: 0.85;
}

.kh-map-picker__map {
  width: 100%;
  height: 260px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
}

@media (min-width: 960px) {
  .kh-map-picker__map {
    height: 300px;
  }
}

/* ---------------- Rentals enhancements ---------------- */
/* A special card style for rentals grid. Adds a border, subtle shadow and hover lift. */
.kh-card-rental {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kh-card-rental:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Placeholder thumbnail for rentals with no uploaded image */
.kh-card-thumb-placeholder {
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  color: #999;
  font-size: 2rem;
}

/* Ensure rental card thumbnails are consistent height and cover the area */
.kh-card-thumb img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

/* Rental card body spacing */
.kh-card-rental .kh-card-body {
  padding: 0.70rem 0.85rem 0.60rem;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  /* Don't force extra vertical space under the last meta line (Posted X days ago). */
  flex-grow: 0;
}

/* Rentals card excerpt styling
 * A short description appears below the specs and location in the rentals grid
 * to provide more context without overwhelming the card. Make the font
 * slightly smaller and adjust the color to a muted tone.
 */
.kh-card-rental .kh-card-excerpt {
  font-size: 0.86rem;
  color: #475569;
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-wrap: pretty;
}

.kh-card-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111;
  margin: 0;
}

.kh-card-specs {
  font-size: 0.85rem;
  color: #555;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.kh-card-specs .kh-meta-item { white-space: nowrap; }
.kh-card-specs .kh-meta-sep {
  font-weight: 900;
  opacity: 0.70;
  margin: 0 0.35rem;
  line-height: 1;
}

.kh-card-location {
  font-size: 0.8rem;
  color: #777;
  margin: 0;
}


.kh-card-age {
  font-size: 0.75rem;
  color: #8a8a8a;
  margin: 2px 0 0;
}

/* --- Rentals listing card polish (Zillow-style) --- */
.kh-card-rental--polished {
  border-radius: 14px;
}

.kh-card-rental--polished .kh-card-media {
  position: relative;
  /* Keep media consistent even if a theme applies global img rules. */
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f1f5f9;
}

.kh-card-rental--polished .kh-card-thumb img,
.kh-card-rental--polished .kh-card-carousel-img {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

/* Ensure carousel containers inherit the fixed media height */
.kh-card-rental--polished .kh-card-thumb,
.kh-card-rental--polished .kh-card-carousel,
.kh-card-rental--polished .kh-card-carousel-track,
.kh-card-rental--polished .kh-card-carousel-slide {
  height: 100%;
}

@media (max-width: 600px) {
  .kh-card-rental--polished .kh-card-thumb img,
  .kh-card-rental--polished .kh-card-carousel-img {
    height: 100% !important;
  }

  .kh-card-rental--polished .kh-card-media {
    aspect-ratio: 16 / 11;
  }
}

.kh-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: rgba(17, 24, 39, 0.82);
  backdrop-filter: blur(6px);
  max-width: calc(100% - 20px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kh-card-heart {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.kh-card-heart .dashicons {
  font-size: 18px;
  line-height: 1;
  width: 18px;
  height: 18px;
}

.kh-card-heart.kh-saved-active {
  background: rgba(239, 68, 68, 0.92);
  border-color: rgba(239, 68, 68, 0.35);
}

.kh-card-heart.kh-saved-active .dashicons {
  color: #fff;
}

.kh-card-carousel {
  position: relative;
  overflow: hidden;
}

.kh-card-carousel-track {
  display: flex;
  width: 100%;
  transform: translate3d(0, 0, 0);
  transition: transform 220ms ease;
}

.kh-card-carousel-slide {
  min-width: 100%;
}

.kh-card-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(255, 255, 255, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.kh-card-carousel:hover .kh-card-carousel-nav {
  display: inline-flex;
}

.kh-card-carousel-prev { left: 10px; }
.kh-card-carousel-next { right: 10px; }

.kh-card-carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(6px);
}

.kh-card-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}

.kh-card-carousel-dot.is-active {
  background: rgba(255, 255, 255, 0.95);
}

.kh-card-rental--polished .kh-card-price {
  font-size: 1.25rem;
  font-weight: 800;
}

.kh-card-rental--polished .kh-card-price-suffix,
.kh-card-rental--polished .kh-card-per,
.kh-card-rental--polished .kh-card-price-suffix {
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 0.75;
  margin-left: 4px;
}

/* Rental details list styling in single listing */
.kh-rental-details-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.kh-rental-details-list li {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: #333;
}

/* Rental meta fields styling */
.kh-rental-meta-fields {
  background: #fdfdfd;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
}
.kh-rental-meta-fields li {
  margin: 0;
  padding: 0;
}

/* Single rental details section styling */
.kh-single-section.kh-single-rental-details {
  background: #fdfdfd;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 1rem;
  margin-top: 1.2rem;
}
.kh-single-section.kh-single-rental-details .kh-rental-details-list li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
  padding: 0.4rem 0;
  margin: 0;
}
.kh-single-section.kh-single-rental-details .kh-rental-details-list li:last-child {
  border-bottom: none;
}
.kh-single-section.kh-single-rental-details .kh-rental-details-list li strong {
  color: #555;
  margin-right: 0.5rem;
}

/* Checkbox group styling in rentals toolbar */
.kh-toolbar-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
@media (min-width: 640px) {
  .kh-toolbar-checkbox-group {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem 0.5rem;
  }
}
.kh-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: #333;
}

/* Category list */
.kh-index .kh-category-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0 0 1rem 0;
}
.kh-category-list li {
  margin: 0;
}
.kh-category-list a {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  background: #f0f0f0;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
}
.kh-category-list .current-cat a {
  background: #0073aa;
  color: #ffffff;
}

/* Search bar */
.kh-search-form {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}
.kh-search-input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
}
.kh-filter-input,
.kh-filter-select {
  padding: 0.4rem 0.55rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
}
.kh-filter-select {
  background: #fff;
}
.kh-reset {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  color: #0073aa;
  text-decoration: none;
  align-self: center;
}
.kh-reset:hover {
  text-decoration: underline;
}
.kh-search-button {
  padding: 0.5rem 1rem;
  background: #0073aa;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}
.kh-search-button:hover {
  background: #005f8d;
}

/* Lightbox overlay for viewing full-size images */
.kh-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
}
.kh-lightbox-overlay img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Listings grid */
.kh-listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.8rem;
}
.kh-card {
  background: #f9f9f9;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.kh-card-thumb img {
  width: 100%;
  height: auto;
  display: block;
}
.kh-card-body {
  padding: 0.75rem;
  flex: 1;
}
.kh-card-title {
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-size: 1.1rem;
  color: #222;
}
.kh-card-title a {
  color: inherit;
  text-decoration: none;
}
.kh-card-title a:hover {
  text-decoration: underline;
}
.kh-card-meta {
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 0.35rem;
}
.kh-card-excerpt {
  font-size: 0.9rem;
  color: #555;
  margin: 0;
}

/* Pagination */
.kh-pagination {
  margin: 1rem 0;
  text-align: center;
}

/* ===============================
 * Rentals: mobile top bar (mimic reference UI)
 * =============================== */
/* Desktop: keep the rentals header, but embed the location + Filters controls inside it */
@media (min-width: 769px) {
  .kh-classifieds-header-rentals {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .kh-classifieds-header-rentals .kh-classifieds-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
  }

  /* The embedded top bar should feel like part of the header, not a second card */
  .kh-classifieds-header-rentals .kh-rentals-mobile-top {
    margin: 0;
    padding: 0;
    background: transparent;
    width: 100%;
  }

  .kh-classifieds-header-rentals .kh-rentals-mobile-top-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0,0,0,0.55);
    margin: 0 0 0.4rem;
  }

  /* Align the location input + Filters button cleanly on desktop */
  .kh-classifieds-header-rentals .kh-rentals-mobile-top-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.75rem;
  }

  .kh-classifieds-header-rentals .kh-rentals-mobile-location-form {
    flex: 1 1 auto;
    margin: 0;
  }

  .kh-classifieds-header-rentals .kh-rentals-mobile-location-wrap {
    position: relative;
    width: 100%;
  }

  .kh-classifieds-header-rentals .kh-rentals-mobile-location-input {
    width: 100%;
    height: 46px;
    padding: 0 38px 0 12px;
    border: 1px solid rgba(0,0,0,0.14);
    border-radius: 12px;
    font-size: 0.95rem;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }

  .kh-classifieds-header-rentals .kh-rentals-mobile-location-input:focus {
    outline: none;
    border-color: rgba(0,0,0,0.28);
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
  }

  .kh-classifieds-header-rentals .kh-rentals-mobile-location-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 999px;
    background: rgba(0,0,0,0.04);
    font-size: 18px;
    line-height: 1;
    opacity: 0.7;
    cursor: pointer;
    display: none;
  }

  .kh-classifieds-header-rentals .kh-rentals-mobile-location-clear:hover {
    opacity: 1;
    background: rgba(0,0,0,0.07);
  }

  .kh-classifieds-header-rentals .kh-rentals-mobile-filters-btn {
    height: 46px;
    padding: 0 14px;
    border: 1px solid rgba(0,0,0,0.14);
    border-radius: 12px;
    background: #f7f7f8;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s ease, background 0.15s ease;
  }

  .kh-classifieds-header-rentals .kh-rentals-mobile-filters-btn:hover {
    border-color: rgba(0,0,0,0.24);
    background: #fafafa;
  }

  .kh-classifieds-header-rentals .kh-rentals-mobile-filters-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
  }

  /* Quick actions row (Map view | Create alert) is useful on desktop too. */
  .kh-classifieds-header-rentals .kh-rentals-mobile-quick {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.65rem;
    padding-top: 0.15rem;
    border-top: 0;
  }

  .kh-classifieds-header-rentals .kh-rentals-mobile-quick-link {
    font-size: 0.85rem;
    font-weight: 650;
    color: #222;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.10);
    background: rgba(0,0,0,0.02);
    opacity: 0.95;
  }

  .kh-classifieds-header-rentals .kh-rentals-mobile-quick-link:hover {
    opacity: 1;
    background: rgba(0,0,0,0.04);
  }

  /* The separator is unnecessary once links are pill buttons */
  .kh-classifieds-header-rentals .kh-rentals-mobile-quick-sep {
    display: none;
  }
}

@media (max-width: 980px) {
  /* Hide the generic "Browse rentals" header on mobile and replace it with the rentals top bar */
  .kh-classifieds-header-rentals {
    display: none;
  }

  .kh-rentals-mobile-top {
    max-width: 1000px;
    margin: 0 auto 0.85rem;
    padding: 0.25rem 0.75rem 0.85rem;
    background: #fff;
    box-sizing: border-box;
  }

  .kh-rentals-mobile-top-label {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0.35rem 0 0.55rem;
    color: #222;
  }

  .kh-rentals-mobile-top-row {
    display: flex;
    align-items: stretch;
    gap: 0.65rem;
    flex-wrap: wrap;
  }

  /* When the bottom mobile menu is active, hide the top quick links (...)
     so mobile matches the classifieds experience (bottom nav only). */
  body.kh-bottom-actions-active .kh-rentals-mobile-quick {
    display: none !important;
  }

  /* On phones, let the results count breathe above the row */
  .kh-results-count {
    width: 100%;
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 0.35rem;
  }

  .kh-rentals-mobile-location-form {
    flex: 1 1 auto;
    margin: 0;
  }

  .kh-rentals-mobile-location-wrap {
    position: relative;
    width: 100%;
  }

  .kh-rentals-mobile-location-input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 14px;
    border: 2px solid rgba(0,0,0,0.15);
    border-radius: 10px;
    font-size: 1rem;
    background: #fff;
    box-sizing: border-box;
  }

  .kh-rentals-mobile-location-input:focus {
    outline: none;
    border-color: rgba(0,0,0,0.35);
  }

  .kh-rentals-mobile-location-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 999px;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    opacity: 0.65;
    cursor: pointer;
    display: none;
  }

  .kh-rentals-mobile-location-clear:hover {
    opacity: 0.95;
  }

  .kh-rentals-mobile-filters-btn {
    height: 48px;
    padding: 0 14px;
    border: 2px solid rgba(0,0,0,0.15);
    border-radius: 10px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
  }

  .kh-rentals-mobile-filters-btn:hover {
    border-color: rgba(0,0,0,0.3);
  }

  .kh-rentals-mobile-filters-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
  }

  .kh-rentals-mobile-quick {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(0,0,0,0.08);
  }

  .kh-rentals-mobile-quick-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    font-weight: 600;
    color: #222;
    padding: 0.35rem 0.1rem;
  }

  .kh-rentals-mobile-quick-link .dashicons {
    opacity: 0.8;
  }

  .kh-rentals-mobile-quick-sep {
    opacity: 0.35;
  }
}

/*
 * Mobile refinements for the rentals vertical
 *
 * The default classifieds layout is optimized for desktop first. On smaller
 * screens (phones and small tablets) the header and card grid need a
 * little help to breathe and feel more like a dedicated rentals app. These
 * rules adjust the grid to a single column, enlarge key typography and
 * restyle the filter actions so they resemble the modern “filter chips”
 * shown in the provided mock‑up. No markup changes are required – these
 * styles simply hook into the existing classes output by the plugin. Feel
 * free to tweak the breakpoints or values as needed.
 */
@media (max-width: 980px) {
  /* Stack grid items into a single column on narrow screens */
  .kh-listing-grid-rentals {
    grid-template-columns: 1fr;
  }
  /* Give rental thumbnails a consistent, taller aspect ratio */
  .kh-card-rental .kh-card-thumb img {
    height: 200px;
    object-fit: cover;
  }
  /* Increase the prominence of the price line */
  .kh-card-rental .kh-card-price {
    font-size: 1.3rem;
    line-height: 1.2;
  }
  /* Slightly bump up meta font sizes for readability */
  .kh-card-rental .kh-card-specs,
  .kh-card-rental .kh-card-location {
    font-size: 0.9rem;
  }
  /* Adjust classifieds header layout */
  .kh-classifieds-header-rentals {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .kh-classifieds-header-rentals .kh-classifieds-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
  }
  /* Style the filter toggle and clear link like buttons */
  .kh-classifieds-header-right {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .kh-classifieds-header-right .kh-filter-toggle,
  .kh-classifieds-header-right .kh-filter-clear {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #f8f8f8;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }
  .kh-classifieds-header-right .kh-filter-toggle:hover,
  .kh-classifieds-header-right .kh-filter-clear:hover {
    background: #f0f0f0;
  }
}
.kh-pagination a,
.kh-pagination span {
  display: inline-block;
  margin: 0 0.25rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  color: #0073aa;
  font-size: 0.9rem;
}
.kh-pagination span.current {
  background: #0073aa;
  color: #fff;
  border-color: #0073aa;
}
.kh-pagination a:hover {
  background: #f0f0f0;
}

/* Action links */
.kh-actions {
  margin-top: 1rem;
}

/* Single listing */
.kh-single-listing .kh-single-thumb img {
  max-width: 100%;
  height: auto;
  margin-bottom: 1rem;
  border-radius: 4px;
}
.kh-meta-fields {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: #333;
}
.kh-meta-fields li {
  margin: 0;
}
.kh-body {
  margin: 1rem 0;
  font-size: 1rem;
  line-height: 1.5;
  color: #333;
}

/* Message form */
.kh-message-form {
  background: #f9f9f9;
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1.5rem;
}
.kh-message-form label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: bold;
}
.kh-message-form input[type="text"],
.kh-message-form textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 0.7rem;
}

/* Inbox */
.kh-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.9rem;
}
.kh-table th,
.kh-table td {
  border: 1px solid #ddd;
  padding: 0.5rem;
}
.kh-message-body-row td {
  background: #fafafa;
}
.kh-message-body {
  white-space: pre-wrap;
  color: #555;
}

/* Notices */
.kh-notice {
  margin-top: 1rem;
  padding: 0.5rem 0.75rem;
  border-left: 4px solid #0073aa;
  background: #eef7fd;
  color: #00446b;
  border-radius: 4px;
}
.kh-success {
  border-color: #0a8a3a;
  background: #e6f4ea;
  color: #0a512b;
}

/* Buttons */
.kh-button {
  display: inline-block;
  background: #0073aa;
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}
.kh-button:hover {
  background: #005f8d;
}
.kh-link {
  text-decoration: underline;
  color: #0073aa;
  font-size: 0.9rem;
}
.kh-link:hover {
  color: #005f8d;
}
/* Toolbar layout */
.kh-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: flex-end;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.75rem;
}
.kh-toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 140px;
}
.kh-toolbar-group--compact .kh-toolbar-range {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.kh-toolbar-search {
  flex: 1 1 220px;
}
.kh-toolbar-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #777;
}
.kh-icon {
  font-size: 16px;
  color: #555;
}
.kh-toolbar-group .kh-icon {
  display: inline-flex;
  align-items: center;
}
.kh-toolbar-actions {
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.kh-range-sep {
  font-size: 0.85rem;
  color: #999;
}

/* Hide mobile bottom actions bar on desktop */
.kh-bottom-actions-bar {
  display: none;
}

/* Rentals vertical: hidden sidebar markup used as a source for the mobile
 * bottom navigation buttons. Keep it in the DOM for JS, but never show it. */
.kh-mobile-nav-source {
  display: none !important;
}

@media (max-width: 980px) {
  .kh-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .kh-toolbar-group,
  .kh-toolbar-actions {
    width: 100%;
  }
}

/* Danger button for delete */
.kh-button--danger {
  background: #c0392b;
}
.kh-button--danger:hover {
  background: #992d22;
}

/* My listings table */
.kh-table-mylistings td,
.kh-table-mylistings th {
  vertical-align: middle;
}

/* === Rentals filter enhancements === */
/* Header on single listings for filter button and clear link */
.kh-single-filters-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.kh-single-filters-header .kh-filter-clear {
  font-size: 0.9rem;
  color: #2563eb;
  text-decoration: none;
}
.kh-single-filters-header .kh-filter-clear:hover {
  text-decoration: underline;
}

/* Adjust the rentals filter modal to look more polished and structured */
/*
 * Adjust the rentals filter modal to use a wider two‑column layout.
 * The previous styling stacked all filter controls vertically which
 * resulted in a very tall modal. We switch to a responsive grid
 * layout so that controls are split across two columns on larger
 * screens, while still stacking on narrow viewports. This helps
 * reduce scrolling and aligns the rentals experience with the
 * personals vertical.
 */
#kh-rentals-filter-modal .kh-modal-dialog {
  /* increase the dialog width to accommodate two columns */
  max-width: 840px;
}
#kh-rentals-filter-modal .kh-modal-body {
  padding: 1rem;
}
#kh-rentals-filter-modal .kh-toolbar {
  /* The rentals toolbar outputs a <form> as its only direct child. */
  border-bottom: none;
  padding-bottom: 0;
}

/* Two clear sides: left (search/location) + right (details) */
#kh-rentals-filter-modal .kh-search-form {
  margin: 0;
}

#kh-rentals-filter-modal .kh-rentals-filter-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

#kh-rentals-filter-modal .kh-rentals-filter-col {
  min-width: 0;
}

#kh-rentals-filter-modal .kh-rentals-filter-col--right {
  border-left: 1px solid #e5e7eb;
  padding-left: 1rem;
}
#kh-rentals-filter-modal .kh-toolbar-group,
#kh-rentals-filter-modal .kh-toolbar-actions {
  width: 100%;
}
#kh-rentals-filter-modal .kh-toolbar-group {
  /* remove individual borders and extra spacing between groups */
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
#kh-rentals-filter-modal .kh-toolbar-group:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
#kh-rentals-filter-modal .kh-toolbar-range,
#kh-rentals-filter-modal .kh-toolbar-checkbox-group,
#kh-rentals-filter-modal .kh-toolbar-search,
#kh-rentals-filter-modal .kh-toolbar-location {
  width: 100%;
}
#kh-rentals-filter-modal .kh-filter-input,
#kh-rentals-filter-modal .kh-search-input,
#kh-rentals-filter-modal .kh-filter-select,
#kh-rentals-filter-modal .kh-toolbar-location input {
  width: 100%;
}
#kh-rentals-filter-modal .kh-toolbar-location input {
  margin-bottom: 0.5rem;
}
#kh-rentals-filter-modal .kh-toolbar-location input:last-child {
  margin-bottom: 0;
}
#kh-rentals-filter-modal .kh-modal-actions {
  padding: 1rem;
  text-align: right;
}
#kh-rentals-filter-modal .kh-modal-actions .kh-button {
  margin-right: 0.5rem;
}

/* Responsive fallback: on narrow screens collapse the two columns into
 * a single column and remove the fixed max‑width so the modal fills
 * the viewport. This prevents horizontal scrolling on mobile. */
@media (max-width: 980px) {
  #kh-rentals-filter-modal .kh-modal-dialog {
    max-width: 100%;
    margin-left: 1rem;
    margin-right: 1rem;
  }
  #kh-rentals-filter-modal .kh-rentals-filter-split {
    grid-template-columns: 1fr;
  }
  #kh-rentals-filter-modal .kh-rentals-filter-col--right {
    border-left: none;
    padding-left: 0;
  }
}

/* ------------------------------------------------------------------
 * Mobile enhancements for rentals and personals
 *
 * The modifications to the rentals filter modal introduced wider
 * layouts and additional structure which sometimes overlapped the
 * mobile navigation bar and obscured the floating filter toggle on
 * very small screens. The following rules explicitly reserve space
 * for the mobile navigation by adding bottom padding to the main
 * content wrapper and raising the z‑index of the floating toggle
 * group so that it always sits above other elements.
 */
@media (max-width: 900px) {
  /* Add bottom padding to the main classifieds area so the fixed
   * footer/navigation on mobile devices isn’t overlapped by content
   */
  .kh-main {
    padding-bottom: 4rem;
  }
  /* Increase z-index of the floating toggle group (sidebar and
   * filters) so it appears above any other fixed elements, such as
   * mobile nav bars injected by the parent theme.
   */
  .kh-floating-toggle-group {
    z-index: 20002;
  }
}

/* Constrain the height of the rentals filter dialog on small screens
 * to avoid covering the mobile navigation bar. By setting a maximum
 * height relative to the viewport minus a small offset, the modal
 * becomes scrollable if its contents exceed the available space. */
@media (max-width: 980px) {
  #kh-rentals-filter-modal .kh-modal-dialog {
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
  }
}

/* ------------------------------------------------------------------
 * New listing form styling
 *
 * The default WordPress form markup used for creating new listings is
 * very bare‑bones. These styles wrap the form in a card and apply
 * consistent padding, borders and shadows so posting a rental listing
 * feels like a polished experience. Inputs, selects and textareas are
 * unified with a subtle border radius, background and font sizing.
 */
.kh-new-listing {
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 1.5rem;
  margin-top: 1rem;
}

/* Ensure headings inside the new listing wrapper stand apart */
.kh-new-listing h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: #0f172a;
}

/* Spacing between field groups */
.kh-new-listing-form p {
  margin-bottom: 1rem;
}

/* Styled inputs, selects and textareas */
.kh-new-listing-form input[type="text"],
.kh-new-listing-form input[type="number"],
.kh-new-listing-form input[type="url"],
.kh-new-listing-form input[type="file"],
.kh-new-listing-form select,
.kh-new-listing-form textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.95rem;
  color: #1f2937;
  background: #ffffff;
  box-sizing: border-box;
}

/* Inputs focus state for accessibility */
.kh-new-listing-form input[type="text"]:focus,
.kh-new-listing-form input[type="number"]:focus,
.kh-new-listing-form input[type="url"]:focus,
.kh-new-listing-form input[type="file"]:focus,
.kh-new-listing-form select:focus,
.kh-new-listing-form textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

/* Labels above inputs */
.kh-new-listing-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #374151;
}

/* Helper text for location fields */
.kh-location-help {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.3rem;
}

/* Mobile: My Listings as cards */
@media (max-width: 980px) {
  .kh-table-mylistings,
  .kh-table-mylistings thead,
  .kh-table-mylistings tbody,
  .kh-table-mylistings th,
  .kh-table-mylistings td,
  .kh-table-mylistings tr {
    display: block;
    width: 100%;
  }

  .kh-table-mylistings thead {
    display: none;
  }

  .kh-table-mylistings tbody tr {
    margin-bottom: 0.9rem;
    padding: 0.85rem 1rem;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #eeeeee;
    box-shadow: 0 3px 10px rgba(0,0,0,0.04);
  }

  .kh-table-mylistings tbody td {
    display: block;
    border: none !important;
    padding: 0.2rem 0 !important;
    font-size: 0.9rem;
    line-height: 1.35;
    word-break: break-word;
  }

  /* Title row: emphasize */
  .kh-table-mylistings tbody td:nth-child(1) {
    font-weight: 600;
    margin-bottom: 0.15rem;
  }

  /* Label chips for other rows */
  .kh-table-mylistings tbody td:nth-child(2)::before,
  .kh-table-mylistings tbody td:nth-child(3)::before,
  .kh-table-mylistings tbody td:nth-child(4)::before {
    display: inline-block;
    min-width: 4.4rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
    margin-right: 0.45rem;
  }

  .kh-table-mylistings tbody td:nth-child(2)::before {
    content: 'Status';
  }
  .kh-table-mylistings tbody td:nth-child(3)::before {
    content: 'Created';
  }
  .kh-table-mylistings tbody td:nth-child(4)::before {
    content: 'Actions';
  }

  /* Actions: keep buttons tidy */
  .kh-table-mylistings tbody td:last-child a,
  .kh-table-mylistings tbody td:last-child button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    margin-right: 0.25rem;
    margin-top: 0.15rem;
  }
}


/* Layout with sidebar */
.kh-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.1rem;
}

/* Full-width pages without the legacy sidebar column (rentals app view). */
.kh-layout.kh-layout--no-sidebar {
  grid-template-columns: 1fr;
}
.kh-layout.kh-layout--no-sidebar .kh-sidebar-column,
.kh-layout.kh-layout--no-sidebar .kh-sidebar {
  display: none;
}
.kh-sidebar {
  background: #f8f9fb;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.kh-sidebar-title {
  margin-top: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.kh-sidebar-title .dashicons {
  font-size: 18px;
}
.kh-menu {
  list-style: none;
  padding-left: 0;
  margin: 0.75rem 0 0;
}
.kh-menu li {
  margin-bottom: 0.4rem;
}
.kh-menu a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
  padding: 0.35rem 0.4rem;
  border-radius: 4px;
}
.kh-menu a .dashicons {
  font-size: 16px;
}
.kh-menu a:hover {
  background: #e5f1fb;
  color: #005f8d;
}
.kh-main {
  min-width: 0;
}

/* Stack layout on mobile */
@media (max-width: 980px) {
  .kh-layout {
    grid-template-columns: 1fr;
  }
}

/* Sidebar column containing Quick Actions and filter box */
.kh-sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
/* Filter box styling */
.kh-filter-box {
  background: #f8f9fb;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.kh-filter-heading {
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
}
/* Category pill list */
.kh-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.kh-category-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  background: #eef2f7;
  color: #333;
  border: 1px solid #dce4ef;
  transition: background 0.15s, color 0.15s;
}
.kh-category-pill:hover {
  background: #e5f1fb;
  color: #005f8d;
}
.kh-category-pill.is-active {
  background: #0073aa;
  color: #fff;
  border-color: #0073aa;
}
/* Filter form styles */
.kh-filter-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.kh-filter-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #777;
}
.kh-filter-input,
.kh-filter-select {
  width: 100%;
  padding: 0.45rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
}
.kh-filter-range {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.kh-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

/* Search bar at top of listings */
.kh-search-bar {
  margin-bottom: 1rem;
}
.kh-search-bar-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.kh-search-submit {
  padding: 0.45rem 0.65rem;
}

/* Listing list styles */
.kh-listing-list {
  margin-top: 0.5rem;
}
.kh-listing-date-header {
  margin-top: 0.85rem;
  margin-bottom: 0.5rem;
}
.kh-listing-date-header span {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  background: linear-gradient(90deg, #f8f9fb 0%, #e5f1fb 50%, #ffffff 100%);
  border-radius: 999px;
  color: #374151;
}
.kh-listing-date-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 0.5rem 0;
}
.kh-listing-row {
  border-bottom: 1px solid #e5e7eb;
  padding: 0.45rem 0;
}
.kh-listing-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.9rem;
}
.kh-listing-line-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.kh-listing-line-title a {
  color: #0073aa;
  text-decoration: none;
}
.kh-listing-line-title a:hover {
  text-decoration: underline;
}
.kh-listing-line-meta {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: #555;
  white-space: nowrap;
}

/* Layout with sidebar */
.kh-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.1rem;
}
.kh-sidebar {
  background: #f8f9fb;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.kh-sidebar-title {
  margin-top: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.kh-sidebar-title .dashicons {
  font-size: 18px;
}
.kh-menu {
  list-style: none;
  padding-left: 0;
  margin: 0.75rem 0 0;
}
.kh-menu li {
  margin-bottom: 0.4rem;
}
.kh-menu a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
  padding: 0.35rem 0.4rem;
  border-radius: 4px;
}
.kh-menu a .dashicons {
  font-size: 16px;
}
.kh-menu a:hover {
  background: #e5f1fb;
  color: #005f8d;
}
.kh-main {
  min-width: 0;
}

/* Stack layout on mobile */
@media (max-width: 980px) {
  .kh-layout {
    grid-template-columns: 1fr;
  }
}

/* Toast notification */
.kh-toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9999;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
  color: #064e3b;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
}
.kh-toast--success {
  /* same palette for now; modifier exists for future variants */
}

/* Optional: unread rows could be bolded later */
.kh-table .kh-message-body-row {
  display: none;
}


/* Conversation view in reply screen */
.kh-conversation {
  margin: 1rem 0 1.25rem;
  padding: 0.75rem 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}
.kh-conversation-heading {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}
.kh-conversation-empty {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: #6b7280;
}
.kh-msg-bubble {
  max-width: 640px;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}
.kh-msg-bubble--me {
  margin-left: auto;
  background: #e0f2fe;
}
.kh-msg-bubble--them {
  margin-right: auto;
  background: #f3f4f6;
}
.kh-msg-meta {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}
.kh-msg-body p {
  margin: 0;
}
.kh-msg-body p + p {
  margin-top: 0.35rem;
}


/* Inbox table responsive styles */
.kh-inbox-table {
  width: 100%;
  border-collapse: collapse;
}

.kh-inbox-table th,
.kh-inbox-table td {
  vertical-align: middle;
}

/* Mobile: show inbox rows as cards */
@media (max-width: 980px) {
  .kh-inbox-table,
  .kh-inbox-table thead,
  .kh-inbox-table tbody,
  .kh-inbox-table th,
  .kh-inbox-table td,
  .kh-inbox-table tr {
    display: block;
    width: 100%;
  }

  .kh-inbox-table thead {
    display: none;
  }

  .kh-inbox-row {
    margin-bottom: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  }

  .kh-inbox-table td {
    padding: 0.55rem 0.9rem;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    white-space: normal;
  }

  .kh-inbox-table td:last-child {
    border-bottom: none;
  }

  .kh-inbox-table td::before {
    content: attr(data-label);
    font-weight: 600;
    margin-right: 0.75rem;
    flex: 0 0 40%;
    max-width: 45%;
    color: #4b5563;
  }

  .kh-actions-cell.kh-inbox-actions {
    flex-direction: column;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-start;
  }

  .kh-actions-cell.kh-inbox-actions .kh-button--icon,
  .kh-actions-cell.kh-inbox-actions a.kh-button--icon {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
  }
}
/* ClassiCore Classifieds – Simplified Inbox mobile layout */
@media (max-width: 980px) {

  /* Base table */
  .kh-inbox-table {
    width: 100%;
    border-collapse: collapse;
  }

  /* Hide header on mobile */
  .kh-inbox-table thead {
    display: none;
  }

  /* Each row becomes a simple card */
  .kh-inbox-table tbody tr {
    display: block;
    padding: 0.9rem 1rem;
    margin-bottom: 0.9rem;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #eeeeee;
    box-shadow: 0 3px 10px rgba(0,0,0,0.04);
  }

  /* Reset cells */
  .kh-inbox-table tbody td {
    display: block;
    border: none !important;
    padding: 0.15rem 0 !important;
    font-size: 0.9rem;
    line-height: 1.35;
    word-break: break-word;
  }

  /* HIDE Date column on mobile (1st column) */
  .kh-inbox-table tbody td:nth-child(1) {
    display: none;
  }

  /* HIDE Listing column on mobile (4th column) */
  .kh-inbox-table tbody td:nth-child(4) {
    display: none;
  }

  /* From */
  .kh-inbox-table tbody td:nth-child(2)::before {
    content: "From: ";
    font-weight: 600;
    color: #777;
    margin-right: 4px;
  }

  /* Subject */
  .kh-inbox-table tbody td:nth-child(3) {
    margin-top: 0.2rem;
  }
  .kh-inbox-table tbody td:nth-child(3)::before {
    content: "Subject: ";
    font-weight: 600;
    color: #777;
    margin-right: 4px;
  }

  /* Actions – buttons aligned to the right */
  .kh-inbox-table tbody td:last-child {
    margin-top: 0.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
  }

  .kh-inbox-table tbody td:last-child a,
  .kh-inbox-table tbody td:last-child button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
  }
}


/* ===== ClassiCore classifieds header + footer shell ===== */
.kh-classifieds-header {
  max-width: 1000px;
  margin: 0 auto 1rem;
  padding: 0.75rem 1rem 0.85rem;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-sizing: border-box;
}

.kh-classifieds-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kh-app-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.1);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #555;
}

.kh-classifieds-title {
  margin: 0;
  font-size: 1.25rem;
}

.kh-classifieds-subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: #666;
}

/* Footer branding */
.kh-classifieds-footer {
  max-width: 1000px;
  margin: 1.25rem auto 0;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 0.78rem;
  text-align: center;
  box-sizing: border-box;
}

.kh-footer-main {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.85;
}

.kh-footer-logo {
  font-weight: 600;
}

.kh-footer-divider {
  opacity: 0.5;
}

.kh-footer-text strong {
  font-weight: 600;
}

/* ===== Accordion styling for filters ===== */
.kh-filter-box {
  margin-top: 1rem;
}

.kh-accordion-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.25rem;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #f7f8fa;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.kh-accordion-toggle:hover {
  background: #f0f2f6;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.kh-accordion-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.kh-accordion-arrow {
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

/* Accordion content: default open via .is-open */
.kh-accordion-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

.kh-accordion-content.is-open {
  max-height: 2000px;
  opacity: 1;
  margin-top: 0.35rem;
}

.kh-accordion-toggle.is-open .kh-accordion-arrow {
  transform: rotate(180deg);
}

/* Keep inner spacing tidy */
.kh-accordion-content .kh-filter-form,
.kh-accordion-content .kh-category-pills,
.kh-accordion-content .kh-filter-heading {
  margin-top: 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 980px) {
  .kh-classifieds-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 980px){
  .kh-table-mylistings tbody td:nth-child(2){display:none !important;}
}

/* Mobile: My Listings button alignment fix */
@media (max-width: 980px){
  .kh-table-mylistings tbody td:last-child{
    display:flex !important;
    flex-direction:row !important;
    justify-content:space-between;
    gap:0.5rem;
  }
  .kh-table-mylistings tbody td:last-child a,
  .kh-table-mylistings tbody td:last-child button{
    flex:1 1 auto !important;
    text-align:center;
    width:100%;
  }
}

/* Mobile fix v30: My Listings buttons normal size */
@media (max-width: 980px){
  .kh-table-mylistings tbody td:last-child{
    display:flex !important;
    flex-direction:row !important;
    justify-content:flex-start;
    gap:0.5rem;
  }
  .kh-table-mylistings tbody td:last-child a,
  .kh-table-mylistings tbody td:last-child button{
    flex:0 0 auto !important;
    width:auto !important;
    padding:0.45rem 0.75rem !important;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    white-space:nowrap;
  }
}


/* Admin footer + settings link */
.kh-admin-footer {
  margin-top: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
}
.kh-admin-link {
  font-size: 0.8rem;
  color: #6b7280;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.kh-admin-link:hover {
  color: #111827;
  text-decoration: underline;
}
.kh-admin-settings h2 {
  margin-top: 0;
}


/* Submission / moderation banners */
.kh-banner {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
}
.kh-banner-info {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.kh-banner-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}


/* Highlight pending listings in admin pending table */
.kh-admin-pending-table tbody tr {
  background-color: #fef9c3;
  border-left: 4px solid #facc15;
}


/* Presence indicator on listing lines */
.kh-listing-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
}

.kh-listing-line-title,
.kh-listing-line-meta {
  display: inline-block;
}

.kh-listing-line-presence {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
}

.kh-listing-line-presence.kh-online {
  color: #16a34a;
}

.kh-listing-line-presence.kh-last-seen {
  color: #6b7280;
}


/* Presence pill on single listing */
.kh-single-presence {
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.kh-meta-author {
  font-weight: 500;
}

.kh-presence-pill {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid transparent;
}

.kh-online-pill {
  background-color: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.kh-last-seen-pill {
  background-color: #f3f4f6;
  color: #4b5563;
  border-color: #e5e7eb;
}

/* Verified active badge */
.kh-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0f766e;
}

.kh-verified-badge::before {
  content: '★';
  font-size: 0.75rem;
}

/* Inbox presence */
.kh-inbox-presence {
  font-size: 0.8rem;
}

.kh-inbox-online {
  color: #16a34a;
}


/* Conversation header presence */
.kh-conversation-with {
  margin-bottom: 0.35rem;
}

.kh-chat-user {
  font-weight: 500;
}

.kh-chat-user--online {
  color: #16a34a;
}

.kh-online-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  margin-right: 0.35rem;
  background-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.35);
  vertical-align: middle;
}

.kh-chat-lastseen {
  font-size: 0.8rem;
  color: #6b7280;
}


/* Inbox table alignment tweaks */
.kh-inbox table {
  width: 100%;
  border-collapse: collapse;
}

.kh-inbox th,
.kh-inbox td {
  vertical-align: middle;
}

.kh-inbox-actions {
  text-align: center;
  white-space: nowrap;
}

/* Locked single-listing image placeholder for free-tier viewers */
.kh-single-image-locked {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #e5e5e5;
  padding: 40px 20px;
  text-align: center;
  margin-bottom: 1.5rem;
}

.kh-single-image-locked::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.5) 0,
    rgba(255, 255, 255, 0.5) 8px,
    rgba(220, 220, 220, 0.5) 8px,
    rgba(220, 220, 220, 0.5) 16px
  );
  filter: blur(3px);
}

.kh-single-image-locked-inner {
  position: relative;
  z-index: 1;
}

.kh-single-image-locked-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  margin: 0 auto 10px;
  font-size: 24px;
  background: rgba(0, 0, 0, 0.06);
}

.kh-single-image-locked-inner p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}


/* Icon for listings that have attached media (image or video). */
.kh-listing-line-media-icon {
  display: inline-block;
  margin-right: 0.35rem;
  font-size: 0.9em;
  vertical-align: text-bottom;
}




.kh-listing-line-media-stack {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.kh-listing-line-media-stack .kh-listing-line-media-icon {
  margin-right: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.kh-listing-line-online-dot {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  min-width: 0.9rem;
  min-height: 0.9rem;
  border-radius: 999px;
  background-color: #22c55e;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  vertical-align: middle;
}

/* === Filters header + modal (DoubleList-style) ======================= */

.kh-classifieds-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  margin-bottom: 1rem;
}

.kh-classifieds-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.kh-classifieds-subtitle {
  margin-top: 0.15rem;
  font-size: 0.85rem;
  color: #6b7280;
}

.kh-classifieds-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kh-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
}

.kh-filter-toggle .dashicons {
  font-size: 16px;
}

.kh-filter-toggle:hover {
  background: #1d4ed8;
}

/* Modal shell */
.kh-filter-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
  padding-bottom: 4vh;
  z-index: 9999;
}

.kh-filter-modal.is-open {
  display: flex;
}

.kh-filter-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.kh-filter-modal-panel {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.32);
  padding: 1rem 1.2rem 0.9rem;
  max-width: 840px;
  width: calc(100% - 2.5rem);
  max-height: 80vh;
  overflow-y: auto;
}

/* Modal header */
.kh-filter-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.kh-filter-modal-title {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
}

.kh-filter-close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #9ca3af;
}

.kh-filter-close:hover {
  color: #4b5563;
}

/* Modal body + sections */
.kh-filter-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.kh-filter-section {
  width: 100%;
}

.kh-filter-section + .kh-filter-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 0.75rem;
}

.kh-filter-section-title {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 0.35rem;
}

/* Grid of fields */

.kh-filter-grid {
  width: 100%;
}

/* New filter layout inspired by DoubleList: two-column card with advanced filters on the left
   and basic filters on the right, separated by a subtle divider. */
.kh-filter-layout-row {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
}

.kh-filter-layout-col {
  flex: 1 1 0;
}

.kh-filter-layout-col-advanced {
  max-width: 340px;
}

.kh-filter-layout-col-basic {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.kh-filter-layout-divider {
  width: 1px;
  background-color: #e5e7eb;
  align-self: stretch;
}

/* Label row with optional lock icon */
.kh-filter-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.kh-filter-lock {
  font-size: 0.9rem;
  color: #9ca3af;
}

/* Make ranges sit neatly on one line */
.kh-filter-field-range .kh-filter-range {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Responsive: stack columns on smaller screens */
@media (max-width: 980px) {
  .kh-filter-layout-row {
    flex-direction: column;
    gap: 1rem;
  }

  .kh-filter-layout-divider {
    display: none;
  }

  .kh-filter-layout-col-basic {
    grid-template-columns: 1fr;
  }

  .kh-filter-layout-col-advanced {
    max-width: 100%;
  }
}
}

.kh-filter-field-range .kh-filter-range {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Actions row */
.kh-filter-actions-inline {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.kh-button.kh-button-primary {
  background: #2563eb;
  color: #ffffff;
  border: none;
}

.kh-button.kh-button-primary:hover {
  background: #1d4ed8;
}

.kh-link-reset {
  font-size: 0.85rem;
  color: #2563eb;
  text-decoration: none;
}

.kh-link-reset:hover {
  text-decoration: underline;
}

/* Responsive tweaks */
@media (max-width: 900px) {
  .kh-filter-modal-panel {
    max-width: 100%;
    width: calc(100% - 1.5rem);
    padding: 1.25rem 1.1rem 1.1rem;
  }

  .kh-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .kh-classifieds-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }
  .kh-classifieds-header-right {
    align-self: stretch;
    justify-content: flex-start;
  }
  .kh-filter-grid {
    grid-template-columns: 1fr;
  }
}


/* Mobile adjustments for filters modal */
@media (max-width: 980px) {
  .kh-filter-modal {
    align-items: flex-start;
    justify-content: center;
    padding: 0 0.5rem;
    overflow-y: auto;
  }
  .kh-filter-modal-panel {
    width: 100%;
    max-width: 100%;
    border-radius: 1rem 1rem 0 0;
    box-shadow: none;
    min-height: calc(100vh - 3.5rem);
    margin-top: 3.5rem;
    padding: 1.25rem 1rem calc(env(safe-area-inset-bottom) + 5rem);
  }
  .kh-filter-modal-body {
    max-height: none;
  }
  .kh-filter-actions-inline {
    margin-top: 1.25rem;
  }
}


/* Age slider UI inside advanced filters */
.kh-filter-age-slider {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.kh-filter-age-slider-track {
  display: flex;
  gap: 0.5rem;
}

.kh-age-slider {
  flex: 1 1 auto;
}

.kh-filter-age-slider-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: #4b5563;
}

.kh-age-label {
  font-weight: 500;
}


/* Location select styling */
.kh-location-select,
.kh-filter-field-location .kh-filter-select,
.kh-location-input,
.kh-filter-field-location .kh-location-input {
  width: 100%;
  margin-bottom: 4px;
}
.kh-location-help {
  font-size: 12px;
  color: #777;
}


/* Mobile + tablet layout tweaks for listing rows: show full title above meta/info */
@media (max-width: 1024px) {
  .kh-listing-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .kh-listing-line-title {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
  }

  .kh-listing-line-meta {
    white-space: normal;
  }

  .kh-listing-line-presence {
    margin-left: 0;
  }
}

/* Enhanced visual separation & accents for the classifieds layout */
.kh-layout {
  padding: 1.5rem 1.5rem 2rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #f4f7fb 0%, #f8fafc 40%, #f5f5ff 100%);
  box-shadow: 0 14px 40px rgba(15,23,42,0.12);
}

/* Sidebar card with subtle accent strip */
.kh-sidebar {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,0.06);
  background: linear-gradient(145deg, #ffffff 0%, #f7fafc 100%);
  box-shadow: 0 10px 24px rgba(15,23,42,0.12);
}

.kh-sidebar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, #0ea5e9, #6366f1);
  opacity: 0.9;
  pointer-events: none;
}

/* Main content card stronger framing */
.kh-wrapper {
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,0.06);
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15,23,42,0.14);
}

/* Admin sidebar section */
.kh-sidebar-title-admin {
  margin-top: 2rem;
}
.kh-admin-menu {
  margin-top: 0.5rem;
}

/* On mobile, ease back outer padding so it doesn't feel cramped */
@media (max-width: 980px) {
  .kh-layout {
    padding: 1rem 0 1.5rem;
    box-shadow: none;
    background: transparent;
  }
  .kh-wrapper {
    box-shadow: 0 8px 20px rgba(15,23,42,0.12);
  }
}




/* Media card styling for single listing images and videos */
.kh-single-thumb,
.kh-single-video-wrapper,
.kh-single-video-container {
    max-width: 320px;
    margin: 1rem auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
    background: #000;
}

/* Ensure images and videos fill the rounded container nicely */
.kh-single-thumb img,
.kh-single-video-wrapper video,
.kh-single-video-container video,
.kh-single-listing .kh-single-video {
    display: block;
    width: 100%;
    height: auto;
}


/* FORCE media sizing in single listing */
.kh-single-thumb,
.kh-single-video-wrapper,
.kh-single-video-container {
    max-width: 320px !important;
    margin: 1rem auto !important;
    border-radius: 15px !important;
    overflow: hidden !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.18) !important;
    background: #000 !important;
}

.kh-single-thumb img,
.kh-single-video-wrapper video,
.kh-single-video-container video {
    max-width: 320px !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
}


/* Watermark/overlay on single listing images to discourage saving */
.kh-single-thumb[data-watermark] {
    position: relative;
}

.kh-single-thumb[data-watermark]::after {
    content: attr(data-watermark);
    position: absolute;
    inset: 0;
    /* Keep overlay invisible except for the text so the image isn't greyed out */
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    display: flex;
    align-items: center;       /* center vertically */
    justify-content: center;    /* center horizontally */
    padding: 8px 10px;
    pointer-events: auto;       /* allow this layer to capture right-clicks instead of the raw image */
    box-sizing: border-box;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* Slightly dim the underlying image when watermark is present */
.kh-single-thumb[data-watermark] img {
    filter: brightness(0.96);
}

/* Optional: match video container feel without watermark text */
.kh-single-video-container,
.kh-single-video-wrapper {
    position: relative;
}


/* Meta chips for city / region / country on browse listings */
.kh-listing-line-meta .kh-meta-chip {
    display: inline-block;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-decoration: none;
}

.kh-listing-line-meta .kh-meta-chip:hover {
    background: rgba(255, 255, 255, 0.14);
}


/* Quick clear link in header */
.kh-classifieds-header-right .kh-filter-clear {
    margin-left: 12px;
    font-size: 13px;
    opacity: 0.85;
    text-decoration: none;
}

.kh-classifieds-header-right .kh-filter-clear:hover {
    text-decoration: underline;
    opacity: 1;
}


/* ClassiCore admin settings: cards + modals */
.kh-admin-settings .kh-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.kh-settings-card {
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
}



/* My Account: membership plans grid/cards (mirror admin settings card style) */
.kh-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}


/* In plan selection modal, use horizontal scrolling cards */
.kh-modal-body .kh-plan-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.kh-modal-body .kh-plan-card {
  flex: 0 0 260px;
}


/* Plan carousel dots */
.kh-plan-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.kh-plan-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(148,163,184,0.6);
  cursor: pointer;
}

.kh-plan-dot.is-active {
  width: 18px;
  background: #111827;
}

/* Mobile tuning for modal carousel */
@media (max-width: 640px) {
  .kh-modal-body .kh-plan-grid {
    padding-bottom: 0.75rem;
  }

  .kh-modal-body .kh-plan-card {
    flex: 0 0 80%;
    max-width: 320px;
  }
}
/* Optional: subtle scrollbar styling */
.kh-modal-body .kh-plan-grid::-webkit-scrollbar {
  height: 6px;
}

.kh-modal-body .kh-plan-grid::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.9);
  border-radius: 999px;
}

.kh-modal-body .kh-plan-grid::-webkit-scrollbar-track {
  background: transparent;
}
.kh-plan-card {
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Plan header band, aligned with primary brand color used in buttons/pagination */
.kh-plan-card h4 {
  margin: 0;
  padding: 0.6rem 0.9rem;
  font-size: 0.98rem;
  font-weight: 600;
  background: #0073aa;
  color: #ffffff;
}

/* Plan body copy */
.kh-plan-card p {
  margin: 0.4rem 0.9rem;
  font-size: 0.9rem;
}

/* Buttons inside the plan card align with content padding */
.kh-plan-card .kh-button,
.kh-plan-card .kh-button-disabled {
  margin: 0.6rem 0.9rem 0.9rem;
}

/* Highlight the user's current plan */
.kh-plan-card.kh-plan-current {
  border-color: #0073aa;
  box-shadow: 0 0 0 1px rgba(0,115,170,0.25);
}

/* My Account summary card */
.kh-account-summary-card {
  border-radius: 10px;
  background: #f9fafb;
  border: 1px solid rgba(0,0,0,0.05);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 2px rgba(15,23,42,0.03);
}

.kh-account-summary-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.kh-account-summary-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: #6b7280;
}
.kh-account-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #eef2ff;
  color: #111827;
  font-size: 16px;
}

.kh-account-delete-card .kh-account-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.kh-account-plan-card .kh-account-icon {
  background: #fef3c7;
  color: #92400e;
}


.kh-account-summary-body {
  margin-top: 0.75rem;
  font-size: 0.92rem;
}

.kh-account-summary-body p {
  margin: 0.2rem 0;
}

/* My Account: upgrade heading spacing */
.kh-account-upgrade-heading {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Plan feature list inside upgrade cards */
.kh-plan-features {
  list-style: disc;
  padding-left: 1.4rem;
  margin: 0.35rem 0.9rem 0.6rem;
  font-size: 0.88rem;
  color: #374151;
}

.kh-plan-features li {
  margin: 0.15rem 0;
}

.kh-settings-card h3 {
  margin: 0;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.kh-settings-card .dashicons {
  font-size: 1.1rem;
}

.kh-settings-helper {
  margin: 0;
  font-size: 0.85rem;
  color: #6b7280;
}

.kh-settings-card .kh-button-secondary {
  align-self: flex-start;
  margin-top: 0.25rem;
}


/* My Account dashboard layout */
.kh-wrapper.kh-account {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.kh-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  align-items: flex-start;
}

.kh-account-summary-card {
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(15,23,42,0.06);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0;
  box-shadow: 0 4px 10px rgba(15,23,42,0.04);
}


.kh-account-summary-header {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.kh-account-summary-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.kh-account-summary-header h2,
.kh-account-summary-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.kh-account-summary-subtitle {
  font-size: 0.85rem;
  color: #6b7280;
}

.kh-account-summary-body p {
  font-size: 0.9rem;
}

.kh-account-plan-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kh-account-export-card .kh-export-textarea {
  width: 100%;
  margin-top: 0.5rem;
  font-family: monospace;
  font-size: 0.8rem;
}

.kh-account-export-card .kh-export-output p {
  margin-bottom: 0.25rem;
}

.kh-account-delete-card {
  border-color: rgba(220, 38, 38, 0.35);
}

.kh-button-danger {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
}

.kh-button-danger:hover,
.kh-button-danger:focus {
  background: #991b1b;
  border-color: #991b1b;
  color: #ffffff;
}

/* On smaller screens, keep cards single-column */
@media (max-width: 640px) {
  .kh-account-grid {
    grid-template-columns: 1fr;
  }
}
/* Modal styling */
.kh-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 100000;
}

.kh-modal.is-open {
  display: block;
}

.kh-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
}

.kh-modal-dialog {
  position: relative;
  max-width: 520px;
  margin: 20vh auto 4vh;
  background: #ffffff;
  border-radius: 10px;
  padding: 1.25rem 1.5rem 1rem;
  box-shadow: 0 10px 30px rgba(15,23,42,0.35);
}

.kh-modal-dialog h3 {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.kh-modal-dialog .description {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.kh-modal-dialog p {
  margin-bottom: 0.65rem;
}

.kh-modal-actions {
  margin-top: 0.75rem;
  text-align: right;
}

/* Make sure modals play nicely inside WP admin */
body.wp-admin .kh-modal {
  position: fixed;
}


/* v2.10.5 – refreshed single listing layout */
.kh-single-listing--v2 {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.kh-single-header {
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(90deg, #f8f9fb 0%, #e5f1fb 50%, #ffffff 100%);
  border-radius: 12px;
}

.kh-single-title {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
}

.kh-single-presence-row {
  font-size: 0.9rem;
  color: #444;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.kh-single-author-name {
  font-weight: 600;
}

.kh-single-layout-main {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}

.kh-single-media-column {
  flex: 0 0 420px;
  max-width: 420px;
}

.kh-single-body-column {
  flex: 1 1 320px;
  max-width: 360px;
}

@media (max-width: 980px) {
  .kh-single-layout-main {
    flex-direction: column;
  }
  .kh-single-media-column,
  .kh-single-body-column {
  flex: 1 1 320px;
  max-width: 360px;
}
}

/* Gallery styles */
.kh-single-gallery {
  display: flex;
  gap: 0.85rem;
  align-items: stretch;
}

.kh-single-gallery-main {
  order: 2;
  flex: 1 1 auto;
  min-width: 0;
}

.kh-single-gallery-main img,
.kh-single-image-main {
  width: 100%;
  height: auto;
  border-radius: 15px;
  display: block;
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.kh-single-gallery-thumbs {
  order: 1;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.55rem;
  margin-top: 0;
  justify-content: flex-start;
  align-items: stretch;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  padding-bottom: 0;
  -webkit-overflow-scrolling: touch;
  max-height: 520px;
}

.kh-single-thumb-link {
  display: block;
  width: 88px;
  height: 66px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 12px;
  margin: 0; /* override theme styles that center anchors */
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.kh-single-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

@media (max-width: 900px) {
  .kh-single-gallery {
    flex-direction: column;
  }
  .kh-single-gallery-main {
    order: 1;
  }
  .kh-single-gallery-thumbs {
    order: 2;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    padding-right: 0;
    padding-bottom: 6px;
    margin-top: 0.65rem;
  }
}


/* v2.10.6 – desktop polish for single listing */
@media (min-width: 900px) {
  .kh-single-layout-main {
    align-items: flex-start;
  }
  .kh-single-media-column {
    padding-right: 1rem;
  }
  .kh-single-body-column {
    padding-left: 1.75rem;
    border-left: 1px solid #eeeeee;
  }
}

/* Single listing: about section */
.kh-single-section {
    margin-top: 16px;
}

/* Rentals single: align section cards (About / Units) with Property details */
.kh-single-section.kh-single-about,
.kh-single-section.kh-single-units {
  background: #fdfdfd;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 1rem;
  margin-top: 1.2rem;
}

/* Units table: clean, Zillow-ish styling */
.kh-units-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.kh-units-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.kh-units-table thead th {
  text-align: left;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #555;
  border-bottom: 1px solid #e9e9e9;
  padding: 0.6rem 0.5rem;
}

.kh-units-table tbody td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.kh-units-table tbody tr:last-child td {
  border-bottom: none;
}

.kh-single-section-title,
.kh-single-body-column .kh-message-form h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(90deg, #f8f9fb 0%, #e5f1fb 50%, #ffffff 100%);
    border-radius: 10px;
    text-transform: none;
    color: #111;
}

.kh-single-section-body {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Contact form card on single listing */
.kh-single-body-column .kh-message-form {
  background: #f8f9fb;
  border-radius: 12px;
  padding: 1rem 1.25rem 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Full-width media block above the location map */
.kh-single-photos-block {
  margin: 0.9rem 0 1rem;
}

.kh-single-photos-block .kh-single-gallery {
  margin-bottom: 0;
}

.kh-single-photos-block .kh-single-video-container {
  margin-top: 0.85rem;
}

/* Slight separation between media area and about text */
.kh-single-media-column .kh-single-gallery {
  margin-bottom: 0.75rem;
}

/* Mobile/tablet: thumbs below main (horizontal strip) */
@media (max-width: 900px) {
  .kh-single-gallery {
    flex-direction: column;
  }
  .kh-single-gallery-main {
    order: 1;
  }
  .kh-single-gallery-thumbs {
    order: 2;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding-right: 0;
    padding-bottom: 6px;
    margin-top: 0.65rem;
    max-height: none;
  }
}


/* Inbox: reply form attachment field */
.kh-message-form .kh-field-attachment {
    margin-top: 10px;
}

.kh-message-form .kh-field-attachment label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.kh-message-form .kh-field-attachment input[type="file"] {
    display: block;
    font-size: 0.9rem;
}

.kh-message-form .kh-field-hint {
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.6);
    margin-top: 2px;
}

.kh-upgrade-hint--attachments {
    font-size: 0.85rem;
    margin-top: 6px;
    color: rgba(0, 0, 0, 0.7);
}

/* Inbox: message attachments in conversation view */
.kh-msg-attachments {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.kh-msg-attachment-link {
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.16);
}

.kh-msg-attachment-img {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: cover;
}

/* Inbox: improved attachment picker */
.kh-message-form .kh-field-attachment--rich {
    margin-top: 12px;
}

.kh-attachment-dropzone {
    border: 1px dashed rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    background: rgba(131, 131, 255, 0.06);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.kh-attachment-dropzone:hover {
    border-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    background: rgba(131, 131, 255, 0.10);
}

.kh-attachment-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kh-attachment-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
}

.kh-attachment-text {
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.8);
}

.kh-field-selected {
    margin-top: 4px;
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.7);
    word-break: break-all;
}

/* My Listings action buttons: icon + label layout */
.kh-action-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Small labels */
.kh-action-button .kh-action-label {
  font-size: 0.85rem;
}

/* Renewal note styling */
.kh-renewal-note {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  max-width: 220px;
}

/* Mobile tweaks for My Listings actions */
@media (max-width: 640px) {
  .kh-table-mylistings td:last-child {
    white-space: normal;
  }

  .kh-action-button {
    flex-direction: column;
    justify-content: center;
    padding: 0.35rem 0.5rem;
  }

  .kh-action-button .kh-action-label {
    font-size: 0.7rem;
    line-height: 1.1;
  }

  .kh-renewal-note {
    display: block;
    margin-top: 0.35rem;
    max-width: 160px;
  }
}

/* Renew count indicator under the Renew button */
.kh-renew-count {
  display: inline-block;
  min-width: 1.5em;
  text-align: center;
  font-weight: 600;
}

.kh-renew-count--ok {
  color: #1a7f37; /* green-ish */
}

.kh-renew-count--none {
  color: #c53030; /* red */
}

.kh-action-button--disabled {
  opacity: 0.6;
  cursor: not-allowed;
}


/* Renew button contrast + lighter background */
.kh-action-button--renew {
  background: #e6f2ff !important;
  border-color: #cfe2ff !important;
  color: #0b5ed7 !important;
}
.kh-action-button--renew:hover {
  background: #d0e7ff !important;
  border-color: #b6d4fe !important;
  color: #084298 !important;
}
/* Ensure renew count stays readable inside the renew button */
.kh-action-button--renew .kh-renew-count--ok {
  color: #084298 !important;
}


/* ClassiCore footer branding & license strip */
.classicore-footer-wrapper {
  margin-top: 24px;
  padding: 12px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.classicore-footer-branding a {
  font-weight: 600;
  text-decoration: none;
}

.classicore-footer-branding a:hover,
.classicore-footer-branding a:focus {
  text-decoration: underline;
}

.classicore-footer-license {
  opacity: 0.7;
}


.classicore-footer-version {
  font-size: 12px !important;
  opacity: 0.8;
}


.classicore-footer-left,
.classicore-footer-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.classicore-footer-version {
  font-size: 12px !important;
  opacity: 0.8;
}

/* Viewer Insights Quick Message modal */
#kh-quick-message-modal .kh-modal-dialog--sm {
  max-width: 480px;
}

.kh-quick-message-viewer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.kh-insights-viewer-avatar-wrap {
  display: inline-flex;
  margin-right: 0.5rem;
}

.kh-insights-viewer-name {
  font-weight: 600;
}

.kh-insights-viewer-date {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-left: 0.35rem;
}

.kh-insights-message-btn {
  float: right;
  margin-left: auto;
  font-size: 0.8rem;
  padding: 2px 10px;
}

.kh-quick-message-status {
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.kh-quick-message-full {
  margin-top: 0.75rem;
  text-align: right;
}

/* Viewer Insights manager modal */
#kh-viewers-manager-modal .kh-modal-dialog--lg {
  max-width: 900px;
}

.kh-viewers-manager-intro {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  opacity: 0.85;
}

.kh-viewers-manager-table {
  border-radius: 0.5rem;
  border: 1px solid rgba(148,163,184,0.4);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.kh-viewers-manager-head,
.kh-viewers-manager-row {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 0.8fr) minmax(0, 1.1fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
}

.kh-viewers-manager-head {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(15,23,42,0.03);
  border-bottom: 1px solid rgba(148,163,184,0.4);
}

.kh-viewers-manager-row:nth-child(odd) {
  background: rgba(15,23,42,0.01);
}

.kh-viewers-manager-col {
  font-size: 0.9rem;
}

.kh-viewers-col-user {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.kh-viewer-listing-hint {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 0.15rem;
}

.kh-viewer-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.kh-viewer-status--new {
  background: rgba(59,130,246,0.12);
  color: #1d4ed8;
}

.kh-viewer-status--contacted {
  background: rgba(16,185,129,0.14);
  color: #047857;
}

.kh-viewers-manager-col.kh-viewers-col-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}

.kh-viewers-manager-actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kh-viewers-manager-note {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Button variation for destructive viewer clear */
.kh-button.kh-button--danger {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}
.kh-button.kh-button--danger:hover {
  background: #991b1b;
  border-color: #991b1b;
}



/* Internal lightbox overlay for single listing images (with watermark support) */
.kh-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease-out;
  z-index: 9999;
}

.kh-lightbox-overlay.kh-lightbox-open {
  opacity: 1;
  pointer-events: auto;
}

.kh-lightbox-inner {
  position: relative;
  max-width: 96vw;
  max-height: 96vh;
}

.kh-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  height: auto;
  width: auto;
  border-radius: 4px;
}

/* Watermark text over lightbox image */
.kh-lightbox-overlay::after {
  content: attr(data-watermark);
  position: absolute;
  left: 50%;
  top: 10%;
  transform: translateX(-50%);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  background: linear-gradient(to right, rgba(0,0,0,0.35), rgba(0,0,0,0.7), rgba(0,0,0,0.35));
  pointer-events: none;
}

/* Close button */
.kh-lightbox-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  border-radius: 999px;
  padding: 2px 9px 4px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.kh-lightbox-close:hover {
  background: rgba(0,0,0,0.8);
}



/* Mobile layout for Identified viewers manager */
@media (max-width: 640px) {
  #kh-viewers-manager-modal .kh-modal-dialog--lg {
    max-width: 100%;
    margin: 0 0.75rem;
  }

  .kh-viewers-manager-head {
    display: none;
  }

  .kh-viewers-manager-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: flex-start;
    border-bottom: 1px solid rgba(148,163,184,0.35);
  }

  .kh-viewers-manager-row:last-child {
    border-bottom: none;
  }

  .kh-viewers-manager-col {
    padding: 0.1rem 0;
  }

  .kh-viewers-manager-col.kh-viewers-col-user {
    padding-bottom: 0.15rem;
  }

  .kh-viewers-manager-col.kh-viewers-col-last,
  .kh-viewers-manager-col.kh-viewers-col-count,
  .kh-viewers-manager-col.kh-viewers-col-status {
    display: flex;
    gap: 0.4rem;
    font-size: 0.8rem;
    opacity: 0.95;
  }

  .kh-viewers-manager-col.kh-viewers-col-last::before,
  .kh-viewers-manager-col.kh-viewers-col-count::before,
  .kh-viewers-manager-col.kh-viewers-col-status::before {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.7rem;
    color: #64748b;
    flex-shrink: 0;
  }

  .kh-viewers-manager-col.kh-viewers-col-last::before {
    content: "Last viewed";
  }

  .kh-viewers-manager-col.kh-viewers-col-count::before {
    content: "Views";
  }

  .kh-viewers-manager-col.kh-viewers-col-status::before {
    content: "Status";
  }

  .kh-viewers-manager-col.kh-viewers-col-actions {
    margin-top: 0.4rem;
    justify-content: flex-start;
  }

  .kh-viewers-manager-col.kh-viewers-col-actions .kh-button {
    flex: 1 1 48%;
    font-size: 0.8rem;
    padding-inline: 0.35rem;
    text-align: center;
  }

  .kh-viewers-manager-table {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    border-radius: 0.75rem;
  }
}


/* Saved listings (bookmark) button */
.kh-save-listing-btn {
  border: none;
  background: transparent;
  padding: 0;
  margin-left: 0.35rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.kh-save-listing-btn .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

.kh-save-listing-btn.kh-saved-active .dashicons {
  color: #f59e0b;
}

.kh-save-listing-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Layout helper for listing card title + bookmark */
.kh-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Single listing header layout when bookmark is present */
.kh-single-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Action cluster (Save + add-on icons) on single listing header */
.kh-single-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Prevent add-on icons from being pushed away from the Save button */
.kh-single-header-actions > * {
  margin-left: 0 !important;
}

/* Saved listings table */
.kh-table-savedlistings th,
.kh-table-savedlistings td {
  vertical-align: middle;
}


.kh-save-listing-btn .kh-save-label {
  margin-left: 4px;
  font-size: 12px;
}


/* Force visibility of save/bookmark button */
.kh-save-listing-btn {
  min-width: 32px;
  min-height: 32px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
}

.kh-save-listing-btn .dashicons {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  color: #4b5563;
}

.kh-save-listing-btn.kh-saved-active .dashicons {
  color: #f59e0b;
}


/* Tooltip for save buttons */
.kh-save-listing-btn[title] {
  position: relative;
}

.kh-save-listing-btn[title]:hover::after {
  content: attr(title);
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.kh-save-listing-btn[title]:hover::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #111827;
  z-index: 9998;
}


/* "Report this ad" link on single listing */
.kh-single-report-row {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.kh-button.kh-button--ghost.kh-report-listing-btn {
  background: transparent;
  border: none;
  color: #6b7280;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

.kh-button.kh-button--ghost.kh-report-listing-btn:hover {
  color: #374151;
}

.kh-report-status {
  font-size: 0.85rem;
}


/* Image modal for single listing/gallery images */
.kh-image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.kh-image-modal.kh-image-modal-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.kh-image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.kh-image-modal-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 1;
}

.kh-image-modal-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  height: auto;
  margin: 0 auto;
}

.kh-image-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 28px;
  text-align: center;
}


/* Blurred gallery for non-upgraded logged-in viewers */
.kh-single-gallery-blurred {
  position: relative;
}

.kh-single-gallery-main-blurred img.kh-single-image-blurred,
.kh-single-gallery-thumbs-blurred img.kh-single-image-blurred {
  filter: blur(10px);
  transform: scale(1.03);
  transition: filter 0.2s ease-out, transform 0.2s ease-out;
}

.kh-single-gallery-blurred:hover img.kh-single-image-blurred {
  filter: blur(11px);
  transform: scale(1.04);
}

.kh-single-thumb-blurred-wrapper {
  display: inline-block;
  margin-right: 4px;
  margin-bottom: 4px;
  overflow: hidden;
  border-radius: 3px;
}

/* blurred overlay removed: clean blur only, no message box */
  100% {
    transform: translateY(0);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}


/* Locked video placeholder, mirroring image locked styling. */
.kh-single-video-locked {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #111827;
  padding: 40px 20px;
  text-align: center;
  margin-bottom: 1.5rem;
}

.kh-single-video-locked::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.16) 0,
    rgba(255, 255, 255, 0.16) 8px,
    rgba(31, 41, 55, 0.2) 8px,
    rgba(31, 41, 55, 0.2) 16px
  );
  filter: blur(3px);
}

.kh-single-video-locked-inner {
  position: relative;
  z-index: 1;
}

.kh-single-video-locked-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  margin: 0 auto 10px;
  font-size: 24px;
  background: rgba(15, 23, 42, 0.55);
}

.kh-single-video-locked-inner p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: #f9fafb;
}

/* Tease-style locked video: show a blurred poster image instead of a solid block. */
.kh-single-video-locked-tease{
  padding: 0;
  background: #000;
}
.kh-single-video-locked-tease::before{display:none}
.kh-single-video-locked-tease img{
  width: 100%;
  display: block;
  max-height: 460px;
  object-fit: cover;
}



/* Mobile off-canvas Quick Actions sidebar with draggable toggle */
@media (max-width: 980px) {

  /* Ensure main layout stacks */
  .kh-layout {
    grid-template-columns: 1fr;
  }

  /* Sidebar becomes an off-canvas drawer */
  .kh-sidebar.kh-sidebar--mobile {
    position: fixed;
    top: 70px; /* adjust if header height changes */
    left: -230px; /* hidden state */
    width: 220px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    z-index: 1000;
    transition: left 0.25s ease;
  }

  .kh-sidebar.kh-sidebar--mobile.kh-sidebar--open {
    left: 0.75rem;
  }

  /* Hide section title on mobile to keep it compact */
  .kh-sidebar.kh-sidebar--mobile .kh-sidebar-title {
    display: none;
  }

  /* Floating toggle group (draggable) */
  .kh-floating-toggle-group {
    position: fixed;
    top: 50%;
    left: 0.75rem;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    z-index: 1001;
  }

  .kh-sidebar-toggle,
  .kh-filter-toggle-floating {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: none;
    background: #005f8d;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    padding: 0;
    cursor: pointer;
  }

  .kh-filter-toggle-floating {
    background: #2563eb; /* slightly different blue to distinguish Filters */
  }

  .kh-sidebar-toggle--dragging {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    transform: scale(1.05);
    opacity: 0.95;
    cursor: grabbing;
  }

  .kh-sidebar-toggle .dashicons,
  .kh-filter-toggle-floating .dashicons {
    font-size: 22px;
    line-height: 1;
  }
}

/* ===============================
 * Rentals: Zillow-style header filters (no modal)
 * =============================== */

.kh-rentals-header-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  width: 100%;
  flex-wrap: wrap;
}

/* Rentals Map View (mobile): when the user scrolls down into cards we collapse
   the large toolbar into a compact sticky bar (Option #2 UX). */
.kh-rentals-mobile-focusbar {
  display: none;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  background: #fff;
}

.kh-rentals-mobile-focusbar .kh-rentals-focusbar-btn,
.kh-rentals-mobile-focusbar .kh-rentals-focusbar-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.02);
  font-weight: 750;
  text-decoration: none;
  color: inherit;
}

.kh-rentals-mobile-focusbar .kh-rentals-focusbar-btn {
  cursor: pointer;
}

.kh-rentals-mobile-focusbar .dashicons {
  width: 18px;
  height: 18px;
  font-size: 18px;
  opacity: 0.85;
}

body.kh-rentals-toolbar-collapsed .kh-rentals-mobile-focusbar {
  display: flex;
  position: sticky;
  top: var(--sb-topbar-offset, 0px);
  z-index: 9998;
}

body.kh-rentals-toolbar-collapsed .kh-rentals-header-row,
body.kh-rentals-toolbar-collapsed .kh-rentals-header-actions {
  display: none;
}

/*
 * v2.15.48: Prevent the rentals toolbar from collapsing on mobile map/split views
 *
 * The original CSS hides the header row and actions when the toolbar enters a
 * collapsed state (typically triggered when scrolling). This behaviour
 * interferes with the revised layout which consolidates Filters, Clear and
 * Alert actions into the header. To ensure these controls remain visible we
 * override the collapse styles below, forcing the header to stay displayed
 * and hiding the mobile focusbar instead. This keeps the user controls
 * persistent and avoids duplicate UI elements.
 */
body.kh-rentals-toolbar-collapsed .kh-rentals-header-row,
body.kh-rentals-toolbar-collapsed .kh-rentals-header-actions {
  display: flex !important;
}
body.kh-rentals-toolbar-collapsed .kh-rentals-mobile-focusbar {
  display: none !important;
}

.kh-rentals-header-form {
  flex: 1 1 720px;
  min-width: 280px;
}

.kh-rentals-header-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
}

/* Keep Apply visible on “in-between” laptop widths where pills overflow.
   We let the filters scroll horizontally rather than wrapping under the button. */
.kh-rentals-header-filters {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.kh-rentals-header-filters::-webkit-scrollbar { height: 6px; }
.kh-rentals-header-filters::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 999px; }
.kh-rentals-header-apply {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}
.kh-rentals-header-filters .kh-rentals-filter,
.kh-rentals-header-filters .kh-rentals-mobile-filters-btn {
  flex: 0 0 auto;
}

.kh-rentals-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}

.kh-rentals-filter .dashicons {
  opacity: 0.75;
}

.kh-rentals-filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-right: 0.25rem;
  white-space: nowrap;
}

.kh-rentals-filter-input,
.kh-rentals-filter-select {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.95rem;
}

.kh-rentals-filter-input {
  width: 110px;
}

.kh-rentals-filter--location {
  /* Keep the search compact so the toolbar feels more like Zillow.
     (Still grows to full width on mobile via the media query below.) */
  flex: 0 1 300px;
  max-width: 360px;
  min-width: 220px;
  padding-left: 0.75rem;
}

/* Clear Location button: styled like a filter pill, not just text */
.kh-rentals-filter--clear {
  flex: 0 0 auto;
  padding: 0;
}

.kh-rentals-clear-location {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  outline: none;
  background: transparent;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  font-weight: 750;
  color: inherit;
}

.kh-rentals-clear-location .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

/* patched: clear wrapper stays, hide only the button */
.kh-rentals-clear-location-btn.is-hidden {
  display: none;
}

.kh-rentals-filter--clear:hover {
  background: rgba(0,0,0,0.03);
}

.kh-rentals-filter--clear:active {
  transform: translateY(0.5px);
}

@media (max-width: 980px) {
  .kh-rentals-filter--location {
    flex: 1 1 100%;
    max-width: none;
  }
}

.kh-rentals-filter--location .kh-rentals-filter-input {
  width: 100%;
  min-width: 180px;
}

.kh-rentals-filter--price .kh-rentals-filter-input {
  width: 88px;
}

.kh-rentals-filter-sep {
  opacity: 0.4;
  font-weight: 700;
}

.kh-rentals-apply {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-weight: 750;
  cursor: pointer;
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.20);
}

.kh-rentals-apply:hover {
  filter: brightness(0.98);
}

.kh-rentals-view-toggle {
  display: inline-flex;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}

.kh-rentals-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.9rem;
  font-weight: 750;
  text-decoration: none;
  color: #111827;
  min-width: 74px;
}

.kh-rentals-toggle-btn.is-active {
  background: rgba(37, 99, 235, 0.10);
  color: #2563eb;
}

.kh-rentals-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Keep the right-side action cluster pinned to the right edge (List/Split/Map). */
.kh-rentals-header-actions-right {
  margin-left: auto;
}

.kh-rentals-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  text-decoration: none;
  color: #111827;
  background: #ffffff;
  font-weight: 700;
}

.kh-rentals-action-link:hover {
  border-color: rgba(0,0,0,0.22);
}

@media (max-width: 820px) {
  .kh-rentals-header-form {
    flex: 1 1 100%;
  }

  /* Let the filter pills scroll horizontally like Zillow on mobile */
  .kh-rentals-header-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .kh-rentals-header-row::-webkit-scrollbar {
    height: 8px;
  }

  .kh-rentals-filter,
  .kh-rentals-apply {
    flex: 0 0 auto;
  }

  .kh-rentals-view-toggle {
    flex: 0 0 auto;
  }
}

/* Hide floating toggle group on desktop */
@media (min-width: 769px) {
  .kh-floating-toggle-group {
    display: none;
  }
}


@media (max-width: 980px) {
  /* Make Filters modal behave more like a side drawer on mobile */
  .kh-filter-modal {
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 4vh;
    padding-bottom: 4vh;
  }

  .kh-filter-modal-dialog {
    margin-left: 0.75rem;
    margin-right: auto;
    max-width: 260px;
    width: 260px;
    max-height: calc(100vh - 8vh);
  }
}




@media (max-width: 980px) {
  /* Hide the large Filters pill button on mobile,
     but keep the quick Clear link if it exists */
  .kh-classifieds-header-right .kh-filter-toggle {
    display: none;
  }
}


/* New listing form helpers */
.kh-field-group {
  margin-bottom: 1rem;
}

.kh-field-counter {
  font-size: 0.8rem;
  font-weight: 500;
  color: #6b7280;
  float: right;
}

.kh-field-help {
  display: inline-block;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: #6b7280;
}

.kh-guidelines-row {
  margin-top: 1rem;
}

.kh-button.kh-button-ghost {
  background: transparent;
  color: #0f172a;
  border: 1px solid rgba(15,23,42,0.15);
}

.kh-button.kh-button-ghost:hover {
  background: rgba(15,23,42,0.03);
}

.kh-guidelines-list {
  margin: 0 0 0.75rem 1.25rem;
  padding: 0;
  font-size: 0.9rem;
  color: #4b5563;
}

.kh-guidelines-list li {
  margin-bottom: 0.35rem;
}

/* Responsive lightbox image constraints */
.kh-lightbox img,
.kh-modal-image img,
.kh-gallery-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

@media (max-width: 980px) {
    .kh-lightbox img,
    .kh-modal-image img,
    .kh-gallery-lightbox img {
        max-width: 95vw;
        max-height: 80vh;
    }
}

/* Explicit sizing for the JS-driven image modal */
.kh-image-modal-img,
.kh-image-modal img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

@media (max-width: 980px) {
    .kh-image-modal-img,
    .kh-image-modal img {
        max-width: 95vw;
        max-height: 80vh;
    }
}

/* Custom autocomplete dropdown for location inputs */
.kh-location-input-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}

/* Rentals header city search uses the same suggestion dropdown styling */
.kh-rentals-filter--location {
  position: relative;
}

.kh-rentals-filter--location .kh-location-suggest {
  width: 100%;
}

.kh-location-input-wrap .kh-location-input {
  width: 100%;
}

.kh-location-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.18);
  margin-top: 2px;
  display: none;
}

.kh-location-suggest-item {
  padding: 6px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #111827;
}

.kh-location-suggest-item:hover {
  background: #eff6ff;
}

/* Upgrade plan card: span full width in account grid */
.kh-account-plan-card.kh-account-plan-card-wide {
  grid-column: 1 / -1;
}

/* Inline plan grid inside account card */
.kh-plan-grid-inline {
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

.kh-plan-card .kh-plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.kh-plan-label {
  font-weight: 600;
}

.kh-plan-pill {
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #e5f3ff;
  color: #0369a1;
}

.kh-plan-copy {
  font-size: 0.85rem;
  margin: 0.1rem 0;
}

/* Highlight Upgrade Your Plan card: premium look */
.kh-account-plan-card-wide {
  background: #fff7e6 !important;
  border: 1px solid #fbbf24 !important;
  box-shadow: 0 6px 16px rgba(251,191,36,0.22) !important;
  position: relative;
}

/* Accent strip */
.kh-account-plan-card-wide::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: #fbbf24;
  border-radius: 4px 0 0 4px;
}

/* My Account main card: span full width on top row */
.kh-account-main-card {
  grid-column: 1 / -1;
}

/* Subtle hover elevation on cards */
.kh-account-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: all 0.15s ease;
}

/* Extra breathing room for the main card */
.kh-account-main-card {
  padding-top: 1.35rem !important;
  padding-bottom: 1.35rem !important;
}

@media (max-width: 980px) {
  body.kh-bottom-actions-active {
    padding-bottom: 3.6rem;
  }

  .kh-bottom-actions-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    padding: 0 env(safe-area-inset-left) env(safe-area-inset-bottom) env(safe-area-inset-right);
    background: #ffffff;
    border-top: 2px solid #2563eb;
    padding-top: 4px;
    padding-bottom: calc(env(safe-area-inset-bottom) + 8px);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    /* Keep the mobile nav above Leaflet controls and theme overlays */
    z-index: 20000;
  }

  .kh-bottom-actions-button {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.25rem 0 0.5rem;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #2563eb;
    text-decoration: none;
  }


  .kh-bottom-actions-button.kh-bottom-actions-active {
    background: rgba(37, 99, 235, 0.08);
    border-radius: 999px;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.18);
    transform: translateY(-2px);
  }

  .kh-bottom-actions-button.kh-bottom-actions-active .dashicons,
  .kh-bottom-actions-button.kh-bottom-actions-active .kh-bottom-actions-label {
    color: #2563eb;
    font-weight: 600;
  }

  .kh-bottom-actions-button .dashicons {
    font-size: 1.15rem;
    line-height: 1;
  }

  .kh-bottom-actions-label {
    font-size: 0.7rem;
    line-height: 1.1;
    font-weight: 500;
  }

  .kh-filter-toggle-floating {
    position: fixed;
    right: 0.85rem;
    bottom: 4.6rem;
    bottom: calc(env(safe-area-inset-bottom) + 4.6rem);
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    z-index: 20001;
    padding: 0;
    cursor: pointer;
  }
}



/* -------------------------------------------------------------------------- */
/* Rentals Map View: full-height map + 2-up cards in the list panel (desktop)  */
/* -------------------------------------------------------------------------- */
.kh-index-rentals.kh-rentals-map-view .kh-rentals-map-shell{
  height: 100%;
  min-height: 0;
}

.kh-index-rentals.kh-rentals-map-view #kh-rentals-map{
  height: 100%;
  min-height: 0 !important;
}

/* Right panel: 2 cards per row on desktop */
.kh-index-rentals.kh-rentals-map-view #kh-rentals-map-list{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  /* Don’t “fit” cards into the viewport by shrinking them.
     Let the panel overflow and scroll (Zillow behavior). */
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
  padding: 12px 8px 18px;
}

/* MapView: the Zillow-style header is injected inside #kh-rentals-map-list.
   Since the list is a 2-column grid on desktop, the header must span both
   columns so the cards start aligned (no staggered/masonry look). */
.kh-index-rentals.kh-rentals-map-view #kh-rentals-map-list .kh-map-list-header,
.kh-rentals-map-view #kh-rentals-map-list .kh-map-list-header{
  grid-column: 1 / -1;
  justify-self: stretch;
}

/* Map View: keep cards from collapsing when the map is zoomed out.
   (If the list panel is short, we want scrolling—not compressed cards.) */
.kh-index-rentals.kh-rentals-map-view #kh-rentals-map-list .kh-card-rental,
.kh-rentals-map-view #kh-rentals-map-list .kh-card-rental {
  min-height: 320px;
  flex: 0 0 auto;
}

/* Ensure the list panel is the scrolling container */
.kh-index-rentals.kh-rentals-map-view #kh-rentals-map-list,
.kh-rentals-map-view #kh-rentals-map-list {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

/* Ensure loading/empty notices span both columns */
.kh-index-rentals.kh-rentals-map-view #kh-rentals-map-list .kh-map-list-loading,
.kh-index-rentals.kh-rentals-map-view #kh-rentals-map-list .kh-map-list-empty,
.kh-index-rentals.kh-rentals-map-view #kh-rentals-map-list .kh-map-list-hint{
  grid-column: 1 / -1;
}

/* If a card class exists, keep it tidy in grid */
.kh-index-rentals.kh-rentals-map-view #kh-rentals-map-list .kh-map-card{
  margin: 0 !important;
  width: 100%;
}

/* Single column on smaller screens */
@media (max-width: 1100px){
  .kh-index-rentals.kh-rentals-map-view #kh-rentals-map-list{
    grid-template-columns: 1fr;
  }
}

/* Map View: when JS sets .kh-rentals-map-view, treat the rentals wrapper as the app shell */
.kh-rentals-map-view .kh-wrapper.kh-index-rentals {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.kh-rentals-map-view .kh-wrapper.kh-index-rentals .kh-rentals-map-shell{
  flex: 1 1 auto;
  min-height: 0;
}


/* Map marker popup: card-style listing preview */
.leaflet-popup-content .kh-map-popup-card{
  width: 240px;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
}
.leaflet-popup-content .kh-map-popup-card .kh-card-media{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: #f3f4f6;
}
.leaflet-popup-content .kh-map-popup-card .kh-card-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}
.leaflet-popup-content .kh-map-popup-body{
  padding: 10px 12px 12px;
}
.leaflet-popup-content .kh-map-popup-price{
  font-weight: 900;
  letter-spacing: .2px;
  font-size: 16px;
  line-height: 1.15;
  margin-bottom: 4px;
}
.leaflet-popup-content .kh-map-popup-badges{
  display:flex;
  flex-wrap:wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.leaflet-popup-content .kh-map-popup-pill{
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.04);
  line-height: 1.2;
}
.leaflet-popup-content .kh-map-popup-specs{
  font-size: 13px;
  opacity: .85;
  margin-bottom: 4px;
}
.leaflet-popup-content .kh-map-popup-loc{
  font-size: 13px;
  opacity: .75;
  margin-bottom: 8px;
}
.leaflet-popup-content .kh-map-popup-actions{
  display:flex;
  justify-content:flex-end;
}
.leaflet-popup-content .kh-map-popup-link{
  font-size: 13px;
  font-weight: 700;
  text-decoration:none;
}
.leaflet-popup-content{
  margin: 10px 12px;
}
.leaflet-popup-tip{
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
}


/* --- Rentals mobile: hide duplicate top nav source (used only for cloning into bottom nav) --- */
.kh-mobile-nav-source{
  display:none !important;
  visibility:hidden !important;
  height:0 !important;
  overflow:hidden !important;
}

/* --- Rentals MapView: compact filters on small screens --- */
/* Some devices / browser emulation report widths >768 while still being effectively mobile.
   Use a slightly larger breakpoint so the Filters pill reliably appears. */
@media (max-width: 900px){
  .kh-classifieds-header-rentals .kh-classifieds-title{
    margin-bottom: 6px;
  }

  /* Hide the bulky inline filters on small screens (use modal instead) */
  .kh-rentals-header-form .kh-rentals-filter--price,
  .kh-rentals-header-form .kh-rentals-filter--beds,
  .kh-rentals-header-form .kh-rentals-filter--type,
  .kh-rentals-header-form .kh-rentals-filter--pets,
  .kh-rentals-header-form .kh-rentals-apply{
    display:none !important;
  }

  /* Make location row tighter */
  .kh-rentals-header-row{
    gap: 10px;
    align-items: center;
  }
  .kh-rentals-filter--location{
    flex: 1 1 auto;
    min-width: 0;
  }
  #kh_rentals_header_city{
    width: 100%;
  }

  .kh-rentals-mobile-filters-btn{
    display:flex !important;
  }
}

/* Mobile filters modal (rentals) */
.kh-rentals-mobile-filters-btn{
  display:none;
  align-items:center;
  justify-content:center;
  gap:8px;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.96);
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
  font-weight: 800;
  cursor: pointer;
}

.kh-rentals-mobile-modal{
  position: fixed;
  left:0; right:0; top:0; bottom:0;
  z-index: 999999;
  display:none;
  background: rgba(0,0,0,0.45);
  padding: 18px;
}

.kh-rentals-mobile-modal.is-open{
  display:flex;
  align-items:flex-end;
}

.kh-rentals-mobile-modal-card{
  width:100%;
  max-width: 520px;
  margin: 0 auto;
  background: rgba(255,255,255,0.98);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(0,0,0,0.25);
  overflow:hidden;
}

.kh-rentals-mobile-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 14px 10px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.kh-rentals-mobile-modal-title{
  font-weight: 900;
  font-size: 14px;
}

.kh-rentals-mobile-modal-close{
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor:pointer;
  padding: 0 6px;
}

.kh-rentals-mobile-modal-body{
  padding: 12px 14px 14px 14px;
  display:flex;
  flex-direction:column;
  gap: 12px;
}

/* Ensure the Photos-only option always sits immediately above the Apply button,
   even if a theme or script appends it after the button. */
.kh-rentals-mobile-modal-body .kh-rentals-mobile-modal-row--photos{
  order: 9998;
}
.kh-rentals-mobile-modal-body .kh-rentals-mobile-apply{
  order: 9999;
}

.kh-rentals-mobile-modal-row{
  display:flex;
  gap: 10px;
  align-items:center;
}

.kh-rentals-mobile-modal-row .kh-rentals-filter{
  flex:1 1 0;
  min-width:0;
}

.kh-rentals-mobile-apply{
  margin-top: 6px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,115,170,0.95);
  color:#fff;
  font-weight: 900;
  cursor:pointer;
}



/* === v2.13.68: Rentals mobile UX polish (hide theme header + compact filters) ===
   Update: allow themes that provide a mobile app-bar (logo + hamburger/drawer) to keep the header.
   If the active theme adds `sb-mobile-drawer-enabled` to the body, we assume it has a mobile nav.
*/
@media (max-width: 980px){
  /* Hide the theme/site top navigation/header on rentals map view to avoid duplicate nav.
     BUT: keep it if the theme is providing its own mobile drawer/app-bar. */
  body.kh-rentals-map-view:not(.sb-mobile-drawer-enabled) header,
  body.kh-rentals-map-view:not(.sb-mobile-drawer-enabled) #masthead,
  body.kh-rentals-map-view:not(.sb-mobile-drawer-enabled) .site-header,
  body.kh-rentals-map-view:not(.sb-mobile-drawer-enabled) .wp-block-template-part,
  body.kh-rentals-map-view:not(.sb-mobile-drawer-enabled) .wp-block-navigation,
  body.kh-rentals-map-view:not(.sb-mobile-drawer-enabled) .wp-block-site-title,
  body.kh-rentals-map-view:not(.sb-mobile-drawer-enabled) .wp-block-site-logo {
    display: none !important;
  }

  /* Keep the header compact: show Location + Filters button only */
  .kh-rentals-map-view .kh-rentals-header-row{
    flex-wrap: wrap !important;
    overflow: visible !important;
  }
  .kh-rentals-map-view .kh-rentals-header-form .kh-rentals-filter--price,
  .kh-rentals-map-view .kh-rentals-header-form .kh-rentals-filter--beds,
  .kh-rentals-map-view .kh-rentals-header-form .kh-rentals-filter--type,
  .kh-rentals-map-view .kh-rentals-header-form .kh-rentals-filter--pets,
  .kh-rentals-map-view .kh-rentals-header-form .kh-rentals-apply{
    display:none !important;
  }

  .kh-rentals-map-view .kh-rentals-filters-btn, .kh-rentals-map-view .kh-rentals-mobile-filters-btn{
    display: inline-flex !important;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.14);
    background: rgba(255,255,255,0.92);
    font-weight: 750;
  }
  .kh-rentals-map-view .kh-rentals-filters-btn, .kh-rentals-map-view .kh-rentals-mobile-filters-btn .kh-rentals-filter-label{
    margin: 0;
  }
}

/* Rentals: mobile-only Filters pill (keeps header compact) */
.kh-rentals-filter--filtersbtn { display: none; }
@media (max-width: 980px){
  .kh-rentals-filter--filtersbtn { display: block; }
}

/* === v2.15.09: Rentals Map View - use Filters modal on ALL screen sizes ===
   IMPORTANT: the map view class lives on the wrapper div `.kh-rentals-map-view` (not always on <body>).
   So we target BOTH, to avoid the "shows for a millisecond" flash then disappears.
*/
body.kh-rentals-map-view .kh-rentals-header-form .kh-rentals-filter--price,
body.kh-rentals-map-view .kh-rentals-header-form .kh-rentals-filter--beds,
body.kh-rentals-map-view .kh-rentals-header-form .kh-rentals-filter--type,
body.kh-rentals-map-view .kh-rentals-header-form .kh-rentals-filter--pets,
body.kh-rentals-map-view .kh-rentals-header-form .kh-rentals-apply,
.kh-rentals-map-view .kh-rentals-header-form .kh-rentals-filter--price,
.kh-rentals-map-view .kh-rentals-header-form .kh-rentals-filter--beds,
.kh-rentals-map-view .kh-rentals-header-form .kh-rentals-filter--type,
.kh-rentals-map-view .kh-rentals-header-form .kh-rentals-filter--pets,
.kh-rentals-map-view .kh-rentals-header-form .kh-rentals-apply{
  display:none !important;
}

body.kh-rentals-map-view .kh-rentals-mobile-filters-btn,
.kh-rentals-map-view .kh-rentals-mobile-filters-btn{
  display:inline-flex !important;
}

/* v2.15.xx: On mobile, use the in-map Filters control only.
   Hide the header "Filters" pill to avoid duplicate / buggy modal behaviour. */
@media (max-width: 980px){
  .kh-rentals-map-view .kh-rentals-header-actions-right .kh-rentals-mobile-filters-btn,
  body.kh-rentals-map-view .kh-rentals-header-actions-right .kh-rentals-mobile-filters-btn{
    display: none !important;
  }
}

/*
 * v2.15.48+: Override map view mobile filters button visibility
 *
 * We removed the floating action buttons on the map and now rely on the header
 * actions (Filters, Clear, Create alert) across all views. The previous CSS
 * hid the header filters pill in map view on small screens to avoid duplicate
 * controls with the floating FAB. Since the FAB has been removed, we need
 * to re-enable the header filters button on mobile map views. The following
 * rule overrides the earlier `display:none` with `inline-flex` so the button
 * remains visible and aligned with the other actions.
 */
@media (max-width: 980px){
  .kh-rentals-map-view .kh-rentals-header-actions-right .kh-rentals-mobile-filters-btn,
  body.kh-rentals-map-view .kh-rentals-header-actions-right .kh-rentals-mobile-filters-btn {
    display: inline-flex !important;
  }
}



/* === v2.15.12: Rentals Map View - normalize City filter strings ("City, Region") === */
.kh-rentals-map-view .kh-classifieds-header-rentals{
  gap: 0.35rem;
  padding-top: 0;
}
.kh-rentals-map-view .kh-classifieds-header-rentals .kh-rentals-header-toolbar{
  margin-top: 0;
  padding-top: 0;
}
.kh-rentals-map-view .kh-rentals-header-row{
  align-items: center;
  flex-wrap: nowrap;
}
.kh-rentals-map-view .kh-rentals-header-left-controls{
  display:flex;
  align-items:center;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-width: 260px;
}
.kh-rentals-map-view .kh-rentals-header-left-controls .kh-rentals-filter--location{
  flex: 1 1 320px;
  max-width: 520px;
  min-width: 220px;
}
.kh-rentals-map-view .kh-rentals-clear-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.92);
  font-weight: 750;
  text-decoration:none;
  color: inherit;
}
.kh-rentals-map-view .kh-rentals-filters-btn{
  display:inline-flex;
  align-items:center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.92);
  font-weight: 750;
  cursor:pointer;
}
.kh-rentals-map-view .kh-rentals-location-grid{
  display:flex;
  align-items:center;
  gap: 0.5rem;
  flex-wrap: wrap;
  width: 100%;
}
.kh-rentals-map-view .kh-rentals-location-grid input{
  flex: 1 1 160px;
  min-width: 140px;
}

/* Map View: don't wrap the 3 location fields inside one giant pill */
.kh-rentals-map-view .kh-rentals-filter--location{
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  gap: 0.6rem;
}
.kh-rentals-map-view .kh-rentals-filter--location .dashicons{
  opacity: 0.75;
  margin-left: 0.35rem;
}
.kh-rentals-map-view .kh-rentals-location-grid input{
  border: 1px solid rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.92);
  border-radius: 14px;
  padding: 0.62rem 0.85rem;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}

/* === v2.15.40: Rentals List View - match Map/Split header UI on mobile ===
   The List view wrapper is `.kh-index-rentals` (no `.kh-rentals-map-view` class),
   so we mirror the key map-view header styles to keep List/Split/Map identical.
*/
.kh-index-rentals .kh-rentals-header-row{
  align-items: center;
  flex-wrap: nowrap;
}
.kh-index-rentals .kh-rentals-header-left-controls{
  display:flex;
  align-items:center;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-width: 260px;
}
.kh-index-rentals .kh-rentals-header-left-controls .kh-rentals-filter--location{
  flex: 1 1 320px;
  max-width: 520px;
  min-width: 220px;
}
.kh-index-rentals .kh-rentals-clear-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.92);
  font-weight: 750;
  text-decoration:none;
  color: inherit;
}
/* List view: don't wrap Location input inside a giant pill (match Map/Split look) */
.kh-index-rentals .kh-rentals-filter--location{
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  gap: 0.6rem;
}
.kh-index-rentals .kh-rentals-filter--location .dashicons{
  opacity: 0.75;
  margin-left: 0.35rem;
}
@media (max-width: 600px){
  .kh-index-rentals .kh-rentals-header-row{
    flex-wrap: wrap;
  }
  .kh-index-rentals .kh-rentals-header-left-controls{
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .kh-index-rentals .kh-rentals-header-left-controls .kh-rentals-filter--location{
    max-width: none;
    flex: 1 1 100%;
  }
}

/* Map View: style the Leaflet base-layer toggle to match the UI */
.kh-rentals-map-view .leaflet-control-layers{
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.14);
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}
.kh-rentals-map-view .leaflet-control-layers-toggle{
  width: 36px;
  height: 36px;
}
/* On small screens, let the location fields stack nicely */
@media (max-width: 600px){
  .kh-rentals-map-view .kh-rentals-header-row{
    flex-wrap: wrap;
  }
  .kh-rentals-map-view .kh-rentals-header-left-controls{
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .kh-rentals-map-view .kh-rentals-header-left-controls .kh-rentals-filter--location{
    max-width: none;
    flex: 1 1 100%;
  }
  .kh-rentals-map-view .kh-rentals-location-grid input{
    flex: 1 1 100%;
    min-width: 0;
  }
}

/*
 * v2.15.50+: Prevent Clear pill from wrapping on map/split views at small widths.
 * The default small-screen rule above forces the location input to take up the
 * full width of the row, causing the Clear pill to wrap onto a new line.
 * We override this behaviour by keeping the left controls on a single row
 * and allowing the location input to flex based on available space.
 */
@media (max-width: 600px){
  .kh-rentals-map-view .kh-rentals-header-left-controls{
    flex-wrap: nowrap !important;
    gap: 0.5rem;
  }
  .kh-rentals-map-view .kh-rentals-header-left-controls .kh-rentals-filter--location{
    flex: 1 1 auto !important;
    max-width: none !important;
    min-width: 0 !important;
  }
}

/* Rentals Alerts UI */
.kh-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:10px 14px;border-radius:12px;text-decoration:none;border:1px solid rgba(0,0,0,.12);font-weight:600;line-height:1}
.kh-btn-primary{background:#0b5cff;color:#fff;border-color:rgba(11,92,255,.35)}
.kh-btn-secondary{background:#fff;color:#111}
.kh-btn-danger{background:#fff;color:#b00020;border-color:rgba(176,0,32,.25)}
.kh-btn:hover{filter:brightness(.98)}
.kh-wrapper.kh-rentals-alert{max-width:900px}
.kh-alert-form{margin-top:14px;display:flex;flex-direction:column;gap:10px}
.kh-alert-criteria-card{padding:12px 14px;border:1px solid rgba(0,0,0,.12);border-radius:14px;background:#fff}
.kh-alert-criteria-title{font-weight:850;font-size:15px;margin-bottom:10px}
.kh-alert-criteria-card .kh-rentals-mobile-modal-row{margin:0}
.kh-alert-criteria-card .kh-rentals-filter{background:transparent;border:0;padding:0}
.kh-alert-criteria-card .kh-rentals-filter-label{min-width:86px}

/* Create Alert (mobile): prevent cramped filter rows by stacking fields and letting inputs fill width */
@media (max-width: 520px){
  .kh-alert-criteria-card{padding:12px}
  .kh-alert-criteria-card .kh-rentals-mobile-modal-row{
    flex-wrap:wrap;
    gap:12px;
    align-items:flex-start;
  }
  .kh-alert-criteria-card .kh-rentals-filter{
    flex:1 1 100%;
    min-width:0;
  }
  .kh-alert-criteria-card .kh-rentals-filter-label{
    display:block;
    min-width:0;
    margin:0 0 6px 0;
    white-space:normal;
  }
  .kh-alert-criteria-card .kh-rentals-filter-input,
  .kh-alert-criteria-card .kh-rentals-filter-select{
    width:100%;
    min-width:0;
  }
  .kh-alert-criteria-card .kh-rentals-filter--price{
    display:grid;
    grid-template-columns: 1fr auto 1fr;
    column-gap:10px;
    row-gap:0;
    align-items:center;
  }
  .kh-alert-criteria-card .kh-rentals-filter--price .kh-rentals-filter-label{
    grid-column:1 / -1;
  }
  .kh-alert-criteria-card .kh-alert-location-hint{
    margin-top:8px;
    line-height:1.35;
  }
}
.kh-field-label{font-weight:700;margin-top:6px}
.kh-input,.kh-select{width:100%;max-width:480px;padding:10px 12px;border-radius:12px;border:1px solid rgba(0,0,0,.15)}
.kh-alert-form-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px}
.kh-alerts-list{margin-top:14px;display:flex;flex-direction:column;gap:10px}
.kh-alert-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border:1px solid rgba(0,0,0,.12);border-radius:14px;background:#fff}
.kh-alert-name{font-weight:800}
.kh-alert-summary{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.kh-alert-chip{display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;border:1px solid rgba(0,0,0,.12);background:rgba(0,0,0,.03);font-size:12px;font-weight:650;line-height:1.2}
.kh-alert-meta{opacity:.8;font-size:14px;margin-top:2px}
.kh-alert-row-actions{display:flex;gap:8px;flex-wrap:wrap}
.kh-alert-success{padding:10px 12px;border-radius:12px;background:rgba(29,189,78,.10);border:1px solid rgba(29,189,78,.25)}
.kh-alert-error{padding:10px 12px;border-radius:12px;background:rgba(176,0,32,.08);border:1px solid rgba(176,0,32,.18)}
.kh-alert-location-hint{margin-top:6px;font-size:12px;opacity:.78;display:block;width:100%}
.kh-alert-location-crumb{display:block;font-weight:650}
.kh-alert-location-sub{display:block;margin-top:2px;opacity:.75}
.kh-alert-inline-error{margin-top:8px;font-size:13px;font-weight:650;color:#b00020}


/* MapView lazy-loaded thumbnails */
.kh-lazy-img {
  opacity: 0;
}
.kh-lazy-loading,
.kh-lazy-loaded {
  opacity: 1;
  transition: opacity .18s ease;
}




/* === Rentals card UI refresh (premium, less flat) === */
.kh-rentals-map-view #kh-rentals-map-list .kh-card-rental,
.kh-index-rentals .kh-cards .kh-card-rental {
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.10);
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.kh-rentals-map-view #kh-rentals-map-list .kh-card-rental:hover,
.kh-index-rentals .kh-cards .kh-card-rental:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(0,0,0,0.14);
  border-color: rgba(0,0,0,0.14);
}

.kh-rentals-map-view #kh-rentals-map-list .kh-card-rental--polished .kh-card-media,
.kh-index-rentals .kh-cards .kh-card-rental--polished .kh-card-media {
  background: #f1f5f9;
}

.kh-rentals-map-view #kh-rentals-map-list .kh-card-rental--polished .kh-card-body,
.kh-index-rentals .kh-cards .kh-card-rental--polished .kh-card-body {
  padding: 12px 14px 14px;
  gap: 6px;
}

.kh-rentals-map-view #kh-rentals-map-list .kh-card-rental--polished .kh-card-price,
.kh-index-rentals .kh-cards .kh-card-rental--polished .kh-card-price {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.15;
  margin: 2px 0 2px;
}

.kh-rentals-map-view #kh-rentals-map-list .kh-card-rental--polished .kh-card-specs,
.kh-index-rentals .kh-cards .kh-card-rental--polished .kh-card-specs {
  font-size: 13px;
  font-weight: 600;
  color: rgba(0,0,0,0.62);
}

.kh-rentals-map-view #kh-rentals-map-list .kh-card-rental--polished .kh-card-location,
.kh-index-rentals .kh-cards .kh-card-rental--polished .kh-card-location {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(0,0,0,0.52);
}

.kh-rentals-map-view #kh-rentals-map-list .kh-card-rental--polished .kh-card-age,
.kh-index-rentals .kh-cards .kh-card-rental--polished .kh-card-age {
  font-size: 12px;
  font-weight: 600;
  color: rgba(0,0,0,0.45);
  margin-top: 4px;
}

.kh-rentals-map-view #kh-rentals-map-list .kh-card-badge,
.kh-index-rentals .kh-cards .kh-card-badge {
  box-shadow: 0 10px 22px rgba(0,0,0,0.18);
}

.kh-rentals-map-view #kh-rentals-map-list .kh-card-heart,
.kh-index-rentals .kh-cards .kh-card-heart {
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}

.kh-rentals-map-view #kh-rentals-map-list .kh-card-rental--polished .kh-card-thumb img,
.kh-index-rentals .kh-cards .kh-card-rental--polished .kh-card-thumb img,
.kh-rentals-map-view #kh-rentals-map-list .kh-card-rental--polished .kh-card-carousel-img,
.kh-index-rentals .kh-cards .kh-card-rental--polished .kh-card-carousel-img {
  transition: transform 0.22s ease;
}

.kh-rentals-map-view #kh-rentals-map-list .kh-card-rental--polished:hover .kh-card-thumb img,
.kh-index-rentals .kh-cards .kh-card-rental--polished:hover .kh-card-thumb img,
.kh-rentals-map-view #kh-rentals-map-list .kh-card-rental--polished:hover .kh-card-carousel-img,
.kh-index-rentals .kh-cards .kh-card-rental--polished:hover .kh-card-carousel-img {
  transform: scale(1.03);
}

/* === End rentals card UI refresh === */


/* Rentals mode badge (My Account) */
.kh-mode-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:2px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  line-height:1.8;
  margin-left:10px;
  vertical-align:middle;
  border:1px solid rgba(0,0,0,0.10);
  background:rgba(0,0,0,0.04);
}
.kh-mode-badge.kh-mode-renter{
  border-color:rgba(0, 120, 255, 0.25);
  background:rgba(0, 120, 255, 0.08);
}
.kh-mode-badge.kh-mode-landlord{
  border-color:rgba(120, 80, 255, 0.25);
  background:rgba(120, 80, 255, 0.08);
}



/* Rentals toolbar: prevent "squashed" controls on very small screens */
@media (max-width: 520px) {
  .kh-rentals-header-row {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
  }

  .kh-rentals-filter--location {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .kh-rentals-filter--clear,
  .kh-rentals-filter--filtersbtn {
    flex: 1 1 calc(50% - 10px) !important;
    min-width: 0 !important;
  }

  .kh-rentals-view-toggle,
  .kh-rentals-header-actions {
    width: 100%;
  }

  .kh-rentals-header-actions {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .kh-rentals-action-link {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/*
 * v2.15.49: Make the Create Alert pill span the full width of the actions
 * row on Split and Map views (mobile). On the list view, the alert pill
 * already wraps beneath the view toggle and fills the available space on
 * narrow screens. To mirror this behaviour on split/map, we scope similar
 * width/justify overrides to the map view wrapper. The selector matches
 * the map view wrapper on both map-only and split layouts.
 */
@media (max-width: 520px) {
  .kh-wrapper.kh-index-rentals.kh-rentals-map-view .kh-rentals-header-row {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
  }
  .kh-wrapper.kh-index-rentals.kh-rentals-map-view .kh-rentals-view-toggle,
  .kh-wrapper.kh-index-rentals.kh-rentals-map-view .kh-rentals-header-actions {
    width: 100%;
  }
  .kh-wrapper.kh-index-rentals.kh-rentals-map-view .kh-rentals-header-actions {
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .kh-wrapper.kh-index-rentals.kh-rentals-map-view .kh-rentals-action-link {
    flex: 1 1 auto;
    justify-content: center;
  }
}


/* -------------------------------------------------------------------------
   Rentals Map: Mobile floating action buttons (Search / Filters / Clear / Alert)
   ------------------------------------------------------------------------- */
@media (max-width: 782px) {
  .kh-index-rentals.kh-rentals-map-view .kh-rentals-mobile-focusbar {
    display: none;
  }
  .kh-index-rentals.kh-rentals-map-view .kh-rentals-map-shell {
    position: relative;
  }
  .kh-index-rentals.kh-rentals-map-view .kh-rentals-map-fab {
    position: absolute;
    right: 12px;
    bottom: 120px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
  }
  .kh-index-rentals.kh-rentals-map-view .kh-rentals-map-fab-btn {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.12);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
  }
  .kh-index-rentals.kh-rentals-map-view .kh-rentals-map-fab-btn:active {
    transform: translateY(1px);
  }
  .kh-index-rentals.kh-rentals-map-view .kh-rentals-map-fab-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
  }

  /* Make the Clear action obvious: turn it into a small pill with text so
     users aren't relying on Dashicons rendering correctly on the frontend. */
  .kh-index-rentals.kh-rentals-map-view .kh-rentals-map-fab-btn.kh-rentals-map-fab-clear {
    width: auto;
    padding: 0 12px;
    border-radius: 999px;
    gap: 6px;
  }
  .kh-index-rentals.kh-rentals-map-view .kh-rentals-map-fab-text {
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
    white-space: nowrap;
  }
}


/* Airbnb-style listing gallery (Rentals) */
.kh-airbnb-gallery{position:relative;margin:0 0 18px 0}
.kh-airbnb-grid{display:grid;grid-template-columns: 1.6fr 1fr;gap:10px;border-radius:14px;overflow:hidden}
.kh-airbnb-hero{display:block;position:relative;min-height:320px}
.kh-airbnb-side{display:grid;grid-template-columns:1fr 1fr;grid-auto-rows:1fr;gap:10px}
.kh-airbnb-tile{display:block;position:relative;min-height:155px}
.kh-airbnb-img{width:100%;height:100%;object-fit:cover;display:block}
.kh-airbnb-video-tile{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;background:rgba(0,0,0,.35)}
.kh-airbnb-video-play{width:54px;height:54px;border-radius:999px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.92);font-size:18px;font-weight:900}
.kh-airbnb-video-label{color:#fff;font-weight:800;font-size:12px;letter-spacing:.02em;text-transform:uppercase;opacity:.95}
.kh-airbnb-showall{position:absolute;right:14px;bottom:14px;border:1px solid rgba(0,0,0,.12);background:#fff;padding:10px 12px;border-radius:10px;font-weight:600;cursor:pointer;box-shadow:0 8px 24px rgba(0,0,0,.12);display:flex;gap:8px;align-items:center}
.kh-airbnb-showall:hover{box-shadow:0 10px 26px rgba(0,0,0,.16)}
.kh-airbnb-showall-ico{font-size:18px;line-height:0}
.kh-airbnb-showall-count{opacity:.7;font-weight:700}
.kh-airbnb-img-blur{filter: blur(24px) brightness(1.05) contrast(.85);transform: scale(1.08)}
.kh-airbnb-gallery-locked{border-radius:14px;overflow:hidden}
.kh-airbnb-lock-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:rgba(255,255,255,.72);backdrop-filter: blur(6px)}
.kh-airbnb-lock-icon{font-size:30px}
.kh-airbnb-lock-text{font-weight:700}

/* Modal (Show all photos) */
#kh-airbnb-modal{position:fixed;inset:0;z-index:999999;display:none}
#kh-airbnb-modal.is-open{display:block}
#kh-airbnb-modal .kh-airbnb-modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.7)}
#kh-airbnb-modal .kh-airbnb-modal-card{position:relative;max-width:1100px;margin:40px auto;background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 30px 80px rgba(0,0,0,.35)}
#kh-airbnb-modal .kh-airbnb-modal-top{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid rgba(0,0,0,.08)}
#kh-airbnb-modal .kh-airbnb-modal-title{font-weight:800}
#kh-airbnb-modal .kh-airbnb-modal-close{border:1px solid rgba(0,0,0,.15);background:#fff;border-radius:10px;padding:8px 10px;cursor:pointer}
#kh-airbnb-modal .kh-airbnb-modal-body{display:grid;grid-template-columns: 1.3fr 1fr;gap:12px;padding:16px}
#kh-airbnb-modal .kh-airbnb-modal-main{border-radius:14px;overflow:hidden;min-height:420px}
#kh-airbnb-modal .kh-airbnb-modal-stage{position:relative;width:100%;height:100%;min-height:420px;background:#000;display:flex;align-items:center;justify-content:center}
#kh-airbnb-modal .kh-airbnb-modal-image{width:100%;height:100%;object-fit:cover;display:block}
#kh-airbnb-modal .kh-airbnb-modal-video{width:100%;height:100%;display:block;object-fit:contain;background:#000}
#kh-airbnb-modal .kh-airbnb-modal-main{position:relative}
#kh-airbnb-modal .kh-airbnb-modal-nav{position:absolute;top:50%;transform:translateY(-50%);width:40px;height:40px;border-radius:999px;border:1px solid rgba(0,0,0,.15);background:rgba(255,255,255,.9);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:22px;line-height:1;box-shadow:0 10px 26px rgba(0,0,0,.22)}
#kh-airbnb-modal .kh-airbnb-modal-nav.prev{left:12px}
#kh-airbnb-modal .kh-airbnb-modal-nav.next{right:12px}
#kh-airbnb-modal .kh-airbnb-modal-count{position:absolute;right:12px;bottom:12px;background:rgba(0,0,0,.65);color:#fff;padding:6px 8px;border-radius:10px;font-weight:700;font-size:12px}
#kh-airbnb-modal .kh-airbnb-modal-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;max-height:420px;overflow:auto;padding-right:6px}
#kh-airbnb-modal .kh-airbnb-modal-thumb{border-radius:12px;overflow:hidden;cursor:pointer;border:2px solid transparent}
#kh-airbnb-modal .kh-airbnb-modal-thumb.is-active{border-color: rgba(0,0,0,.35)}
#kh-airbnb-modal .kh-airbnb-modal-thumb img{width:100%;height:140px;object-fit:cover;display:block}
#kh-airbnb-modal .kh-airbnb-modal-thumb-video{width:100%;height:140px;display:flex;align-items:center;justify-content:center;gap:8px;flex-direction:column;background:rgba(0,0,0,.65);background-size:cover;background-position:center;position:relative}
#kh-airbnb-modal .kh-airbnb-modal-thumb-video::after{content:'';position:absolute;inset:0;background:rgba(0,0,0,.35)}
#kh-airbnb-modal .kh-airbnb-modal-thumb-video .kh-airbnb-play{position:relative;z-index:2;width:42px;height:42px;border-radius:999px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.92);font-weight:900}
#kh-airbnb-modal .kh-airbnb-modal-thumb-video .kh-airbnb-label{position:relative;z-index:2;color:#fff;font-weight:800;font-size:11px;letter-spacing:.02em;text-transform:uppercase}

@media (max-width: 900px){
  .kh-airbnb-grid{grid-template-columns:1fr}
  .kh-airbnb-side{grid-template-columns:repeat(4,1fr);gap:8px}
  .kh-airbnb-hero{min-height:260px}
  .kh-airbnb-tile{min-height:90px}
  #kh-airbnb-modal .kh-airbnb-modal-card{margin:18px;max-width:none}
  #kh-airbnb-modal .kh-airbnb-modal-body{grid-template-columns:1fr}
  #kh-airbnb-modal .kh-airbnb-modal-grid{grid-template-columns:repeat(3,1fr);max-height:240px}
  #kh-airbnb-modal .kh-airbnb-modal-thumb img{height:90px}
  #kh-airbnb-modal .kh-airbnb-modal-thumb-video{height:90px}
}

/* --- ClassiCore: constrain Airbnb modal media on smaller viewports --- */
#kh-airbnb-modal .kh-airbnb-modal-card{
  max-height: calc(100vh - 48px);
}
#kh-airbnb-modal .kh-airbnb-modal-body{
  max-height: calc(100vh - 120px);
  overflow: auto;
}
#kh-airbnb-modal .kh-airbnb-modal-main{
  min-height: 0 !important;
}
#kh-airbnb-modal .kh-airbnb-modal-stage{
  height: clamp(240px, 60vh, 520px);
  max-height: calc(100vh - 160px);
}
#kh-airbnb-modal .kh-airbnb-modal-image,
#kh-airbnb-modal .kh-airbnb-modal-video{
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
}
#kh-airbnb-modal .kh-airbnb-modal-image{ object-fit: contain; background:#000; }
#kh-airbnb-modal .kh-airbnb-modal-video{ object-fit: contain; background:#000; }
@media (max-width: 980px){
  #kh-airbnb-modal .kh-airbnb-modal-body{
    grid-template-columns: 1fr;
  }
}


/* Renew action contrast fix */
.kh-action-renew,
.kh-action-renew a,
.kh-renew-button {
    background:#e6f2ff !important;
    color:#0b5ed7 !important;
    border:1px solid #cfe2ff !important;
}
.kh-action-renew:hover,
.kh-action-renew a:hover,
.kh-renew-button:hover {
    background:#d0e7ff !important;
    color:#084298 !important;
}





/* Mobile: Map-only mode stability (safe)
   Keep Leaflet visible on phones without forcing viewport-locked shells.
*/
@media (max-width: 768px) {
  html.kh-rentals-maponly-mobile,
  body.kh-rentals-maponly-mobile {
    overscroll-behavior-y: none;
  }

  .kh-index-rentals.kh-rentals-map-view.kh-rentals-map-layout-map #kh-rentals-map {
    height: clamp(320px, 52vh, 560px) !important;
    min-height: 320px;
    background: #eef3f8;
  }
}


/* === v2.15.41: Rentals List View (mobile) - match Map/Split header alignment === */
.kh-wrapper.kh-index-rentals:not(.kh-rentals-map-view) .kh-rentals-header-row{
  align-items: center;
  flex-wrap: nowrap;
  justify-content: space-between;
  width: 100%;
}
.kh-wrapper.kh-index-rentals:not(.kh-rentals-map-view) .kh-rentals-header-left-controls{
  display:flex;
  align-items:center;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-width: 260px;
}
.kh-wrapper.kh-index-rentals:not(.kh-rentals-map-view) .kh-rentals-header-left-controls .kh-rentals-filter--location{
  flex: 1 1 320px;
  max-width: 520px;
  min-width: 220px;
}
.kh-wrapper.kh-index-rentals:not(.kh-rentals-map-view) .kh-rentals-clear-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.92);
  font-weight: 750;
  text-decoration:none;
  color: inherit;
}
.kh-wrapper.kh-index-rentals:not(.kh-rentals-map-view) .kh-rentals-header-row-right{
  display:flex;
  align-items:center;
  flex: 0 0 auto;
}
.kh-wrapper.kh-index-rentals:not(.kh-rentals-map-view) .kh-rentals-filters-btn{
  display:inline-flex;
  align-items:center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.92);
  font-weight: 750;
  cursor:pointer;
}
/*
 * When viewing rentals in the list-only layout (i.e. not the map view),
 * the header actions (List/Split/Map toggle + alert button) were occupying
 * the full width of the toolbar. This forced them onto a new row and caused
 * the Clear and Filters pills to misalign relative to the view toggle
 * group. To mirror the split and map views, constrain the actions block to
 * its natural size and allow it to align to the right via auto margins.
 */
.kh-wrapper.kh-index-rentals:not(.kh-rentals-map-view) .kh-rentals-header-actions {
  /* Let the actions size themselves based on their content rather than
     stretching across the full toolbar. */
  width: auto;
  /* Use the default horizontal gap and rely on the surrounding flex
     container (kh-rentals-header-toolbar) to handle spacing. */
  justify-content: flex-start;
}

/* === v2.15.48: Rentals Map/Split View (mobile) - unify header layout === */
/* Align the header row contents (location + clear + filters/view-toggle/alert) consistently
   across list, split and map views. Without these overrides the map view
   header can wrap unpredictably when new actions are added. */
.kh-wrapper.kh-index-rentals.kh-rentals-map-view .kh-rentals-header-row {
  align-items: center;
  flex-wrap: nowrap;
  justify-content: space-between;
  width: 100%;
}
/* Constrain the actions group to its content width in map view, just like list view. */
.kh-wrapper.kh-index-rentals.kh-rentals-map-view .kh-rentals-header-actions {
  width: auto;
  justify-content: flex-start;
}
.kh-wrapper.kh-index-rentals:not(.kh-rentals-map-view) .kh-rentals-header-actions-right {
  /* Push the right-aligned actions group (view toggle + alert) to the far
     edge of the toolbar. */
  margin-left: auto;
  /* Avoid stretching the group across the entire row, which would wrap
     adjacent elements underneath. */
  width: auto;
}
