/* AIDC Bắc Ninh — trang 3D chi tiết. Nền tối, kính mờ, điểm nhấn xanh ngọc (như ứng dụng chính). */
:root { --ink: #e8f2f7; --muted: #8fa9b8; --cyan: #6cd9ed; --gold: #ffc857; --line: rgba(108, 217, 237, .26); --panel: rgba(7, 18, 30, .78);
  --dsn: #6cd9ed; --sim: #ffd166; --bad: #ff6b5b; --font: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #05101a; color: var(--ink); font: 13.5px/1.45 var(--font); overflow: hidden; overscroll-behavior: none; }
#view { position: fixed; inset: 0; } #view canvas { display: block; touch-action: none; }
.glass { background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 12px; }
.btn, #toolbar button, select.btn { font: inherit; color: var(--ink); background: rgba(10, 30, 46, .85); border: 1px solid var(--line); border-radius: 9px; padding: 6px 11px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover, #toolbar button:hover { border-color: var(--cyan); }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
[aria-pressed="true"] { background: #14485c !important; border-color: var(--cyan) !important; color: #fff !important; }
.btn.gold { border-color: var(--gold); color: var(--gold); } .btn.gold[aria-pressed="true"] { background: var(--gold) !important; color: #1a1406 !important; }

header { position: fixed; left: 14px; right: 14px; top: 12px; z-index: 6; display: flex; gap: 8px; align-items: center; pointer-events: none; }
header > * { pointer-events: auto; }
.brand { padding: 7px 13px; } .brand small { display: block; color: var(--cyan); letter-spacing: .08em; text-transform: uppercase; font-size: 10px; }
.brand b { font-size: 17px; letter-spacing: .02em; }
.sp { flex: 1; }
#crumbs { display: flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 13px; }
#crumbs button { font: inherit; color: var(--cyan); background: none; border: 0; padding: 0; cursor: pointer; } #crumbs button:hover { text-decoration: underline; }
#crumbs .sep { color: var(--muted); } #crumbs b { color: #fff; }
.badge { font-size: 11px; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); white-space: nowrap; }
.badge.sim { color: var(--sim); border-color: rgba(255, 209, 102, .45); }
.live { font-size: 12px; color: #5fd39a; white-space: nowrap; } .live::before { content: '●'; margin-right: 5px; } .live.off { color: var(--bad); }
#clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }

#side { position: fixed; left: 14px; top: 76px; z-index: 5; width: 212px; padding: 9px; max-height: calc(100vh - 170px); overflow-y: auto; }
#side h3 { margin: 6px 4px 4px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); font-weight: 600; }
.nav button { display: block; width: 100%; text-align: left; font: inherit; color: var(--ink); background: none; border: 1px solid transparent; border-radius: 8px; padding: 6px 9px; cursor: pointer; }
.nav button:hover { border-color: var(--line); } .nav button small { display: block; color: var(--muted); font-size: 11px; }
.nav button.ghost { color: var(--muted); font-size: 12px; }
#floorList:not(:empty) { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 4px; }

#card { position: fixed; right: 14px; top: 76px; z-index: 5; width: 330px; padding: 13px 15px; max-height: calc(100vh - 170px); overflow-y: auto; }
#card h2 { margin: 0 0 2px; font-size: 18px; } #card .sub { margin: 0 0 9px; color: var(--muted); font-size: 12px; }
#card h4 { margin: 11px 0 5px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
#card p { margin: 6px 0; } #card ul, #card ol { margin: 6px 0; padding-left: 18px; } #card li { margin: 3px 0; }
.kv { display: grid; grid-template-columns: minmax(90px, 44%) 1fr; gap: 6px; align-items: baseline; padding: 4px 0; border-bottom: 1px dashed rgba(143, 169, 184, .18); }
.kv span { color: var(--muted); font-size: 12.5px; } .kv b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; } .kv a { color: var(--cyan); }
i.dsn, i.sim { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .05em; padding: 1px 5px; border-radius: 4px; white-space: nowrap; vertical-align: 1px; }
i.dsn { color: var(--dsn); border: 1px solid rgba(108, 217, 237, .5); } i.sim { color: var(--sim); border: 1px solid rgba(255, 209, 102, .5); }
.muted { color: var(--muted); font-size: 12px; } .hint { color: var(--muted); font-size: 12px; font-style: italic; } .warn { color: var(--sim); font-size: 12.5px; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.btns button, .rlist button { font: inherit; font-size: 12px; color: var(--ink); background: rgba(10, 30, 46, .9); border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; cursor: pointer; }
.btns button:hover, .rlist button:hover { border-color: var(--cyan); }
.rlist { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 8px; } .rlist button { border-left: 4px solid var(--c); text-align: left; }
.big { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 6px; }
.big div { background: rgba(255, 255, 255, .04); border-radius: 9px; padding: 7px 8px; } .big small { display: block; color: var(--muted); font-size: 11px; }
.big b { font-size: 22px; font-variant-numeric: tabular-nums; } .big span { color: var(--muted); font-size: 11px; margin-left: 3px; }
ol.layers li { color: var(--muted); } ol.layers li.here { color: var(--ink); font-weight: 600; }

#toolbar { position: fixed; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: 14px; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 7px 10px; max-width: calc(100vw - 28px); flex-wrap: wrap; justify-content: center; }
#toolbar .grp { display: inline-flex; align-items: center; gap: 4px; } #toolbar .grp small { color: var(--muted); font-size: 11px; margin-right: 2px; }
#toolbar .grp button { padding: 5px 9px; font-size: 12.5px; }
#legend { position: fixed; right: 14px; bottom: 14px; z-index: 5; padding: 8px 11px; width: 240px; font-size: 11.5px; }
#legend .rmp { display: block; height: 8px; border-radius: 4px; margin: 5px 0 3px; } #legend .ends { display: flex; justify-content: space-between; color: var(--muted); }
#legend small { color: var(--sim); font-size: 9.5px; font-weight: 700; }
#flowLegend { position: fixed; left: 14px; bottom: 14px; z-index: 5; padding: 7px 10px; display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; }
#flowLegend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

#cap { position: fixed; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 7; width: min(760px, calc(100vw - 600px)); min-width: 420px; padding: 12px 18px 10px; text-align: center; }
#cap p { margin: 3px 0 8px; font-size: 17px; line-height: 1.4; font-weight: 500; } #capN { color: var(--gold); letter-spacing: .1em; }
.pbar { height: 3px; background: rgba(255, 255, 255, .1); border-radius: 3px; overflow: hidden; margin-bottom: 4px; } .pbar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .6s; }
body.touring #flowLegend { display: none; }
#tip { position: fixed; z-index: 9; pointer-events: none; background: rgba(5, 14, 24, .92); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12px; max-width: 280px; }
#tip small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
#toast { position: fixed; left: 50%; top: 74px; transform: translateX(-50%); z-index: 8; padding: 6px 13px; font-size: 12.5px; }
#err { position: fixed; left: 14px; right: 14px; bottom: 70px; z-index: 30; background: #5a1010; color: #fff; padding: 8px 12px; border-radius: 8px; font: 12px monospace; }
.note { position: fixed; right: 14px; bottom: 70px; z-index: 4; max-width: 330px; margin: 0; font-size: 10.5px; color: #9fb3c2; text-align: right; text-shadow: 0 1px 3px #000; }
body:has(#legend:not([hidden])) .note, body:has(#flowLegend:not([hidden])) .note { display: none; }

/* nhãn 3D */
.lb-layer { position: fixed; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.lb { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 12px; color: var(--ink); background: rgba(6, 16, 26, .82); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; will-change: transform; }
.lb.click { pointer-events: auto; cursor: pointer; } .lb.click:hover { border-color: var(--cyan); }
.lb em { font-style: normal; color: #ffad4d; font-size: 11px; margin-left: 4px; }
.lb .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: #5fd39a; vertical-align: 1px; }
.lb .dot.construction { background: #ffad4d; } .lb .dot.planned { background: #8fa9b8; }
.lb.bld { font-weight: 600; font-size: 12.5px; }
.lb.floor { border-radius: 8px; font-size: 11.5px; } .lb.floor b { color: var(--cyan); margin-right: 4px; }
.lb.spot { font-size: 11.5px; border-color: rgba(255, 200, 87, .4); } .lb.spot::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 1px; height: 7px; background: rgba(255, 200, 87, .6); }
.lb.pod { border-color: rgba(108, 217, 237, .6); } .lb.pod b { color: var(--cyan); }
.lb.part { font-size: 11px; border-radius: 6px; border-color: rgba(255, 255, 255, .35); }
.lb.flow { font-size: 11px; border-color: rgba(255, 200, 87, .5); color: #ffe2a0; }
.lb i.sim, .lb i.dsn { font-size: 9px; padding: 0 4px; margin-left: 4px; }

#loading { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: radial-gradient(ellipse at center, #0c2232, #03080d); transition: opacity .7s; }
#loading.done { opacity: 0; pointer-events: none; }
#loading > div { width: min(420px, 80vw); text-align: center; } #loading b { display: block; font-size: 32px; color: var(--cyan); letter-spacing: .05em; margin-bottom: 18px; }
#loading .ldb { display: block; height: 3px; background: rgba(255, 255, 255, .1); border-radius: 3px; overflow: hidden; } #ldBar { display: block; height: 100%; width: 0; background: var(--cyan); transition: width .3s; }
#ldTxt { display: block; margin-top: 10px; color: var(--muted); font-size: 13px; }

@media (max-width: 1280px) { .brand small { display: none; } #opPhase { display: none; } #card { width: 290px; } }
@media (max-width: 900px) {
  #side { display: none; } #card { top: auto; bottom: 120px; left: 10px; right: 10px; width: auto; max-height: 34vh; }
  header { flex-wrap: wrap; } .badge, #clock, .live { display: none; } #cap { width: calc(100vw - 20px); min-width: 0; bottom: 120px; }
  .note { display: none; }
}

/* thanh chọn toà / tầng */
#lvl { position: fixed; left: 0; right: 0; margin: 0 auto; width: max-content; top: 70px; z-index: 6; display: flex; align-items: center; gap: 5px; padding: 5px 8px; }
#lvl small { color: var(--muted); font-size: 11px; margin: 0 2px 0 4px; } #lvl .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
#lvl button { font: inherit; font-size: 12.5px; color: var(--ink); background: rgba(10, 30, 46, .85); border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px; cursor: pointer; }
#lvl button:hover { border-color: var(--cyan); } #lvl button.fut { color: var(--muted); border-style: dashed; }
#side, #card { top: 118px; max-height: calc(100vh - 210px); } #side { max-height: calc(100vh - 290px); } #toast { top: 118px; }
#hour { width: 120px; accent-color: #3fe0d0; } #hourOut { font-variant-numeric: tabular-nums; min-width: 42px; font-size: 12.5px; }
i.prp { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .05em; padding: 1px 5px; border-radius: 4px; white-space: nowrap; vertical-align: 1px; color: #c9a8ff; border: 1px solid rgba(201, 168, 255, .5); }
.lb i.prp { font-size: 9px; padding: 0 4px; margin-left: 4px; }
.kv span i { margin-top: 2px; display: inline-block; }

/* Giai đoạn 2: tông resort (charcoal/champagne/ivory), panel thu gọn, la bàn */
:root { --panel: rgba(28, 32, 34, .80); --line: rgba(165, 141, 104, .34); --cyan: #5FD6C8; --ink: #ECE7DD; --muted: #A9A296; }
.glass { background: var(--panel); border-color: var(--line); }
.brand small { color: #c9b48f; } .brand b { font-family: Georgia, 'Times New Roman', serif; font-weight: 600; letter-spacing: .03em; }
#side h3 { color: #c9b48f; } [aria-pressed="true"] { background: rgba(165, 141, 104, .28) !important; border-color: #A58D68 !important; color: #fff !important; }
#crumbs button.khu { color: #e3c98f; } #crumbs button.khu::before { content: '⌂ '; }
button.fold { position: fixed; z-index: 7; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); background: rgba(28, 32, 34, .9); color: var(--ink); cursor: pointer; font: 600 14px/1 var(--font); padding: 0; }
#side .fold { position: absolute; right: 8px; top: 8px; }
#cardFold { right: 22px; top: 126px; }
#side.folded { width: 44px; padding: 6px; overflow: hidden; } #side.folded > :not(.fold) { display: none; } #side.folded .fold { position: static; }
#card.folded { display: none; }
#compass { position: fixed; right: 14px; bottom: 96px; z-index: 5; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; }
#compass .ndl { width: 44px; height: 44px; position: relative; transition: transform .15s linear; }
#compass .ndl b { position: absolute; left: 50%; top: 1px; transform: translateX(-50%); font-size: 11px; color: #e3c98f; }
#compass .ndl i { position: absolute; left: 50%; top: 13px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 18px solid #e3c98f; transform: translateX(-50%); }
body:has(#legend:not([hidden])) #compass { bottom: 112px; }
body.noui header, body.noui #lvl, body.noui #side, body.noui #card, body.noui #toolbar, body.noui .note, body.noui #legend, body.noui #flowLegend, body.noui #compass, body.noui button.fold { display: none !important; }
#crumbs { white-space: nowrap; } #crumbs > * { white-space: nowrap; }
.brand { max-width: 420px; } .brand small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
#toolbar .grp small { display: none; } #hour { width: 96px; }
@media (max-width: 1720px) { #opPhase { display: none; } }
body.noui .lb-layer, body.noui #toast { display: none !important; }

/* UAT 27/10/2026: nút "▣ Ảnh thiết kế" (.tva-btn, top 72px) che nút thu gọn của thẻ → hạ thẻ xuống dưới nút */
@media (min-width:701px){#card{top:118px;max-height:calc(100vh - 212px)}}

/* ---- UAT 27/10/2026 · điện thoại & màn cảm ứng (học Alluvia): không tràn ngang, nút ≥ 40 px, chữ ≥ 12 px ---- */
@media (max-width: 700px) {
  .brand { max-width: calc(100vw - 20px); } .brand small { display: none; } .brand b { font-size: 17px; }
  header .btn:not(#btnBack), header select.btn { display: none; }
  #lvl { top: 62px; left: 8px; right: 8px; margin: 0; width: auto; max-width: none; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #lvl::-webkit-scrollbar { display: none; } #lvl small { font-size: 12px; }
  #toolbar { left: 8px; right: 8px; margin: 0; width: auto; max-width: none; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; bottom: 10px; }
  #toolbar::-webkit-scrollbar { display: none; } #toolbar .grp { flex: none; }
  #card { bottom: 80px; max-height: 40vh; } #cardFold { top: auto; bottom: 86px; right: 16px; }
  #compass { bottom: 82px; left: 12px; right: auto; }
  i.prp, .lb i.prp { font-size: 11px; } .kv, #card { font-size: 13px; }
}
@media (pointer: coarse) {
  #lvl button, #toolbar button, .btn, button.fold { min-height: 40px; min-width: 40px; }
  #crumbs button { min-height: 36px; }
}
