:root {
  --primary: #e85d4c;
  --primary-dark: #d14a3a;
  --primary-light: #fff5f3;
  --trust-bg: #fdecea;
  --text: #1a1a2e;
  --text-muted: #4a4a68;
  --text-light: #7a7a96;
  --border: #d1d1de;
  --bg: #fafafa;
  --white: #ffffff;
  --success: #22c55e;
  --shadow: 0 8px 24px rgba(26, 26, 46, 0.12);
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  padding: 12px 24px;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-danger {
  background: #b91c1c;
  color: #fff;
  padding: 12px 24px;
}

.btn-danger:hover {
  background: #991b1b;
}

.btn-danger:disabled,
.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 24px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-header-action {
  padding: 10px 16px;
  font-size: 14px;
  white-space: nowrap;
}

.logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-main {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.logo-sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text);
  margin-top: 2px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
  justify-content: center;
  flex-wrap: nowrap;
  min-width: 0;
}

.main-nav a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
  padding: 8px 0;
}

.main-nav a:hover {
  color: var(--text);
}

.main-nav a.active {
  color: var(--primary);
  font-weight: 600;
}

.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
}

.mobile-nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  border: none;
  background: rgba(26, 26, 46, 0.35);
  cursor: pointer;
  z-index: 150;
}

.mobile-nav-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 12px 24px 24px;
  z-index: 160;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
}

.mobile-nav-link {
  display: block;
  padding: 14px 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 8px;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

.mobile-nav-link-action {
  margin-top: 8px;
  border: 1px solid var(--primary);
  color: var(--primary);
  text-align: center;
}

.mobile-nav-login {
  margin-top: 16px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.nav-sub-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
  white-space: nowrap;
  line-height: 1.2;
}

.nav-sub-link:hover,
.nav-sub-link.active {
  color: var(--primary);
}

.nav-dropdown::after {
  content: " ▾";
  font-size: 12px;
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  padding: 6px 14px 6px 6px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.user-menu-trigger:hover,
.user-menu.open .user-menu-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(232, 93, 76, 0.12);
}

.user-menu-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-menu-name {
  font-size: 14px;
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-chevron {
  color: var(--text-light);
  font-size: 12px;
  line-height: 1;
}

.user-menu-backdrop {
  position: fixed;
  inset: 0;
  border: none;
  background: transparent;
  cursor: default;
  z-index: 1000;
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 1001;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.user-menu-item:hover,
.user-menu-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.user-menu-item-danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.user-menu-divider {
  height: 1px;
  margin: 6px 0;
  background: var(--border);
}

.user-menu-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  flex-shrink: 0;
}

.user-menu-icon svg {
  width: 18px;
  height: 18px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  min-height: 400px;
  max-height: 420px;
  background: var(--white);
}

.hero-main {
  position: relative;
  min-height: 400px;
  max-height: 420px;
  overflow: hidden;
}

.hero-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.55) 100%);
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 40px;
  color: var(--white);
}

.hero-content h1 {
  font-size: clamp(32px, 3.5vw, 44px);
  line-height: 1.1;
  font-weight: 800;
  max-width: 520px;
  margin-bottom: 12px;
}

.hero-content p {
  font-size: 16px;
  max-width: 480px;
  opacity: 0.95;
  margin-bottom: 24px;
}

.search-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  max-width: 620px;
}

.search-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.search-tab {
  padding-bottom: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-light);
  border-bottom: 3px solid transparent;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
}

.search-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

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

.search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 16px;
  min-height: 52px;
}

.search-input-wrap svg {
  flex-shrink: 0;
  color: var(--text-light);
}

.search-input-wrap input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 15px;
  outline: none;
  color: var(--text);
}

.search-row .btn-primary {
  min-width: 120px;
  min-height: 52px;
}

.hero-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  max-height: 420px;
  overflow: hidden;
}

.hero-side img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trust-banner {
  background: var(--trust-bg);
  padding: 18px 0;
}

.trust-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
}

.trust-inner strong {
  color: var(--text);
}

