.housing-page { background: #f7f2eb; color: #1a1a1a; }
.housing-shell { max-width: 1100px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.housing-nb {
  background: #fff;
  border: 1px solid #eadfd4;
  border-radius: 16px;
  padding: 1.4rem 1.2rem 1.2rem;
  margin-bottom: 1.2rem;
}
.housing-nb h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  color: #172554;
}
.housing-nb-tabs {
  display: flex;
  gap: 1.2rem;
  border-bottom: 1px solid #eadfd4;
  margin-bottom: 1rem;
}
.housing-nb-tabs span {
  padding: 0.35rem 0 0.55rem;
  font-weight: 800;
  color: #8a8178;
}
.housing-nb-tabs span.on {
  color: #ff4d1a;
  border-bottom: 3px solid #ff4d1a;
}
.housing-nb-search {
  display: grid;
  grid-template-columns: 140px 1fr 140px auto;
  gap: 0.45rem;
  align-items: stretch;
}
.housing-nb-search input,
.housing-nb-search select {
  width: 100%;
  border: 1px solid #e0d6cc;
  border-radius: 8px;
  padding: 0.75rem 0.8rem;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}
.housing-nb-nearby-label {
  margin: 0.85rem 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #6b6158;
}
.housing-nb-owner {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid #eadfd4;
  text-align: center;
}
.housing-nb-owner p {
  margin: 0 0 0.7rem;
  font-weight: 700;
  color: #172554;
}
.housing-nb-post {
  min-width: min(100%, 280px);
}
.housing-results { display: grid; gap: 0.85rem; }
.housing-result {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0.9rem;
  background: #fff;
  border: 1px solid #eadfd4;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.housing-result-photo img,
.housing-result-photo .housing-card-ph {
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
  background: #efe8e0;
}
.housing-result-body { padding: 0.85rem 0.95rem 0.95rem 0; }
.housing-result-body h3 { margin: 0 0 0.2rem; font-size: 1.05rem; color: #172554; }
.housing-result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.65rem 0;
  background: #f7f2eb;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}
.housing-result-stats strong { display: block; color: #ff4d1a; }
.housing-result-stats span { font-size: 0.72rem; color: #8a8178; font-weight: 700; }
.housing-result .housing-btn { margin-top: 0.4rem; }
.housing-hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: #ff4d1a;
}
.housing-hero p { margin: 0 0 1rem; color: #5c534c; }
.housing-search {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}
.housing-search input,
.housing-search select,
.housing-form input,
.housing-form select,
.housing-form textarea {
  width: 100%;
  border: 1px solid #e0d6cc;
  border-radius: 8px;
  padding: 0.65rem 0.7rem;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}
.housing-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.housing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ff4d1a;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0.7rem 1.1rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
  -webkit-tap-highlight-color: rgba(255, 77, 26, 0.35);
}
.housing-btn:hover { filter: brightness(1.05); box-shadow: 0 2px 0 #c43210; }
.housing-btn:active {
  transform: scale(0.96) translateY(1px);
  filter: brightness(0.92);
}
.housing-btn:focus-visible { outline: 3px solid #172554; outline-offset: 2px; }
.housing-btn.ghost {
  background: #fff;
  color: #ff4d1a;
  border: 2px solid #ff4d1a;
}
.housing-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.housing-note { font-size: 0.85rem; color: #6b6158; margin-top: 0.7rem; }
.housing-ok {
  background: #e8f7ee;
  border: 1px solid #1f8a4c;
  color: #145c32;
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  font-weight: 700;
  font-size: 0.95rem;
}
.housing-ok[hidden] { display: none; }
.housing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.8rem;
}
.housing-card {
  background: #fff;
  border: 1px solid #eadfd4;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.housing-card img { width: 100%; height: 160px; object-fit: cover; background: #efe8e0; }
.housing-card-ph {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #efe8e0;
  color: #8a8178;
  font-size: 0.85rem;
  font-weight: 700;
}
.housing-card .body { padding: 0.75rem; }
.housing-card h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.housing-card .meta { color: #6b6158; font-size: 0.85rem; }
.housing-card .rent { color: #ff4d1a; font-weight: 800; margin-top: 0.4rem; }
.housing-section { margin: 1.4rem 0; }
.housing-section h2 { font-size: 1.05rem; color: #172554; }
.housing-local-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  background: #fff;
  border: 1px solid #eadfd4;
  border-radius: 12px;
  padding: 0.4rem;
  margin: 0 0 1rem;
  position: sticky;
  top: 0.5rem;
  z-index: 8;
}
.housing-local-nav a {
  text-decoration: none;
  color: #172554;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
}
.housing-local-nav a.on,
.housing-local-nav a:hover {
  background: #fff3ec;
  color: #ff4d1a;
}
.housing-paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 1rem;
}
.housing-path {
  display: block;
  background: #fff8f3;
  border: 1px solid #ffd7c8;
  border-radius: 12px;
  padding: 0.95rem 1rem;
  text-decoration: none;
  color: inherit;
}
.housing-path:hover { border-color: #ff4d1a; }
.housing-path strong { display: block; color: #ff4d1a; margin-bottom: 0.25rem; }
.housing-path span { color: #6b6158; font-size: 0.88rem; line-height: 1.4; }
.housing-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem 0.7rem;
  background: #fff;
  border: 1px solid #eadfd4;
  border-radius: 12px;
  padding: 0.85rem;
  margin: 0 0 1rem;
  align-items: end;
}
.housing-filters label { font-size: 0.78rem; font-weight: 700; color: #5c534c; display: grid; gap: 0.3rem; }
.housing-filters input,
.housing-filters select {
  width: 100%;
  border: 1px solid #e0d6cc;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}
.housing-filter-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  grid-column: 1 / -1;
}
.housing-verify {
  background: #fff;
  border: 1px solid #eadfd4;
  border-left: 4px solid #ff4d1a;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin: 0.8rem 0;
}
.housing-verify h3 { margin: 0 0 0.35rem; color: #172554; font-size: 1rem; }
.housing-verify ul { margin: 0.4rem 0 0.6rem; padding-left: 1.1rem; color: #5c534c; }
.housing-owner-card {
  background: #fff;
  border: 1px solid #eadfd4;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin: 0.55rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  align-items: center;
  justify-content: space-between;
}
.housing-owner-card .meta { color: #6b6158; font-size: 0.88rem; }
.housing-sticky-actions {
  position: sticky;
  bottom: 0.6rem;
  background: #fff;
  border: 1px solid #eadfd4;
  border-radius: 12px;
  padding: 0.7rem;
  margin-top: 1rem;
  box-shadow: 0 8px 24px rgba(23, 37, 84, 0.08);
}
.housing-report {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.housing-status.live { background: #1f8a4c; }
.housing-status.wait { background: #b45309; }
.housing-wake {
  background: #fff;
  border: 1px solid #eadfd4;
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
}
.housing-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.housing-chips a, .housing-amenity {
  border: 1px solid #ff4d1a;
  color: #ff4d1a;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  background: #fff;
}
.housing-detail-hero img { width: 100%; max-height: 380px; object-fit: cover; border-radius: 12px; background: #efe8e0; }
.housing-thumbs { display: flex; gap: 0.4rem; overflow-x: auto; margin-top: 0.5rem; }
.housing-thumbs img { width: 88px; height: 64px; object-fit: cover; border-radius: 8px; cursor: pointer; }
.housing-safety {
  background: #fff3ec;
  border-left: 4px solid #ff4d1a;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  margin: 1rem 0;
}
.housing-warn {
  margin: 0;
  padding: 0.55rem 0.85rem;
  background: #fff8e8;
  border-top: 1px solid #f0d48a;
  color: #7a4b00;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
}
.housing-warn-box {
  border: 1px solid #e2b93b;
  border-left: 4px solid #c47b00;
  border-radius: 10px;
  margin: 0.7rem 0 1rem;
  padding: 0.85rem 0.95rem;
  background: #fff8e8;
  color: #5c3d00;
  font-weight: 600;
}
.housing-warn-box strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #8a4b00;
  font-size: 0.95rem;
}
.housing-warn-box p { margin: 0.35rem 0 0; font-size: 0.88rem; line-height: 1.45; }
.housing-form { display: grid; gap: 0.7rem; background: #fff; padding: 1rem; border-radius: 12px; border: 1px solid #eadfd4; }
.housing-form label { font-size: 0.8rem; font-weight: 700; color: #5c534c; display: grid; gap: 0.3rem; }
.housing-form h3 { margin: 0.2rem 0; color: #172554; }
.housing-field-hint {
  display: block;
  font-weight: 600;
  color: #8a7d72;
  font-size: 0.75rem;
}
.housing-furn-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.housing-furn-card {
  display: grid !important;
  gap: 0.4rem;
  align-content: start;
  min-height: 10.5rem;
  padding: 0.9rem;
  border: 2px solid #eadfd4;
  border-radius: 12px;
  background: #fffdf9;
  cursor: pointer;
}
.housing-furn-card.on,
.housing-furn-card:has(input:checked) {
  border-color: #ff4d1a;
  background: #fff4ef;
}
.housing-furn-card input { width: auto; margin: 0; }
.housing-furn-card strong { color: #172554; font-size: 1rem; }
.housing-furn-card span { font-weight: 600; color: #5c534c; font-size: 0.85rem; line-height: 1.4; }
.housing-amen-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.housing-amen-table th {
  text-align: left;
  font-size: 0.8rem;
  color: #5c534c;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid #eadfd4;
}
.housing-amen-table td {
  width: 33.33%;
  border: 1px solid #eadfd4;
  padding: 0.55rem 0.7rem;
  vertical-align: middle;
}
.housing-amen-table label {
  display: flex !important;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  margin: 0;
}
.housing-amen-table input { width: auto; margin: 0; }
.housing-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.35rem; }
.housing-checks label { font-weight: 600; display: flex; gap: 0.4rem; align-items: center; }
.housing-status { display: inline-block; background: #172554; color: #fff; border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.75rem; }
.housing-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.8rem 0; }
.housing-tabs a, .housing-tabs button {
  border: 2px solid #eadfd4;
  background: #fff;
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  color: #172554;
  font-family: inherit;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  -webkit-tap-highlight-color: rgba(255, 77, 26, 0.35);
}
.housing-tabs a:hover, .housing-tabs button:hover { border-color: #ff4d1a; color: #ff4d1a; }
.housing-tabs a:active, .housing-tabs button:active { transform: scale(0.95); }
.housing-tabs a:focus-visible, .housing-tabs button:focus-visible { outline: 3px solid #ff4d1a; outline-offset: 2px; }
.housing-tabs a.active, .housing-tabs button.active { background: #ff4d1a; color: #fff; border-color: #ff4d1a; }
.housing-tabs a.active:hover, .housing-tabs button.active:hover { color: #fff; }
.housing-chat-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  height: min(72vh, 640px);
  min-height: 420px;
  background: #fff;
  border: 1px solid #eadfd4;
  border-radius: 16px;
  overflow: hidden;
}
.housing-chat-list {
  border-right: 1px solid #eadfd4;
  overflow-y: auto;
  background: #fff;
  min-height: 0;
}
.housing-chat-list .housing-empty,
.housing-chat-list .housing-actions { padding: 0.9rem; }
#chatPane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #f7f2eb;
}
#chatPane > .housing-note,
#chatPane > .housing-empty,
#chatPane > .housing-error {
  margin: auto;
  padding: 1.5rem;
  text-align: center;
}
.housing-chat-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.5rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f0e7dd;
  background: #fff;
  padding: 0.85rem 0.9rem;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  -webkit-tap-highlight-color: rgba(255, 77, 26, 0.25);
}
.housing-chat-item strong {
  font-size: 0.95rem;
  color: #172554;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.housing-chat-item-title,
.housing-chat-item-preview {
  grid-column: 1 / -1;
  display: block;
  font-size: 0.8rem;
  color: #6b6158;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.housing-chat-item-preview { color: #8a8178; }
.housing-chat-item:hover { background: #fff8f3; }
.housing-chat-item.active { background: #fff3ec; }
.housing-chat-item:active { background: #ffe4d6; }
.housing-unread {
  background: #ff4d1a;
  color: #fff;
  border-radius: 999px;
  min-width: 1.3rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  align-self: start;
}
.housing-chat-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: #f7f2eb;
}
.housing-chat-pane > .housing-warn { flex-shrink: 0; }
.housing-chat-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  background: #fff;
  border-bottom: 1px solid #eadfd4;
  flex-shrink: 0;
}
.housing-chat-head strong { color: #172554; }
.housing-chat-head p { margin: 0.15rem 0 0; font-size: 0.85rem; }
.housing-chat-head a { color: #ff4d1a; font-weight: 700; text-decoration: none; }
.housing-chat-back {
  display: none;
  flex-shrink: 0;
  border: 2px solid #ff4d1a;
  background: #fff;
  color: #ff4d1a;
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}
.housing-chat-back:active { transform: scale(0.96); }
.housing-chat-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.housing-chat-thread .housing-empty { margin: auto; text-align: center; }
.housing-msg {
  max-width: 78%;
  align-self: flex-start;
  background: #fff;
  border: 1px solid #eadfd4;
  border-radius: 14px 14px 14px 4px;
  padding: 0.55rem 0.75rem;
}
.housing-msg p {
  margin: 0.2rem 0 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.housing-msg-meta { font-size: 0.72rem; color: #8a8178; font-weight: 700; }
.housing-msg.mine {
  align-self: flex-end;
  background: #ff4d1a;
  color: #fff;
  border-color: #ff4d1a;
  border-radius: 14px 14px 4px 14px;
}
.housing-msg.mine .housing-msg-meta { color: rgba(255,255,255,0.85); }
.housing-compose {
  display: flex;
  gap: 0.45rem;
  margin: 0;
  padding: 0.75rem;
  background: #fff;
  border-top: 1px solid #eadfd4;
  flex-shrink: 0;
}
.housing-compose input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e0d6cc;
  border-radius: 999px;
  padding: 0.7rem 0.95rem;
  font: inherit;
}
.housing-compose input:focus {
  outline: 2px solid #ff4d1a;
  border-color: #ff4d1a;
}
.housing-compose .housing-btn { border-radius: 999px; min-width: 5.5rem; }
.housing-chat-pane > .housing-error { margin: 0; padding: 0 0.9rem 0.7rem; background: #fff; }
.housing-error { color: #b42318; font-size: 0.95rem; font-weight: 700; }
.housing-empty { color: #6b6158; padding: 1rem 0; }
.housing-steps { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.8rem; }
.housing-steps span {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a8178;
}
.housing-steps span.on { color: #ff4d1a; }
.housing-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
@media (max-width: 800px) {
  .housing-search, .housing-two, .housing-paths, .housing-filters, .housing-nb-search, .housing-furn-grid { grid-template-columns: 1fr; }
  .housing-amen-table thead { display: none; }
  .housing-amen-table, .housing-amen-table tbody, .housing-amen-table tr, .housing-amen-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .housing-result { grid-template-columns: 1fr; }
  .housing-result-body { padding: 0.85rem; }
  .housing-chat-layout {
    grid-template-columns: 1fr;
    height: 70vh;
    min-height: 0;
  }
  .housing-chat-back { display: inline-flex; }
  .housing-chat-layout.has-open .housing-chat-list { display: none; }
  .housing-chat-layout:not(.has-open) #chatPane { display: none; }
}
@media (max-width: 560px) {
  .housing-search { grid-template-columns: 1fr; }
}
