/* Web kho hàng BĐS Toolkit: trang công khai của môi giới. Một cột trên điện thoại, lưới thẻ trên máy tính. */
:root {
  --bg: #eef1f6; --surface: #ffffff; --soft: #f5f7fb; --fg: #142033; --muted: #5d6a7e; --line: #dde3ec;
  --brand: #1f3a68; --brand-ink: #ffffff; --brand-soft: #e3e9f4; --price: #c2410c; --ok: #15803d; --ok-bg: #dcfce7;
  --warn: #a16207; --warn-bg: #fef3c7; --zalo: #0068ff; --call: #16a34a; --sold: #6b7280;
  --chrome: #142033; --chrome-ink: #e8edf5; --chrome-muted: #9aa7ba;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 14px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0d1420; --surface: #172131; --soft: #1c2738; --fg: #e8edf5; --muted: #9aa7ba; --line: #263246;
  --brand: #8fb0e8; --brand-ink: #0d1420; --brand-soft: #1f2d45; --price: #fb923c; --ok: #4ade80; --ok-bg: #12301f;
  --warn: #fbbf24; --warn-bg: #2e2510; --zalo: #4d94ff; --call: #22c55e; --sold: #9ca3af;
  --chrome: #060a11; --chrome-ink: #e8edf5; --chrome-muted: #8592a6; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0d1420; --surface: #172131; --soft: #1c2738; --fg: #e8edf5; --muted: #9aa7ba; --line: #263246;
  --brand: #8fb0e8; --brand-ink: #0d1420; --brand-soft: #1f2d45; --price: #fb923c; --ok: #4ade80; --ok-bg: #12301f;
  --warn: #fbbf24; --warn-bg: #2e2510; --zalo: #4d94ff; --call: #22c55e; --sold: #9ca3af;
  --chrome: #060a11; --chrome-ink: #e8edf5; --chrome-muted: #8592a6; color-scheme: dark }

* { box-sizing: border-box }
body { background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.5; }
h1, h2, h3 { text-wrap: balance; margin: 0 }
a { color: inherit }
button, input, select, textarea { font: inherit; color: inherit }
.gut { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.max { max-width: 1120px; margin: 0 auto }
.num { font-variant-numeric: tabular-nums }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px }

/* Nút chung */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; font-weight: 700; border: 0; cursor: pointer; text-decoration: none; }
.btn.call { background: var(--call); color: #fff } .btn.zalo { background: var(--zalo); color: #fff }
.btn.pri { background: var(--brand); color: var(--brand-ink) }
.btn.ghost { background: var(--surface); border: 1px solid var(--line); color: var(--fg) }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px }
.btn svg { width: 18px; height: 18px }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap }
.pill.ok { color: var(--ok); background: var(--ok-bg) } .pill.sold { color: #fff; background: var(--sold) }
.pill.warn { color: var(--warn); background: var(--warn-bg) } .pill.brand { color: var(--brand); background: var(--brand-soft) }
.muted { color: var(--muted) }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 8px 16px; border-radius: 999px; font-size: 14px; z-index: 30; max-width: calc(100% - 32px) }

/* ===== Trang công khai ===== */
.pub-top { background: var(--surface); border-bottom: 1px solid var(--line) }
.pub-top .in { display: flex; align-items: center; gap: 12px; padding-block: 10px }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0 }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--acc, var(--brand)); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none }
.logo b { display: block; line-height: 1.2 } .logo small { color: var(--muted); font-size: 12px }
.pub-nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end }
.pub-nav a { text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 14px; color: var(--muted) }
.pub-nav a.on { color: var(--fg); background: var(--soft); font-weight: 600 }

