* {
  box-sizing: border-box;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  background: #f5f7fb;
  color: #1a2233;
}

.topbar {
  background: #111a31;
  color: #fff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topbar .brand {
  font-weight: 700;
}

.topbar .nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar .nav a {
  color: #dce4ff;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
}

.topbar .nav a:hover {
  background: #1e2a4d;
}

.topbar .nav .nav-greeting {
  color: #ffffff;
  font-weight: 600;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #1e2a4d;
  white-space: nowrap;
}

.auth-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #33466f;
  background: #1e2a4d;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.auth-hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.container {
  max-width: 1920px;
  margin: 24px auto;
  padding: 0 28px;
}

.card {
  background: #fff;
  border: 1px solid #dbe1ee;
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 18px;
}

h1, h2, h3 {
  margin-top: 0;
}

form {
  display: grid;
  gap: 10px;
}

label {
  font-weight: 600;
  font-size: 14px;
}

input, select, textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #cbd4e6;
  border-radius: 8px;
  background: #fff;
}

textarea {
  min-height: 90px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.amenity-fieldset {
  border: 1px solid #dbe1ee;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0;
}

.amenity-fieldset legend {
  font-weight: 600;
  font-size: 14px;
  padding: 0 6px;
}

.amenity-hint {
  margin: 0 0 10px;
  font-size: 13px;
}

.amenity-checkboxes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}

.amenity-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
}

.amenity-check input {
  width: auto;
  margin: 0;
}

.button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  background: #2f64ff;
  color: #fff;
  font-weight: 600;
}

.button.secondary {
  background: #eef2ff;
  color: #2440a0;
}

.button.danger {
  background: #c73636;
}

.home-search-actions {
  justify-content: center;
}

.home-search-button {
  min-width: 220px;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 18px;
}

.price-slider-field {
  border: 0;
  padding: 0;
  margin: 0;
}

.price-slider-field legend {
  font-weight: 600;
  font-size: 14px;
  padding: 0;
  margin-bottom: 6px;
}

.price-slider-values {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #56617b;
  font-size: 13px;
  margin-top: 6px;
}

.price-range-slider {
  --price-min: 0%;
  --price-max: 100%;
  position: relative;
  height: 34px;
}

.price-range-slider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 15px;
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(
      to right,
      #cfd7e8 0,
      #cfd7e8 var(--price-min),
      #2f64ff var(--price-min),
      #2f64ff var(--price-max),
      #cfd7e8 var(--price-max),
      #cfd7e8 100%
    );
}

.price-range-slider input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  margin: 0;
  background: transparent;
  pointer-events: none;
  appearance: none;
}

.price-range-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
}

.price-range-slider input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border: 0;
  border-radius: 999px;
  background: #2f64ff;
  cursor: pointer;
  pointer-events: auto;
  appearance: none;
}

.price-range-slider input[type="range"]::-moz-range-track {
  height: 6px;
  background: transparent;
}

.price-range-slider input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: #2f64ff;
  cursor: pointer;
  pointer-events: auto;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-row {
  align-items: center;
  justify-content: center;
  background: #f3f6ff;
  border: 1px solid #cfd8ef;
  border-radius: 12px;
  padding: 10px 12px;
  gap: 14px;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-num-btn {
  min-width: 2.5rem;
  justify-content: center;
}

#pageState {
  font-size: 15px;
  font-weight: 600;
  color: #2a3d73;
  padding: 0 2px;
}

.muted {
  color: #56617b;
  font-size: 14px;
}

.row {
  border: 1px solid #dbe1ee;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  background: #fafcff;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #ebf0ff;
  color: #23439f;
}

.pill.approved { background: #e2f8ea; color: #1f7a3f; }
.pill.rejected { background: #fdeaea; color: #9f2e2e; }
.pill.pending { background: #fff3d7; color: #8d6300; }

.space-top {
  margin-top: 10px;
}

.edit-panel {
  border-top: 1px solid #dbe1ee;
  padding-top: 12px;
  margin-top: 10px;
}

.thumb-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.edit-thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #dbe1ee;
}

.area-line {
  margin: 6px 0 8px;
}

.address-area-line {
  margin: 6px 0 8px;
}

.area-label {
  font-weight: 600;
  color: #3a4560;
}

.muted.area-line .area-label {
  color: #56617b;
}

.area-line-detail {
  color: #1a2233;
  font-size: 15px;
  line-height: 1.45;
  background: #f4f6fb;
  border: 1px solid #dbe1ee;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0 14px;
}

.area-line-detail .area-label {
  color: #1a2233;
}

.area-link {
  color: #2440a0;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.area-link:hover {
  color: #1a2f7a;
}

.area-sep {
  margin: 0 6px;
  color: #9aa4bd;
  font-weight: 400;
  text-decoration: none;
}

.area-none {
  color: #9aa4bd;
}

.area-directory {
  align-items: start;
}

.area-directory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.area-directory-link {
  display: inline-block;
  padding: 8px 10px;
  border: 1px solid #dbe1ee;
  border-radius: 999px;
  background: #f4f6fb;
  color: #2440a0;
  font-weight: 600;
  text-decoration: none;
}

.area-directory-link:hover {
  background: #eef2ff;
  color: #1a2f7a;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.listing-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.listing-card {
  border: 1px solid #dbe1ee;
  border-radius: 10px;
  padding: 14px;
  background: #fbfdff;
}

.listing-card h3 {
  margin-bottom: 4px;
}

.listing-title-link {
  color: #1a2233;
  text-decoration: none;
}

.listing-title-link:hover {
  color: #2440a0;
  text-decoration: underline;
}

.listing-cover {
  width: 100%;
  height: 210px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid #dbe1ee;
}

.listing-cover-wrap {
  position: relative;
}

.detail-contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.detail-contact-grid.has-contact-owner {
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  align-items: start;
}

.favorite-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.95);
  color: #6a768f;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.favorite-btn.active {
  color: #d72f5d;
  border-color: rgba(215, 47, 93, 0.45);
  background: #fff0f5;
}

.detail-hero {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #dbe1ee;
}

.thumb-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

.thumb {
  width: 100%;
  height: 75px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #cfd7e8;
  cursor: pointer;
}

.thumb.active {
  border: 2px solid #2f64ff;
}

.toast-wrap {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 8px;
  z-index: 9999;
}

.toast {
  min-width: 220px;
  max-width: 320px;
  border-radius: 10px;
  padding: 10px 12px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.toast.success { background: #19703d; }
.toast.error { background: #a13131; }
.toast.info { background: #2b4eac; }

@media (max-width: 1280px) {
  .container {
    padding: 0 20px;
  }

  .listing-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 720px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .container {
    margin-top: 16px;
    padding: 0 12px;
  }

  .card {
    padding: 14px;
  }

  .button {
    width: 100%;
    text-align: center;
  }

  .actions {
    flex-direction: column;
  }

  .pagination-row {
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }

  .pagination-row .button {
    width: auto;
  }

  .listing-grid {
    grid-template-columns: 1fr;
  }

  .detail-contact-grid.has-contact-owner {
    grid-template-columns: 1fr;
  }
}