.cities {
  padding: 64px 0 80px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-head h2 {
  font-size: 28px;
  font-weight: 700;
}

.section-head a {
  color: var(--primary);
  font-weight: 600;
}

.city-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.city-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(26, 26, 46, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.city-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(26, 26, 46, 0.12);
}

.city-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.city-card-body {
  padding: 14px 16px 18px;
}

.city-card-body h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.city-card-body p {
  font-size: 13px;
  color: var(--text-light);
}

.site-footer {
  background: var(--text);
  color: var(--white);
  padding: 48px 0 24px;
  flex-shrink: 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 32px;
}

.footer-grid h4 {
  margin-bottom: 12px;
  font-size: 14px;
}

.footer-grid a,
.footer-grid .active {
  display: block;
  color: #a0a0b8;
  text-decoration: none;
  margin-bottom: 8px;
  font-size: 14px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 20px;
  color: #a0a0b8;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr;
    max-height: none;
    min-height: 360px;
  }

  .hero-main {
    max-height: none;
    min-height: 360px;
  }

  .hero-side {
    display: none;
  }

  .city-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .main-nav {
    display: none;
  }

  .mobile-nav-toggle {
    display: flex;
  }

  .btn-header-action,
  .btn-header-login {
    display: none;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(1280px, calc(100% - 32px));
  }

  .header-inner {
    min-height: 64px;
    gap: 12px;
  }

  .logo-main {
    font-size: 24px;
  }

  .hero-content {
    padding: 24px 20px;
  }

  .page-content {
    padding: 24px 0 48px;
  }

  .page-title {
    font-size: 24px;
  }

  .site-footer {
    padding: 32px 0 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .results-header {
    flex-direction: column;
    align-items: stretch;
  }

  .results-header select {
    width: 100%;
  }

  .search-tabs {
    gap: 12px;
    overflow-x: auto;
  }

  .search-tab {
    white-space: nowrap;
    font-size: 14px;
  }

  .search-card {
    padding: 16px;
  }

  .search-row .btn-primary {
    width: 100%;
    min-width: 0;
  }

  .user-menu-name,
  .user-menu-chevron {
    display: none;
  }

  .user-menu-trigger {
    padding: 4px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--border);
  }

  .city-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-row {
    flex-direction: column;
  }

  .message-bubble {
    max-width: 88%;
  }

  .message-input-row {
    align-items: center;
  }

  .detail-meta-row {
    flex-wrap: wrap;
  }
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.page-content {
  padding: 32px 0 64px;
}

.saved-listings-page {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.saved-listings-page .container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.saved-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.my-listing-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}

.my-listing-type {
  color: var(--text-muted);
  font-size: 14px;
}

.chip-active {
  background: #dcfce7;
  color: #166534;
}

.chip-inactive {
  background: #fee2e2;
  color: #991b1b;
}

.saved-page-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 0 48px;
}

.saved-empty {
  width: min(480px, 100%);
  margin: 0 auto;
  text-align: center;
  padding: 40px 32px;
}

.saved-empty p {
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 16px;
}

.breadcrumb {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--text-muted);
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-subtitle {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.search-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}

.filter-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.filter-panel h3 {
  font-size: 16px;
  margin-bottom: 16px;
}

.filter-group {
  margin-bottom: 20px;
}

.filter-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.filter-group select,
.filter-group input,
.filter-group textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
}

.filter-group textarea {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.results-count {
  color: var(--text-muted);
  font-size: 15px;
}

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

.saved-listing-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-remove-btn {
  margin-top: auto;
}

.listing-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(26, 26, 46, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.listing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(26, 26, 46, 0.12);
}

.listing-photo {
  position: relative;
  aspect-ratio: 7 / 5;
  overflow: hidden;
}

.listing-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge-verified {
  background: var(--success);
  color: var(--white);
}

.badge-featured {
  background: #f59e0b;
  color: var(--white);
}

.listing-body {
  padding: 16px;
}

.listing-price {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.listing-meta,
.listing-location,
.listing-utilities {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.region-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.region-block h3 {
  font-size: 22px;
  margin-bottom: 16px;
}

.city-link {
  display: block;
  color: #2d6a6a;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.city-stats {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.sub-area-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.sub-area-list a {
  color: var(--text-muted);
  font-size: 14px;
}

.messages-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 560px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.thread-list {
  border-right: 1px solid var(--border);
}

.thread-item {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  width: 100%;
  text-align: left;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  cursor: pointer;
}

.thread-item.active {
  background: var(--primary-light);
}

.thread-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--trust-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.thread-preview {
  font-size: 13px;
  color: var(--text-light);
}

.conversation-panel {
  display: flex;
  flex-direction: column;
}

.conversation-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.conversation-header-main {
  min-width: 0;
  flex: 1;
}

.messages-back-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
}

.messages-back-btn svg {
  width: 20px;
  height: 20px;
}

.message-send-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  padding: 0;
  flex-shrink: 0;
}

.message-send-btn svg {
  width: 20px;
  height: 20px;
}

.message-area {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
}

.message-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
}

.message-bubble.received {
  background: #f0f0f5;
  align-self: flex-start;
}