.hero { background: linear-gradient(135deg, var(--acc, #1f3a68), color-mix(in srgb, var(--acc, #1f3a68) 55%, #000)); color: #fff }
.hero .in { padding-block: 28px; display: grid; gap: 14px }
.hero h1 { font-size: clamp(22px, 4vw, 32px); line-height: 1.25 }
.hero p { margin: 0; max-width: 62ch; opacity: .92 }
.hero .ctas { display: flex; gap: 10px; flex-wrap: wrap }
.stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; opacity: .9 }
.stats b { font-size: 18px; display: block }

/* Trang cá nhân kiểu Facebook: ảnh bìa, avatar tròn đè lên bìa, tên, nút liên hệ, icon mạng xã hội, thanh tab */
.profile { background: var(--surface); border-bottom: 1px solid var(--line) }
.cover { max-width: 1120px; margin: 0 auto; aspect-ratio: 1640 / 624; max-height: 380px; width: 100%; overflow: hidden; position: relative; background: var(--soft) }
@media (min-width: 1121px) { .cover { border-radius: 0 0 16px 16px } }
.cover svg, .cover img { width: 100%; height: 100%; object-fit: cover; display: block }
.pf-row { display: flex; gap: 18px; align-items: flex-end; margin-top: -58px; flex-wrap: wrap; position: relative }
.pf-ava { width: 150px; height: 150px; border-radius: 50%; border: 5px solid var(--surface); background: var(--acc, var(--brand)); overflow: hidden; flex: none; display: grid; place-items: center; color: #fff; font-size: 48px; font-weight: 700; box-shadow: 0 2px 10px #0f1a2e33 }
.pf-ava img, .avatar img { width: 100%; height: 100%; object-fit: cover; display: block }
.avatar { overflow: hidden }
.pf-id { flex: 1 1 240px; min-width: 0; padding-bottom: 8px; display: grid; gap: 2px }
.pf-id h1 { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; display: flex; align-items: center; gap: 8px; flex-wrap: wrap }
.pf-id .verified { width: 22px; height: 22px; flex: none }
.pf-id .sub { color: var(--muted) }
.pf-id .facts { color: var(--muted); font-size: 14px }
.pf-id .facts b { color: var(--fg) }
.pf-cta { display: flex; gap: 8px; padding-bottom: 10px; flex-wrap: wrap }
.pf-intro { margin: 14px 0 0; max-width: 70ch }
.socials { display: flex; gap: 10px; flex-wrap: wrap; padding-block: 12px 14px; align-items: center }
.soc { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; text-decoration: none; box-shadow: inset 0 0 0 1px #ffffff22; flex: none }
.soc svg { width: 20px; height: 20px }
.soc.zl { font-size: 11px; font-weight: 800; letter-spacing: -.02em }
.pf-tabs { display: flex; gap: 4px; border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none }
.pf-tabs::-webkit-scrollbar { display: none }
.pf-tabs a { flex: none; padding: 12px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent }
.pf-tabs a.on { color: var(--acc, var(--brand)); border-bottom-color: var(--acc, var(--brand)) }
@media (max-width: 640px) {
  .pf-row { flex-direction: column; align-items: center; text-align: center; margin-top: -64px; gap: 8px }
  .pf-ava { width: 128px; height: 128px; font-size: 42px }
  .pf-id { flex: none; justify-items: center }
  .pf-id h1 { justify-content: center }
  .pf-cta { display: none }
  .pf-intro { text-align: center; margin-inline: auto }
  .socials { justify-content: center }
}
.cover-pick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
.cover-pick button { width: 92px; aspect-ratio: 1640 / 624; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: none; max-width: 100% }
.cover-pick button[aria-pressed="true"] { border-color: var(--fg) }
.cover-pick svg, .cover-pick img { width: 100%; height: 100%; object-fit: cover; display: block }
.upl { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--muted); border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; color: var(--muted) }
.upl input { position: absolute; width: 1px; height: 1px; opacity: 0 }
.upl:focus-within { outline: 3px solid var(--brand); outline-offset: 2px }
.soc-in { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center }
.preview .cover { max-height: 150px }
.preview .pf-row { margin-top: -40px; flex-direction: row; text-align: left; align-items: flex-end }
.preview .pf-ava { width: 84px; height: 84px; font-size: 28px; border-width: 4px }
.preview .pf-id h1 { font-size: 19px; justify-content: flex-start }
.preview .pf-id { justify-items: start }
.preview .pf-cta { display: none }
.preview .pf-intro { font-size: 14px; text-align: left; margin-inline: 0 }
.preview .socials { justify-content: flex-start }
.preview .soc { width: 32px; height: 32px } .preview .soc svg { width: 16px; height: 16px }

.search { background: var(--surface); border-radius: var(--r); padding: 12px; display: grid; gap: 10px; margin-top: 16px; position: relative; border: 1px solid var(--line) }
.search input { width: 100%; border: 1px solid var(--line); background: var(--soft); border-radius: 10px; padding: 10px 12px }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px }
.chips::-webkit-scrollbar { display: none }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 14px; cursor: pointer }
.chip[aria-pressed="true"] { background: var(--acc, var(--brand)); border-color: var(--acc, var(--brand)); color: #fff }

.sec { padding-block: 22px 6px; display: grid; gap: 12px; scroll-margin-top: 110px }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap }
.sec-h h2 { font-size: 19px }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px }
.card { background: var(--surface); border-radius: var(--r); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line) }
.card .ph { aspect-ratio: 4 / 3; max-width: 100%; position: relative }
.card .ph svg { width: 100%; height: 100%; display: block }
.card .ph .pill { position: absolute; left: 10px; top: 10px }
.card .ph .cnt { position: absolute; right: 10px; bottom: 10px; background: #000a; color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px }
.card .bd { padding: 12px; display: grid; gap: 6px }
.card h3 { font-size: 15px; font-weight: 600; line-height: 1.35 }
.card .pr { color: var(--price); font-weight: 800; font-size: 18px }
.card .meta { color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap }
.card > .ph { display: block; text-decoration: none }
.card-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px }
.card-acts .btn { flex: 1 1 auto }
.card h3 a:hover { text-decoration: underline }
.proj .ph { aspect-ratio: 1640 / 760 }
.pager { display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; padding-top: 6px }
.pager a, .pager .pg-num, .pager .pg-btn { display: inline-grid; place-items: center; min-width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px; font-variant-numeric: tabular-nums; color: inherit; text-decoration: none; font-weight: 600 }
.pager a:hover { border-color: var(--acc, var(--brand)); color: var(--acc, var(--brand)) }
.pager .pg-gap { padding: 0 4px; color: var(--muted, #6b7280) }
.pager .pg-num[aria-current="page"] { background: var(--acc, var(--brand)); border-color: var(--acc, var(--brand)); color: #fff; font-weight: 700 }
.pager [aria-disabled="true"] { opacity: .4 }
.pg-note { text-align: center; font-size: 13px; margin: 0 }
.card.is-sold .ph::after { content: "ĐÃ GIAO DỊCH"; position: absolute; inset: 0; display: grid; place-items: center; background: #0f141ecc; color: #fff; font-weight: 800; letter-spacing: .04em }

.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px }
.area { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-decoration: none }
.area b { display: block } .area span { color: var(--muted); font-size: 13px }

.about { background: var(--surface); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; border: 1px solid var(--line) }
.foot { padding-block: 26px 40px; color: var(--muted); font-size: 13px; display: grid; gap: 6px; text-align: center }
.foot a { color: var(--muted) }
.mbar { display: none }
@media (max-width: 640px) {
  .pub-nav { display: none }
  .mbar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); z-index: 15 }
  .pub { padding-bottom: 80px }
}

/* Chi tiết căn */
.detail { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; padding-block: 16px }
@media (max-width: 820px) {
  .detail { grid-template-columns: minmax(0, 1fr) }
  .d-main { display: contents }
  .d-main > * { order: 1 } .d-side { order: 2 } .d-main > .d-desc { order: 3; margin-top: 0 !important }
}
.gal { border-radius: var(--r); overflow: hidden; aspect-ratio: 4 / 3; max-width: 100%; position: relative }
.gal svg { width: 100%; height: 100%; display: block }
.thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 6px }
.thumbs button { border: 2px solid transparent; padding: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; cursor: pointer; background: none; max-width: 100% }
.thumbs button[aria-pressed="true"] { border-color: var(--acc, var(--brand)) }
.thumbs svg { width: 100%; height: 100%; display: block }
.box { background: var(--surface); border-radius: var(--r); padding: 16px; border: 1px solid var(--line); display: grid; gap: 10px; align-content: start }
.box h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600 }
.big-pr { color: var(--price); font-size: 28px; font-weight: 800 }
.specs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px }
.spec { background: var(--soft); border-radius: 10px; padding: 8px 4px; text-align: center; min-width: 0 }
.spec b { display: block } .spec small { color: var(--muted); font-size: 12px }
dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px } dt { color: var(--muted) } dd { margin: 0; font-weight: 500; min-width: 0 }
.crumb { font-size: 13px; color: var(--muted); padding-top: 14px } .crumb a { color: var(--muted) }

