/* Bản sao số cho thuê Lạch Huyện — sa bàn kiến trúc tối, chữ ngà, nhấn vàng đồng. Font: Be Vietnam Pro / Noto Serif Display (tự lưu trữ). */
:root {
  --bg: #0b1218; --panel: rgba(12, 20, 27, .76); --panel2: rgba(20, 31, 40, .9);
  --line: rgba(222, 196, 140, .26); --line2: rgba(222, 196, 140, .5);
  --ink: #f3eee4; --muted: #b5bcc0; --faint: #8b959b;
  --gold: #dec48c; --gold2: #f0dcae; --sea: #7fb2cf; --ok: #8fd1ab; --warn: #e7b464; --bad: #e88b7f;
  --font: 'Be Vietnam Pro', 'Segoe UI', 'Noto Sans', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --serif: 'Noto Serif Display', 'Noto Serif SC', Cambria, Georgia, serif;
  --r: 14px; --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
#view { position: fixed; inset: 0; }
#view canvas { display: block; touch-action: none; outline: none; }
.glass { background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-radius: var(--r); box-shadow: 0 10px 40px rgba(0, 0, 0, .28); }
.sp { flex: 1; }
.muted { color: var(--muted); }

/* ---------- đầu trang ---------- */
.top { position: fixed; z-index: 6; left: 16px; right: 16px; top: 14px; display: flex; gap: 10px; align-items: center; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { padding: 9px 16px; text-decoration: none; color: inherit; display: block; }
.brand small { display: block; color: var(--gold); letter-spacing: .16em; text-transform: uppercase; font-size: 10.5px; }
.brand b { font: 500 17px/1.25 var(--serif); letter-spacing: .01em; }
.seg { display: flex; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 11px; border-radius: 10px; color: var(--muted); font-size: 12.5px; }
.seg button.on { background: rgba(222, 196, 140, .16); color: var(--gold2); }
.live { padding: 7px 12px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.live.on .dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(143, 209, 171, .18); }

/* ---------- hành trình ---------- */
.story { position: fixed; z-index: 5; left: 16px; top: 86px; width: min(400px, calc(100vw - 32px)); padding: 18px 20px 14px; max-height: calc(100vh - 180px); overflow: auto; }
.kicker { color: var(--gold); letter-spacing: .14em; text-transform: uppercase; font-size: 11px; }
.story h1 { font: 500 clamp(22px, 2.3vw, 30px)/1.15 var(--serif); margin: 8px 0 8px; letter-spacing: .005em; }
.story p { margin: 0 0 10px; color: #dde1e1; }
.facts { list-style: none; margin: 10px 0 6px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.facts li { border-top: 1px solid var(--line); padding-top: 7px; }
.facts b { display: block; font: 500 20px/1.15 var(--serif); color: var(--gold2); }
.facts span { font-size: 12px; color: var(--muted); }
.src { font-size: 11px; color: var(--faint); margin-top: 8px !important; }
.nav { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.nav > button { border: 1px solid var(--line); background: none; border-radius: 10px; padding: 6px 11px; }
.nav > button:hover { border-color: var(--line2); }
.nav .ghost { margin-left: auto; color: var(--gold2); }
.dots { display: flex; gap: 5px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .2); cursor: pointer; }
.dots i.on { background: var(--gold); width: 18px; border-radius: 4px; }

/* ---------- bảng bên ---------- */
.side { position: fixed; z-index: 5; right: 16px; top: 86px; width: min(360px, calc(100vw - 32px)); bottom: 84px; display: flex; flex-direction: column; overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; background: none; padding: 11px 4px; color: var(--muted); font-size: 12.5px; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--gold2); border-bottom-color: var(--gold); }
.pane { overflow: auto; padding: 12px 14px 16px; flex: 1; }
.pane h3 { font: 500 16px/1.3 var(--serif); margin: 12px 0 6px; }
.pane h3:first-child { margin-top: 2px; }
.note { font-size: 11.5px; color: var(--faint); margin: 6px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chips button { border: 1px solid var(--line); background: none; border-radius: 99px; padding: 4px 10px; font-size: 12px; color: var(--muted); }
.chips button.on { border-color: var(--gold); color: var(--gold2); background: rgba(222, 196, 140, .1); }
.item { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.item:hover, .item.on { background: rgba(255, 255, 255, .04); border-color: var(--line); }
.item i { width: 12px; height: 12px; border-radius: 3px; }
.item b { font-weight: 500; display: block; font-size: 13px; }
.item small { color: var(--muted); font-size: 11.5px; }
.item .n { font: 500 15px var(--serif); color: var(--gold2); text-align: right; }
.tag { display: inline-block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line2); color: var(--gold2); border-radius: 5px; padding: 0 5px; margin-left: 4px; vertical-align: 1px; }
.tag.s { border-color: rgba(231, 180, 100, .6); color: var(--warn); }
.st-available { color: var(--ok); } .st-reserved { color: var(--warn); } .st-leased { color: var(--bad); }
.gal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gal button { border: 0; padding: 0; background: none; border-radius: 10px; overflow: hidden; position: relative; aspect-ratio: 16/10; }
.gal img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.gal button:hover img { transform: scale(1.05); }
.gal span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; font-size: 11.5px; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); }
.inc { margin: 0; padding: 0; list-style: none; counter-reset: i; }
.inc li { counter-increment: i; padding: 9px 0 9px 34px; position: relative; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.inc li::before { content: counter(i, decimal-leading-zero); position: absolute; left: 0; top: 9px; font: 500 15px var(--serif); color: var(--gold); }

/* ---------- thẻ ô đất ---------- */
.card { position: fixed; z-index: 7; left: 50%; bottom: 88px; transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); padding: 16px 18px; }
.card h2 { font: 500 22px/1.2 var(--serif); margin: 4px 0 6px; }
.card .kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.card .kv div { border-top: 1px solid var(--line); padding-top: 6px; }
.card .kv b { display: block; font: 500 18px/1.2 var(--serif); color: var(--gold2); }
.card .kv span { font-size: 11.5px; color: var(--muted); }
.card .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.x { position: absolute; right: 10px; top: 8px; border: 0; background: none; font-size: 22px; color: var(--muted); line-height: 1; padding: 4px 8px; }

/* ---------- thanh dưới ---------- */
.bar { position: fixed; z-index: 5; left: 16px; right: 16px; bottom: 14px; display: flex; gap: 14px; align-items: center; padding: 8px 10px 8px 14px; }
.tg { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.tg input { accent-color: var(--gold); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
button.ghost { border: 1px solid var(--line); background: none; border-radius: 10px; padding: 6px 11px; color: var(--muted); white-space: nowrap; }
.cta { border: 0; border-radius: 11px; padding: 10px 18px; background: linear-gradient(180deg, #ecd7a4, #c9aa6c); color: #1b1a14; font-weight: 600; white-space: nowrap; box-shadow: 0 6px 22px rgba(201, 170, 108, .28); }
.cta:hover { filter: brightness(1.06); }
.cta:disabled { opacity: .6; cursor: progress; }

/* ---------- nhãn 3D ---------- */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
#labels div { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font-size: 11.5px; color: var(--ink); text-shadow: 0 1px 3px rgba(0, 0, 0, .8); letter-spacing: .04em; transition: opacity .25s; }
#labels div.zone { font: 500 14px var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--gold2); }
#labels div.road { font-size: 10.5px; color: #e7ddc6; background: rgba(10, 16, 21, .55); padding: 1px 5px; border-radius: 4px; }
body[data-labels="off"] #labels { display: none; }
.tip { position: fixed; z-index: 8; pointer-events: none; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12px; transform: translate(12px, 12px); }

/* ---------- biểu mẫu ---------- */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(4, 8, 11, .62); display: grid; place-items: center; padding: 16px; }
.sheet { position: relative; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #111b22; border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; }
.sheet h2 { font: 500 26px/1.2 var(--serif); margin: 6px 0 4px; }
.sheet .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-top: 12px; }
.sheet label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.sheet .full { grid-column: 1 / -1; }
.sheet input, .sheet select, .sheet textarea { background: #0b1319; border: 1px solid #2b3a44; border-radius: 9px; padding: 9px 10px; color: var(--ink); font-size: 14px; }
.sheet input:focus, .sheet select:focus, .sheet textarea:focus { outline: 2px solid rgba(222, 196, 140, .5); border-color: transparent; }
.sheet .consent { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 6px; color: var(--ink); font-size: 13px; }
.sheet .consent input { margin-top: 3px; accent-color: var(--gold); }
.sheet .row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.err { color: var(--bad); min-height: 1.2em; margin: 4px 0; font-size: 13px; }
.ok { padding: 12px 0 4px; }
.ok b { font: 500 22px var(--serif); color: var(--gold2); display: block; margin-bottom: 4px; }

.lightbox { position: fixed; inset: 0; z-index: 30; background: rgba(3, 6, 9, .92); display: grid; place-items: center; padding: 24px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 10px; }
.lightbox p { pointer-events: auto; margin: 10px 0 0; color: var(--muted); text-align: center; }
.lightbox .x { color: #fff; font-size: 30px; }

.loading { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: grid; place-items: center; transition: opacity .8s var(--ease); }
.loading div { display: grid; gap: 8px; text-align: center; color: var(--muted); }
.loading b { font: 500 30px var(--serif); letter-spacing: .3em; color: var(--gold2); }
.loading i { display: block; height: 2px; width: 180px; margin: 6px auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); background-size: 200% 100%; animation: ld 1.4s linear infinite; }
@keyframes ld { to { background-position: -200% 0; } }
.loading.done { opacity: 0; pointer-events: none; }

/* ---------- màn hình nhỏ ---------- */
@media (max-width: 900px) {
  .brand b { font-size: 14px; }
  .top .seg:first-of-type { display: none; }
  .live { display: none; }
  .story { top: auto; bottom: 74px; max-height: 40vh; width: auto; right: 16px; padding: 14px 16px 10px; }
  .story h1 { font-size: 21px; }
  .facts b { font-size: 17px; }
  .side { display: none; }
  body.side-open .side { display: flex; top: 80px; bottom: 74px; left: 16px; right: 16px; width: auto; z-index: 9; }
  body.side-open .story { display: none; }
  .legend, .bar .tg:nth-child(2) { display: none; }
  .bar { gap: 8px; }
  .card { bottom: 74px; }
  .card .kv { grid-template-columns: 1fr 1fr; }
  .sheet .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Vì sao LHF: tiêu chí nhà đầu tư, tìm ô phù hợp (twin-plus.js) ---------- */
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs button { font-size: 12px; padding: 11px 6px; white-space: nowrap; }
.crit { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 12px 2px; border-top: 1px solid rgba(255, 255, 255, .06); }
.crit .ci { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(222, 196, 140, .12); border: 1px solid var(--line); font-size: 16px; }
.crit b { font: 500 15.5px/1.3 var(--serif); color: var(--gold2); }
.crit p { margin: 4px 0 4px; font-size: 13px; color: #dde1e1; }
.crit small { color: var(--faint); font-size: 11px; }
.crit .ghost { margin-top: 6px; font-size: 12px; padding: 4px 10px; color: var(--gold2); }
.finder { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 8px; margin: 4px 0 12px; background: rgba(222, 196, 140, .05); }
.finder h3 { margin: 0 0 8px !important; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.frow label { display: grid; gap: 3px; font-size: 11.5px; color: var(--muted); }
.frow input { background: #0b1319; border: 1px solid #2b3a44; border-radius: 8px; padding: 7px 8px; color: var(--ink); width: 100%; }
.finder .tg { display: inline-flex; margin-right: 8px; }
.fit { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 4px 0 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .035); }
.fit span { display: block; font-size: 11px; color: var(--muted); }
.fit b { font-weight: 600; color: var(--ink); }
.fit small { display: block; font-size: 10.5px; color: var(--faint); }
#labels div.conn { font: 500 13px var(--font); letter-spacing: .01em; text-transform: none; color: var(--gold2); background: rgba(10, 16, 21, .6); padding: 3px 9px; border-radius: 6px; border: 1px solid var(--line); }

/* ---------- chế độ render ảnh (?render=…) ---------- */
body.render .top, body.render .story, body.render .side, body.render .bar, body.render .card, body.render #tip, body.render #labels div:not(.conn):not(.zone) { display: none !important; }
.cine { position: fixed; inset: 0; z-index: 10; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; padding: 54px 64px 40px;
  background: linear-gradient(180deg, rgba(5, 10, 15, .62) 0%, transparent 26%, transparent 64%, rgba(5, 10, 15, .78) 100%); }
.cine .ct small { color: var(--gold); letter-spacing: .3em; font-size: 14px; }
.cine h1 { font: 500 54px/1.1 var(--serif); margin: 12px 0 0; max-width: 1100px; text-shadow: 0 2px 18px rgba(0, 0, 0, .45); }
.cine .cc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-top: auto; }
.cine .cc div { border-top: 1px solid var(--line2); padding-top: 12px; }
.cine .cc b { display: block; font: 500 38px/1.1 var(--serif); color: var(--gold2); }
.cine .cc span { font-size: 16px; color: #e3e6e6; }
.cine .cn { margin: 18px 0 0; font-size: 12px; color: var(--faint); }