.message-bubble.sent {
  background: var(--trust-bg);
  align-self: flex-end;
}

.message-input-row {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.message-input-row input {
  flex: 1;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 16px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  grid-template-areas:
    "gallery sidebar"
    "content sidebar";
  gap: 32px;
  align-items: start;
}

.detail-gallery-column,
.detail-content-column,
.detail-sidebar {
  min-width: 0;
}

.detail-gallery-column {
  grid-area: gallery;
}

.detail-content-column {
  grid-area: content;
}

.detail-sidebar {
  grid-area: sidebar;
}

.detail-gallery-main img {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.detail-gallery-label {
  margin: 16px 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.detail-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.detail-gallery-grid-item {
  padding: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.detail-gallery-grid-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.detail-gallery-grid-item.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(196, 30, 58, 0.15);
}

.detail-gallery-grid-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.image-url-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.image-url-row input {
  flex: 1;
}

.photo-upload-panel {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--bg);
}

.photo-upload-input {
  display: none;
}

.photo-upload-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
  cursor: pointer;
}

.photo-upload-hint {
  margin-top: 12px;
  color: var(--text-light);
  font-size: 14px;
}

.photo-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.photo-upload-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.photo-upload-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

.detail-sidebar {
  position: sticky;
  top: 96px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.detail-price {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.detail-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.detail-action-btn {
  width: 100%;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
}

.detail-action-btn-single {
  width: 100%;
  margin-top: 16px;
}

.detail-action-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.detail-action-label {
  line-height: 1;
}

.detail-section {
  margin-top: 32px;
}

.detail-header-card,
.detail-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.detail-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--primary-light);
  color: var(--text);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
}

.detail-subtext {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 6px;
}

.detail-landlord {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}

.detail-landlord strong {
  color: var(--text);
  font-weight: 600;
}

.detail-section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin: 0;
}

.detail-info-item {
  background: var(--bg);
  border-radius: 8px;
  padding: 14px 16px;
}

.detail-info-item dt {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  margin-bottom: 4px;
}

.detail-info-item dd {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.detail-amenities {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.amenity-group-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  margin-bottom: 10px;
}

.amenity-tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.amenity-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.amenity-tag::before {
  content: "✓";
  margin-right: 8px;
  color: var(--success);
  font-weight: 700;
}

.find-roommate-page .find-roommate-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.find-roommate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.roommate-intent-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.roommate-intent-tab {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}

.roommate-intent-tab.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--text);
}

.roommate-empty {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.badge-roommate {
  background: #eef2ff;
  color: #3730a3;
}

.detail-intent-badge {
  margin-bottom: 12px;
}

.listing-type-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  text-decoration: none;
  color: inherit;
}

.detail-section h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.detail-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
}

.detail-list li {
  margin-bottom: 6px;
}

.amenity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 16px;
  margin-bottom: 16px;
}

.amenity-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
}

.post-listing-page .page-subtitle {
  margin-bottom: 0;
}

.post-listing-header {
  margin-bottom: 28px;
}

.post-listing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.post-listing-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-listing-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.form-section-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.form-section-header h2 {
  font-size: 20px;
  margin-bottom: 6px;
}

.form-section-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.form-section-skeleton {
  min-height: 180px;
  background: linear-gradient(90deg, #f3f3f6 25%, #ececf1 50%, #f3f3f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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

.form-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.listing-type-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  background: #fff;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.listing-type-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(196, 30, 58, 0.12);
}

.listing-type-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.listing-type-card span {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.checkbox-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
}

.checkbox-card input {
  margin-top: 3px;
}

.checkbox-card strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.checkbox-card small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.amenity-group {
  margin-bottom: 20px;
}

.amenity-group:last-child {
  margin-bottom: 0;
}

.amenity-group h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.photo-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #f0f0f5;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.btn-compact {
  padding: 10px 16px;
  white-space: nowrap;
}

.sidebar-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.sidebar-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.sidebar-title {
  font-size: 18px;
  line-height: 1.35;
  margin-bottom: 8px;
}

.sidebar-meta {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 8px;
}

.sidebar-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin: 12px 0 4px;
}