/* Form */
.form { display: grid; gap: 12px }
.form label { display: grid; gap: 4px; font-size: 14px; font-weight: 500 }
.form input, .form select, .form textarea { border: 1px solid var(--line); background: var(--soft); border-radius: 10px; padding: 10px 12px; width: 100% }
.seg { display: flex; gap: 6px; flex-wrap: wrap }
.seg button { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 14px; cursor: pointer }
.seg button[aria-pressed="true"] { background: var(--acc, var(--brand)); color: #fff; border-color: var(--acc, var(--brand)) }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px } @media (max-width: 520px) { .two { grid-template-columns: 1fr } }

/* Hình nền chủ đề: cảnh nội thất tối giản, tô màu chủ đạo, mờ 15%, sát đáy màn hình */
.bgscene { position: fixed; left: 0; right: 0; bottom: 0; height: min(60vh, 520px); pointer-events: none; z-index: -1; background-color: var(--acc, var(--brand)); opacity: .15; -webkit-mask: var(--scene) no-repeat center bottom / contain; mask: var(--scene) no-repeat center bottom / contain }
body { position: relative; z-index: 0 }
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: grid; gap: 10px; text-align: center; margin-block: 40px }
.err { color: var(--price); font-size: 13px }
.ok-box { background: var(--ok-bg); color: var(--ok); border-radius: 12px; padding: 12px 14px; font-weight: 600 }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--r) }
.slides::-webkit-scrollbar { display: none }
.slides img, .slides .ph-empty { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; max-width: 100%; display: block; background: var(--soft) }
.slides .ph-empty { display: grid; place-items: center }
.card .ph img { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--soft) }
.ph-empty { display: grid; place-items: center; color: var(--muted); font-size: 13px; width: 100%; height: 100% }
.desc-text { white-space: pre-line; margin: 0 }
