/* 공실 찾기 페이지 (rooms/index.html, assets/js/rooms.js)
   구미공실 화면 구성을 본떴다: 유형 탭 → 조건 상자 → 정렬·보기 도구 → 표 또는 카드 → 페이지.
   색과 글꼴은 style.css 를 그대로 쓴다. */

.rooms-page { padding-block: 28px 72px; }
.rooms-page h1 { font-family: var(--f-d); font-weight: 700; font-size: clamp(28px, 6vw, 44px); line-height: 1.24; letter-spacing: -.035em; }
.rooms-head { margin-bottom: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 유형 탭 ---------- */
.rm-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; margin: 0 -2px 14px; }
.rm-tabs::-webkit-scrollbar { display: none; }
.rm-tab {
  flex: none; display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  min-height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 800; font-size: 15px; color: var(--ink);
  border: 1px solid var(--glass-edge); background: var(--gloss), var(--glass);
  box-shadow: var(--hi), 0 2px 8px rgba(40, 32, 0, .07);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.rm-tab:hover { transform: translateY(-2px); box-shadow: var(--hi), var(--depth); }
.rm-tab[aria-selected="true"] { background: var(--gloss), linear-gradient(180deg, #2b2b28, #0e0e0d); color: var(--y); border-color: rgba(255, 255, 255, .15); }
.rm-tab:disabled { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }
.rm-tab .chip-n { opacity: .75; }
.rm-tab[aria-selected="true"] .chip-n { opacity: .85; }

/* ---------- 조건 상자 ---------- */
.rm-filter {
  border: 1px solid var(--glass-edge); border-radius: 24px; background: var(--gloss), var(--glass);
  box-shadow: var(--hi), var(--depth); margin-bottom: 18px; overflow: hidden;
}
.rm-filter-toggle {
  display: none; width: 100%; align-items: center; gap: 10px; min-height: 52px; padding: 0 18px;
  border: 0; background: transparent; font-weight: 800; font-size: 15.5px; cursor: pointer; text-align: left;
}
.rm-filter-toggle svg { width: 20px; height: 20px; flex: none; }
.rm-filter-n { margin-left: auto; background: var(--ink); color: var(--y); border-radius: 999px; font-size: 12.5px; padding: 2px 10px; }
.rm-filter-body { display: grid; gap: 14px; padding: 18px 18px 16px; }
.rm-row { display: grid; gap: 8px 18px; grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .rm-row { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
  .rm-row-wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
}
.rm-group { display: grid; gap: 7px; min-width: 0; border: 0; margin: 0; padding: 0; }
.rm-group > legend, .rm-group > .rm-label { font-size: 13px; font-weight: 800; color: var(--ink-2); padding: 0; }
.rm-checks { display: flex; flex-wrap: wrap; gap: 7px; }
.rm-check { position: relative; }
.rm-check input { position: absolute; opacity: 0; pointer-events: none; }
.rm-check span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
  border: 1px solid rgba(18, 18, 18, .1); background: rgba(255, 255, 255, .7);
  box-shadow: inset 0 1px 0 #fff, 0 1px 4px rgba(40, 32, 0, .06);
  transition: background .15s ease, transform .15s ease;
}
.rm-check span .chip-n { margin-left: 2px; }
.rm-check:hover span { transform: translateY(-1px); }
.rm-check input:checked + span { background: var(--gloss), linear-gradient(180deg, #ffe54a, #ffcc00); border-color: rgba(255, 255, 255, .9); box-shadow: var(--hi), 0 4px 12px rgba(255, 196, 0, .35); }
.rm-check input:disabled + span { opacity: .4; cursor: not-allowed; }
.rm-check input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.rm-select, .rm-input {
  width: 100%; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); min-height: 44px;
  border: 1px solid rgba(18, 18, 18, .1); border-radius: 14px; padding: 0 14px; background: rgba(255, 255, 255, .78);
  box-shadow: inset 0 2px 4px rgba(40, 32, 0, .05);
}
.rm-select { cursor: pointer; }
.rm-select:focus, .rm-input:focus { outline: 0; border-color: rgba(255, 204, 0, .9); box-shadow: inset 0 2px 4px rgba(40, 32, 0, .05), 0 0 0 4px rgba(255, 212, 0, .35); }
.rm-range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.rm-range span { font-weight: 700; color: var(--muted); }
.rm-search { display: flex; gap: 8px; }
.rm-search .rm-input { flex: 1; min-width: 0; }
.rm-reset {
  flex: none; min-height: 44px; padding: 0 16px; border-radius: 14px; cursor: pointer; font-weight: 800; font-size: 14px;
  border: 1px solid rgba(18, 18, 18, .1); background: rgba(255, 255, 255, .7); color: var(--ink-2);
}
.rm-reset:hover { background: #fff; color: var(--ink); }
@media (max-width: 759px) {
  .rm-filter-toggle { display: flex; }
  .rm-filter-body { display: none; padding-top: 4px; }
  .rm-filter.is-open .rm-filter-body { display: grid; }
}

/* ---------- 도구 줄 ---------- */
.rm-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin-bottom: 14px; }
.rm-result { font-weight: 800; font-size: 15.5px; }
.rm-result small { font-weight: 600; color: var(--muted); margin-left: 6px; }
.rm-tools-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rm-seg { display: inline-flex; border: 1px solid var(--glass-edge); border-radius: 999px; background: var(--gloss), var(--glass); box-shadow: var(--hi), 0 2px 8px rgba(40, 32, 0, .07); padding: 3px; }
.rm-seg button { min-height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; font-weight: 800; font-size: 14px; cursor: pointer; color: var(--ink-2); }
.rm-seg button[aria-pressed="true"] { background: var(--ink); color: var(--y); }
.rm-tool-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  font-weight: 800; font-size: 14px; color: var(--ink);
  border: 1px solid var(--glass-edge); background: var(--gloss), var(--glass); box-shadow: var(--hi), 0 2px 8px rgba(40, 32, 0, .07);
}
.rm-tool-btn svg { width: 18px; height: 18px; }
.rm-tool-btn[aria-pressed="true"] { background: var(--gloss), linear-gradient(180deg, #ffe54a, #ffcc00); }
@media (max-width: 599px) { .rm-tools-right .sort { font-size: 13px; } .rm-tool-btn { padding: 0 11px; } }

/* ---------- 지도 ---------- */
.rm-map-box { margin-bottom: 18px; }
.rm-map { margin-top: 0; }
.rm-map .gm-region.is-picked path { fill: url(#gm-yellow); stroke-width: 3; }
.rm-map .gm-region:hover path { fill: url(#gm-yellow); }
.rm-map .gm-region.no-rooms { cursor: default; }
.rm-map .gm-region.no-rooms:hover path { fill: url(#gm-paper); }
.rm-map .gm-label.is-picked .gm-name { fill: #121212; }

/* ---------- 표 ---------- */
.rm-table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 22px;
  border: 1px solid var(--glass-edge); background: rgba(255, 255, 255, .72); box-shadow: var(--hi), var(--depth);
}
.rm-table { width: 100%; min-width: 860px; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
.rm-table th, .rm-table td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid rgba(18, 18, 18, .07); white-space: nowrap; }
.rm-table thead th { position: sticky; top: 0; z-index: 1; background: #faf7ee; font-size: 13px; font-weight: 800; color: var(--ink-2); border-bottom: 2px solid rgba(18, 18, 18, .12); }
.rm-table thead th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.rm-table thead th button::after { content: "↕"; font-size: 11px; opacity: .35; }
.rm-table thead th button[data-dir="asc"]::after { content: "↑"; opacity: 1; }
.rm-table thead th button[data-dir="desc"]::after { content: "↓"; opacity: 1; }
.rm-table tbody tr { cursor: pointer; transition: background .12s ease; }
.rm-table tbody tr:nth-child(even) { background: rgba(250, 247, 238, .55); }
.rm-table tbody tr:hover { background: var(--y-soft); }
.rm-table tbody tr:last-child td { border-bottom: 0; }
.rm-table td.rm-num { font-variant-numeric: tabular-nums; }
.rm-table .rm-addr a { font-weight: 800; text-decoration: none; }
.rm-table .rm-addr a:hover { text-decoration: underline; text-underline-offset: 3px; }
.rm-table .rm-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 1px; }
.rm-table .rm-price b { font-family: var(--f-d); font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.rm-table .rm-price small { color: var(--muted); font-size: 12px; margin-left: 3px; }
.rm-thumb { display: inline-flex; align-items: center; gap: 6px; }
.rm-thumb img { width: 56px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--y-soft); box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.rm-thumb span { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.rm-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 800; background: var(--gloss), linear-gradient(180deg, #ffe54a, #ffcc00); border: 1px solid rgba(255, 255, 255, .9); }
.rm-badge.deal-jeonse { background: var(--gloss), linear-gradient(180deg, #ffffff, #eef1f6); }
.rm-badge.deal-sale { background: var(--gloss), linear-gradient(180deg, #2b2b28, #0e0e0d); color: var(--y); }
.rm-mark { color: var(--red); font-weight: 800; font-size: 12px; margin-left: 4px; }
.rm-id { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }

/* ---------- 카드 ---------- */
.rm-cards { margin-bottom: 4px; }
.rm-cards .card-meta.rm-card-addr { font-weight: 700; color: var(--ink); }

/* ---------- 페이지 ---------- */
.rm-none { margin: 22px 0; padding: 22px; text-align: center; border: 2px dashed var(--line); border-radius: 18px; color: var(--ink-2); font-weight: 600; }
.rm-pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 22px; }
.rm-pager button {
  min-width: 40px; min-height: 40px; padding: 0 12px; border-radius: 12px; cursor: pointer; font-weight: 800; font-size: 14px;
  border: 1px solid var(--glass-edge); background: var(--gloss), var(--glass); box-shadow: var(--hi), 0 2px 8px rgba(40, 32, 0, .07); color: var(--ink);
}
.rm-pager button[aria-current="page"] { background: var(--ink); color: var(--y); }
.rm-pager button:disabled { opacity: .4; cursor: not-allowed; }
.rm-pager .rm-gap { color: var(--muted); padding: 0 4px; }
.rm-foot-note { margin-top: 30px; font-size: 13px; color: var(--muted); max-width: 48em; }

/* ---------- 프린트: 표만 깔끔하게 ---------- */
@media print {
  .site-head, .foot, .dock, .ask-bar, .qa-panel, .crumbs, .rm-tabs, .rm-filter, .rm-tools-right, .rm-map-box, .rm-pager, .rm-foot-note, .sync-note, .skip { display: none !important; }
  body { background: #fff; }
  .rooms-page { padding: 0; }
  .wrap { width: 100%; }
  .rooms-page h1 { font-size: 22px; }
  .sec-desc { display: none; }
  .rm-result::after { content: " · 바바방공인중개사사무소 010-8129-2428 · " attr(data-printed); font-weight: 600; }
  .rm-table-wrap { overflow: visible; border: 0; box-shadow: none; border-radius: 0; background: #fff; }
  .rm-table { min-width: 0; font-size: 11.5px; }
  .rm-table th, .rm-table td { padding: 5px 6px; white-space: normal; border-bottom: 1px solid #ddd; }
  .rm-table thead th { position: static; background: #f1f1f1; }
  .rm-thumb img { width: 44px; height: 33px; }
  .rm-cards { display: none !important; }
  .rm-table-wrap[hidden] { display: block !important; }
}

/* 2026-11-12 사장님 "옆으로 안 옮겨도 되게끔 칸 딱 채우자": 13칸 → 9칸(rooms.js), 줄바꿈 허용, 사진 장수는 사진 위 */
@media screen {
  .rm-table { min-width: 0; }
  .rm-table th, .rm-table td { padding: 10px 9px; }
  .rm-table td.rm-wrap { white-space: normal; min-width: 4.5em; max-width: 9em; word-break: keep-all; }
  .rm-table td.rm-photo { width: 82px; min-width: 82px; }
  .rm-thumb { position: relative; display: inline-block; line-height: 0; }
  .rm-thumb img { display: block; width: 64px; height: 48px; max-width: none; flex: none; }
  .rm-thumb .rm-thumb-n { position: absolute; right: 3px; bottom: 3px; padding: 2px 6px; border-radius: 999px; background: rgba(18, 18, 18, .78); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 1.2; }
}