.sidebar-note {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.sidebar-tips .detail-list {
  margin-top: 0;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: #f0f0f5;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 24px;
}

.btn-block {
  width: 100%;
  margin-top: 12px;
}

.btn-ghost {
  background: transparent;
  color: #2d6a6a;
  padding: 12px 16px;
}

@media (max-width: 1100px) {
  .search-layout,
  .messages-layout,
  .post-listing-layout {
    grid-template-columns: 1fr;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "gallery"
      "sidebar"
      "content";
    gap: 20px;
  }

  .detail-sidebar {
    position: static;
    top: auto;
  }

  .post-listing-sidebar {
    position: static;
  }

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

  .thread-list {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 768px) {
  .messages-layout {
    min-height: calc(100dvh - 220px);
  }

  .messages-layout-chat-open .thread-list {
    display: none;
  }

  .messages-layout:not(.messages-layout-chat-open) .conversation-panel {
    display: none;
  }

  .messages-back-btn {
    display: inline-flex;
  }
}

@media (min-width: 769px) {
  .messages-back-btn {
    display: none;
  }
}

@media (max-width: 640px) {
  .listing-grid,
  .listing-type-grid,
  .form-row,
  .form-row-3,
  .checkbox-row {
    grid-template-columns: 1fr;
  }

  .detail-title {
    font-size: 22px;
  }

  .detail-header-card,
  .detail-card,
  .detail-sidebar {
    padding: 16px;
  }

  .detail-section {
    margin-top: 20px;
  }

  .detail-section.detail-header-card {
    margin-top: 0;
  }

  .detail-price {
    font-size: 26px;
  }

  .detail-action-label {
    display: none;
  }

  .detail-sidebar-actions {
    flex-direction: row;
  }

  .detail-action-btn,
  .detail-action-btn-single {
    flex: 1;
    min-height: 48px;
    padding: 0;
  }

  .detail-gallery-main img {
    aspect-ratio: 16 / 10;
    border-radius: 10px;
  }

  .detail-gallery-label {
    margin: 12px 0 8px;
    font-size: 14px;
  }

  .detail-gallery-grid {
    display: flex;
    gap: 10px;
    margin-top: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .detail-gallery-grid-item {
    flex: 0 0 84px;
    scroll-snap-align: start;
  }

  .detail-gallery-grid-item img {
    aspect-ratio: 1;
  }

  .detail-info-grid {
    grid-template-columns: 1fr;
  }

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

  .breadcrumb {
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .page-content .container {
    width: min(1280px, calc(100% - 24px));
  }
}

.alert {
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-error {
  background: #fdecec;
  color: #8b1e1e;
  border: 1px solid #f5c2c2;
}

.alert-info {
  background: #eef8f8;
  color: #1f4f4f;
  border: 1px solid #c7e7e7;
}

.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.page-loader {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  place-items: center;
  z-index: 9999;
}

.page-loader-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid #f3d6d2;
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast-stack {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 10000;
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  font-size: 14px;
  animation: slideIn 0.25s ease;
}

.toast-success {
  background: #ecfdf3;
  color: #047857;
  border: 1px solid #bbf7d0;
}

.toast-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.toast-info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.toast-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

@keyframes slideIn {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.account-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.account-type-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  background: #fff;
  text-align: left;
}

.account-type-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(232, 93, 76, 0.15);
}

.account-type-card strong {
  display: block;
  margin-bottom: 4px;
}

.profile-page {
  max-width: 960px;
}

.profile-page-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-grid {
  display: grid;
  gap: 24px;
}

.profile-card h3 {
  margin-bottom: 16px;
  font-size: 18px;
}

.profile-details {
  display: grid;
  gap: 16px;
}

.profile-details dt {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.profile-details dd {
  font-size: 16px;
  color: var(--text);
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.profile-badge-success {
  background: #ecfdf3;
  color: #047857;
}

.profile-badge-warning {
  background: #fff7ed;
  color: #c2410c;
}

.profile-links {
  display: grid;
  gap: 10px;
}

.profile-link {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.profile-link:hover,
.profile-link.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(232, 93, 76, 0.12);
}

.profile-actions-note {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
}

.profile-action-btn {
  margin-bottom: 12px;
}

.profile-action-btn:last-child {
  margin-bottom: 0;
}

.mesho-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.45);
  z-index: 11000;
}

.mesho-modal {
  position: fixed;
  inset: 0;
  z-index: 11001;
  display: grid;
  place-items: center;
  padding: 24px;
}

.mesho-modal-dialog {
  width: min(480px, 100%);
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.mesho-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 0;
}

.mesho-modal-title {
  font-size: 20px;
  font-weight: 700;
}

.mesho-modal-close {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-light);
}

.mesho-modal-body {
  padding: 16px 24px 24px;
  color: var(--text-muted);
  font-size: 15px;
}

.mesho-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 24px 24px;
}

@media (min-width: 768px) {
  .profile-grid {
    grid-template-columns: 1.2fr 1fr;
  }

  .profile-actions-card {
    grid-column: 1 / -1;
  }
}
