/* =====================================================================
   Nhịp Số Studio — tour văn phòng 360°
   Ngôn ngữ thiết kế "Thẻ khách × khung thép loft": vách kính khung thép đen,
   gạch nung, gỗ sồi, rêu; thẻ khách đeo dây, đầu đọc thẻ ở cửa, giấy ghi chú,
   thẻ chấm công. Chữ: Bricolage Grotesque + JetBrains Mono + Patrick Hand.
   ===================================================================== */
:root {
  --ink: #1b1d20; --ink2: #2b2e33; --steel: #43474e; --mute: #6c6f74;
  --paper: #f5f3ee; --concrete: #e8e5df; --concrete2: #d6d2ca;
  --brick: #b4502f; --brick2: #8f3b20; --oak: #b8874f; --moss: #55752f; --moss2: #3d5720;
  --led: #3bd16f; --red: #e2453a; --postit: #ffe169; --pink: #ff9db4;
  --glass: rgba(245, 243, 238, .88);
  --font: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --hand: 'Patrick Hand', 'Comic Sans MS', cursive;
  --frame: 3px solid var(--ink);
  --shadow: 0 18px 44px rgba(8, 8, 10, .34), 0 2px 0 rgba(0, 0, 0, .1);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #121314; color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mono { font-family: var(--mono); letter-spacing: .06em; }
.hidden { display: none !important; }
a { color: inherit; }

#pano { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; outline: none; }
#pano.grabbing { cursor: grabbing; }
#hotspots { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
#dimmer { position: fixed; inset: 0; pointer-events: none; z-index: 4; background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .28)); }

/* ---------- ẩn UI trước khi vào / khi tham quan tự động ---------- */
#top, #dock, #lanyard, #btnAuto, #valuesChip, #maker, #planBox { transition: opacity .5s, transform .5s; }
body:not(.ready) #top, body:not(.ready) #dock, body:not(.ready) #btnAuto, body:not(.ready) #valuesChip, body:not(.ready) #maker, body:not(.ready) #planBox { opacity: 0; pointer-events: none; }
body:not(.badged) #lanyard { opacity: 0; pointer-events: none; }
body.ui-off #dock, body.ui-off #tools, body.ui-off #sign, body.ui-off #planBox, body.ui-off #valuesChip, body.ui-off #timecard, body.ui-off #chat { opacity: 0; pointer-events: none; }
body.ui-off #hotspots { opacity: 0; }

/* =====================================================================
   THANH TRÊN: biển thép tên công ty · biển cửa (cảnh) · công cụ
   ===================================================================== */
#top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px 0 96px; pointer-events: none; }
#top > * { pointer-events: auto; }
#plate { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #f3f0ea; padding: 7px 16px 7px 7px; border-radius: 3px; box-shadow: var(--shadow); position: relative; }
#plate::before, #plate::after { content: ''; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #6d7178; box-shadow: inset 0 0 0 1px #2c2f33; top: 5px; right: 5px; }
#plate::after { top: auto; bottom: 5px; }
.pl-logo { width: 36px; height: 36px; display: block; }
.pl-txt { display: flex; flex-direction: column; gap: 2px; }
.pl-name { font-weight: 750; font-size: 15px; letter-spacing: -.01em; font-variation-settings: 'wdth' 92; }
.pl-status { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: #c9c5bd; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pl-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--led); box-shadow: 0 0 8px var(--led); }
.pl-status.closed i { background: var(--red); box-shadow: 0 0 8px var(--red); }

#sign { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); display: flex; align-items: stretch; background: var(--paper); border: var(--frame); box-shadow: var(--shadow); max-width: min(520px, calc(100vw - 560px)); min-width: 280px; }
.sg-step { width: 34px; display: grid; place-items: center; color: var(--ink); transition: background .2s; }
.sg-step:hover { background: var(--concrete); }
.sg-body { flex: 1; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; padding: 6px 10px; border-left: 1.5px solid var(--ink); border-right: 1.5px solid var(--ink); min-width: 0; }
.sg-code { grid-row: 1 / 3; align-self: center; font-family: var(--mono); font-weight: 700; font-size: 13px; background: var(--ink); color: #fff; padding: 6px 7px; letter-spacing: .02em; }
.sg-body b { font-size: 16.5px; font-weight: 750; letter-spacing: -.015em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-body small { font-size: 11.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#tools { display: flex; gap: 5px; background: var(--ink); padding: 4px; border-radius: 3px; box-shadow: var(--shadow); }
#tools button { width: 38px; height: 38px; display: grid; place-items: center; color: #e9e6df; border-radius: 2px; position: relative; transition: background .2s, color .2s; }
#tools button:hover { background: #33373c; color: #fff; }
#tools button.on::after { content: ''; position: absolute; top: 6px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--led); box-shadow: 0 0 6px var(--led); }
#langTxt { font-family: var(--mono); font-size: 12px; font-weight: 700; }

/* =====================================================================
   THẺ KHÁCH ĐEO DÂY (đung đưa theo chuyển động camera)
   ===================================================================== */
#lanyard { position: fixed; top: 0; left: 18px; width: 64px; z-index: 22; pointer-events: none; }
.ly-swing { transform-origin: 32px 0; will-change: transform; }
.ly-strap { display: block; width: 60px; height: 64px; margin-left: 2px; overflow: visible; }
.ly-strap path { stroke: var(--strap, var(--brick)); stroke-width: 7; fill: none; stroke-linecap: square; }
.ly-clip { width: 14px; height: 12px; margin: -6px auto 0; background: linear-gradient(180deg, #d9dbde, #8d9198); border-radius: 3px 3px 5px 5px; box-shadow: 0 1px 2px rgba(0, 0, 0, .4); position: relative; z-index: 1; }
.ly-card { pointer-events: auto; display: flex; flex-direction: column; align-items: center; width: 64px; margin: -3px auto 0; padding: 0 0 6px; background: #fbfaf7; border-radius: 5px; box-shadow: 0 10px 22px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(0, 0, 0, .1); overflow: hidden; transition: transform .2s; position: relative; }
.ly-card::before { content: ''; position: absolute; top: 6px; left: 50%; width: 16px; height: 3px; margin-left: -8px; border-radius: 3px; background: rgba(0, 0, 0, .25); }
.ly-card:hover { transform: scale(1.06); }
.lc-band { display: block; width: 100%; height: 15px; background: var(--strap, var(--brick)); }
.lc-kind { font-family: var(--mono); font-size: 7.5px; font-weight: 700; letter-spacing: .12em; margin-top: 4px; color: var(--strap, var(--brick)); }
.lc-ini { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; margin: 4px 0 3px; background: var(--ink); color: #fff; font-weight: 750; font-size: 12px; }
.lc-name { font-weight: 700; font-size: 10px; line-height: 1.1; max-width: 58px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-no { font-family: var(--mono); font-size: 7.5px; color: var(--mute); margin-top: 2px; }
.ly-card.tap { animation: tap .5s ease; }
@keyframes tap { 30% { transform: translate(6px, 10px) rotate(-8deg) scale(1.08); } }

/* =====================================================================
   DOCK — vách kính khung thép: mỗi nút là một ô kính
   ===================================================================== */
#dock { position: fixed; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); z-index: 20; display: flex; gap: 3px; padding: 3px; background: var(--ink); border-radius: 3px; box-shadow: var(--shadow); }
#dock button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 78px; padding: 9px 10px 8px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 11.5px; font-weight: 600; letter-spacing: -.005em; white-space: nowrap; transition: background .2s, color .2s; }
#dock button:first-child { border-radius: 1px 0 0 1px; }
#dock button:hover { background: #fff; }
#dock button.on { background: var(--brick); color: #fff; }
#dock button .i { width: 21px; height: 21px; }
.dk-badge { position: absolute; top: 4px; right: 9px; font-style: normal; font-family: var(--mono); font-size: 9.5px; font-weight: 700; background: var(--brick); color: #fff; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }
#dock button.on .dk-badge { background: var(--ink); }
.dk-chat::after { content: ''; position: absolute; top: 7px; right: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--led); box-shadow: 0 0 0 2px var(--glass); }

#btnAuto { position: fixed; right: 16px; bottom: calc(46px + var(--safe-b)); z-index: 20; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 10px; background: var(--ink); color: #f2efe9; border-radius: 3px; box-shadow: var(--shadow); font-size: 12.5px; font-weight: 600; }
#btnAuto.on { background: var(--brick); }
#btnAuto .i { width: 16px; height: 16px; }
#valuesChip { position: fixed; right: 16px; bottom: calc(92px + var(--safe-b)); z-index: 20; font-family: var(--hand); font-size: 17px; background: var(--pink); padding: 6px 12px 4px 30px; transform: rotate(-3deg); box-shadow: 0 6px 14px rgba(0, 0, 0, .3); color: #4b1622; }
#valuesChip::before { content: '♥'; position: absolute; left: 10px; top: 5px; font-size: 15px; }
#valuesChip b { font-size: 20px; }
#valuesChip.full { background: var(--postit); }
#maker { position: fixed; right: 16px; bottom: calc(14px + var(--safe-b)); z-index: 19; font-family: var(--mono); font-size: 10.5px; color: rgba(255, 255, 255, .85); text-decoration: none; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); letter-spacing: .02em; }
#maker b { color: #fff; }

/* =====================================================================
   CỬA KÍNH TRƯỢT (chuyển cảnh qua đầu đọc thẻ)
   ===================================================================== */
#doors { position: fixed; inset: 0; z-index: 15; pointer-events: none; overflow: hidden; }
.door { position: absolute; top: 0; bottom: 0; width: 50.4%; background: linear-gradient(100deg, rgba(225, 228, 228, .78), rgba(245, 246, 244, .9) 40%, rgba(222, 226, 226, .8)); backdrop-filter: blur(16px) saturate(.8); -webkit-backdrop-filter: blur(16px) saturate(.8); border: 7px solid var(--ink); transition: transform .42s cubic-bezier(.7, 0, .3, 1); }
.door.l { left: 0; transform: translateX(-102%); border-right-width: 5px; }
.door.r { right: 0; transform: translateX(102%); border-left-width: 5px; }
#doors.closed .door { transform: translateX(0); }
.door i { position: absolute; left: 0; right: 0; height: 4px; background: var(--ink); }
.door i:nth-child(1) { top: 33%; } .door i:nth-child(2) { top: 72%; }
.door .decal { position: absolute; left: 0; right: 0; top: calc(50% - 22px); height: 44px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .55) 0 18px, rgba(255, 255, 255, .2) 18px 26px); }
.door.l .decal::after, .door.r .decal::after { content: 'NHỊP SỐ STUDIO'; position: absolute; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-weight: 700; letter-spacing: .4em; font-size: 12px; color: rgba(27, 29, 32, .55); }
.door.l .decal::after { right: 24px; } .door.r .decal::after { left: 24px; content: 'TẦNG 5'; }

/* =====================================================================
   HOTSPOT
   ===================================================================== */
.hs { position: absolute; left: 0; top: 0; pointer-events: auto; will-change: transform; }
.hs-in { position: relative; }
/* --- biển chỉ đường + đầu đọc thẻ --- */
.hs-nav .hs-in { transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.hs-sign { display: flex; align-items: stretch; background: var(--ink); color: #f3f0ea; box-shadow: 0 10px 24px rgba(0, 0, 0, .4); transition: transform .2s, background .2s; }
.hs-nav:hover .hs-sign { transform: translateY(-3px); background: #000; }
.hs-sign .rd { width: 26px; display: grid; place-items: center; background: #2d3035; border-right: 1px solid #000; }
.hs-sign .rd::before { content: ''; width: 12px; height: 17px; border-radius: 2px; border: 1.5px solid #6e737a; box-sizing: border-box; }
.hs-sign .led { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--red); margin-top: -10px; box-shadow: 0 0 6px var(--red); transition: background .15s, box-shadow .15s; }
.hs-sign .rd { position: relative; }
.hs-nav.ok .led { background: var(--led); box-shadow: 0 0 10px var(--led); }
.hs-sign .tx { display: flex; flex-direction: column; padding: 6px 10px 6px 9px; }
.hs-sign small { font-family: var(--mono); font-size: 9px; letter-spacing: .08em; color: #a9a59d; text-transform: uppercase; white-space: nowrap; }
.hs-sign b { font-size: 14px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.hs-sign .ar { display: grid; place-items: center; padding: 0 9px; background: var(--brick); }
.hs-sign .ar .i { width: 17px; height: 17px; stroke-width: 2.4; }
.hs-rod { width: 2px; height: 26px; background: linear-gradient(var(--ink), rgba(27, 29, 32, .3)); }
.hs-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); box-shadow: 0 0 0 4px rgba(255, 255, 255, .35); margin-top: -1px; transform: translateY(50%); }
/* --- giấy ghi chú (thông tin) --- */
.hs-info .hs-in, .hs-value .hs-in { transform: translate(-50%, -50%); cursor: pointer; }
.note { width: 32px; height: 32px; background: var(--postit); display: grid; place-items: center; transform: rotate(-5deg); box-shadow: 2px 5px 10px rgba(0, 0, 0, .35); position: relative; transition: transform .2s; clip-path: polygon(0 0, 100% 0, 100% 78%, 78% 100%, 0 100%); }
.note::after { content: ''; position: absolute; right: 0; bottom: 0; width: 22%; height: 22%; background: linear-gradient(135deg, #d9bb3e 50%, transparent 50%); }
.note .i { width: 17px; height: 17px; stroke-width: 2; color: var(--ink); }
.hs-info:hover .note { transform: rotate(0) scale(1.12); }
.tape { position: absolute; top: -6px; left: 50%; width: 22px; height: 9px; margin-left: -11px; background: rgba(255, 255, 255, .55); transform: rotate(3deg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); z-index: 1; }
.hs-lab { position: absolute; left: calc(100% + 8px); top: 50%; transform: translate(-6px, -50%); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600; padding: 5px 9px; white-space: nowrap; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }
.hs:hover .hs-lab, .hs.peek .hs-lab { opacity: 1; transform: translate(0, -50%); }
.hs-value .note { width: 26px; height: 26px; background: var(--pink); transform: rotate(8deg); animation: wob 3.6s ease-in-out infinite; }
.hs-value .note::after { background: linear-gradient(135deg, #e07b93 50%, transparent 50%); }
.hs-value .note b { font-family: var(--hand); font-size: 18px; color: #6b1d31; line-height: 1; }
@keyframes wob { 0%, 100% { transform: rotate(8deg); } 50% { transform: rotate(-4deg) scale(1.06); } }
.hs-value.got .note { animation: fly .9s ease-in forwards; }
@keyframes fly { to { transform: translate(40vw, 40vh) rotate(200deg) scale(.3); opacity: 0; } }
/* --- ghế trống (tuyển dụng) --- */
.hs-job .hs-in { transform: translate(-21px, -50%); display: flex; align-items: center; gap: 8px; cursor: pointer; }
.chair { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--brick); color: #fff; position: relative; box-shadow: 0 6px 16px rgba(0, 0, 0, .35); }
.chair::before, .chair::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--brick); animation: ring 2.4s ease-out infinite; }
.chair::after { animation-delay: 1.2s; }
@keyframes ring { from { transform: scale(.85); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }
.chair .i { width: 21px; height: 21px; }
.job-pill { background: var(--paper); border: 2px solid var(--ink); padding: 4px 9px 5px; box-shadow: 0 8px 18px rgba(0, 0, 0, .3); transition: transform .2s; }
.job-pill small { display: block; font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .1em; color: var(--brick); }
.job-pill b { font-size: 13px; font-weight: 700; white-space: nowrap; }
.hs-job:hover .job-pill { transform: translateX(3px); }
/* --- tính năng --- */
.hs-feature .hs-in { transform: translate(-20px, -50%); display: flex; align-items: center; gap: 8px; cursor: pointer; }
.ft-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; border: 3px solid #fff; box-shadow: 0 0 0 3px var(--moss), 0 8px 18px rgba(0, 0, 0, .4); }
.ft-btn .i { width: 19px; height: 19px; }
.ft-pill { background: var(--moss); color: #fff; padding: 5px 10px 6px; box-shadow: 0 8px 18px rgba(0, 0, 0, .3); }
.ft-pill small { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: .1em; opacity: .85; }
.ft-pill b { font-size: 13px; font-weight: 700; white-space: nowrap; }
.hs-feature:hover .ft-btn { background: var(--moss); }
.edit-dot { position: absolute; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: #f0f; pointer-events: none; }

/* =====================================================================
   SƠ ĐỒ TẦNG
   ===================================================================== */
#planBox { position: fixed; left: 16px; bottom: calc(92px + var(--safe-b)); z-index: 18; width: 312px; background: var(--paper); border: var(--frame); box-shadow: var(--shadow); transform: translateY(12px); opacity: 0; pointer-events: none; }
body.ready #planBox.open { opacity: 1; transform: none; pointer-events: auto; }
.pb-head { display: flex; justify-content: space-between; align-items: center; background: var(--ink); color: #f2efe9; font-size: 10.5px; padding: 0 0 0 10px; height: 26px; }
.pb-x { width: 26px; height: 26px; display: grid; place-items: center; color: #ddd; }
.pb-x .i { width: 15px; height: 15px; }
#planSvg svg { display: block; width: 100%; height: auto; }
.pl-wall { fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linejoin: miter; }
.pl-glass { stroke: #6b8fa3; stroke-width: 2; stroke-dasharray: 5 2; fill: none; }
.pl-room { fill: #ebe7df; stroke: var(--ink); stroke-width: 1.2; transition: fill .25s; }
.pl-room.pano { fill: #f6f1e6; cursor: pointer; }
.pl-room.pano:hover, .pl-room.hl { fill: #f3dcd1; }
.pl-room.here { fill: #f0d3c5; }
.pl-corr { fill: url(#tri); stroke: none; }
.pl-col { fill: var(--brick); }
.pl-lab { font-family: var(--mono); font-size: 8.4px; letter-spacing: .03em; fill: var(--ink); pointer-events: none; }
.pl-lab.big { font-family: var(--font); font-weight: 700; font-size: 10.5px; letter-spacing: 0; }
.pl-lab.dim { fill: #8a8780; font-size: 7.4px; }
.pl-door { stroke: var(--paper); stroke-width: 5; }
.pl-cam { cursor: pointer; }
.pl-cam circle.c { fill: var(--ink); stroke: #fff; stroke-width: 2; }
.pl-cam.here circle.c { fill: var(--brick); }
.pl-cone { fill: rgba(180, 80, 47, .26); stroke: rgba(180, 80, 47, .7); stroke-width: 1; }
.pl-route { fill: none; stroke: var(--brick); stroke-width: 2.6; stroke-dasharray: 4 4; animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -16; } }
.pl-desk { fill: #c9b391; stroke: #8a7350; stroke-width: .6; }
.pl-seat { fill: var(--brick); }
.pb-foot { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 10px 10px; border-top: 1.5px solid var(--ink); }
.pb-foot button { font-size: 11.5px; font-weight: 600; padding: 4px 8px; border: 1.5px solid var(--ink); background: #fff; }
.pb-foot button:hover, .pb-foot button.on { background: var(--ink); color: #fff; }

/* =====================================================================
   THẺ CHẤM CÔNG — một ngày ở văn phòng
   ===================================================================== */
#timecard { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); z-index: 21; width: min(760px, calc(100vw - 24px)); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; background: #f7f3e6 repeating-linear-gradient(180deg, transparent 0 27px, rgba(72, 110, 150, .18) 27px 28px); border: var(--frame); box-shadow: var(--shadow); padding: 10px 14px 12px; }
#timecard.open { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.tc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tc-kick { display: block; font-size: 9.5px; color: var(--brick); font-weight: 700; }
.tc-head b { font-size: 17px; font-weight: 750; letter-spacing: -.01em; }
.tc-clock { display: flex; align-items: center; gap: 6px; }
#tcTime { font-family: var(--mono); font-weight: 700; font-size: 22px; background: var(--ink); color: #ffd36b; padding: 2px 9px; letter-spacing: .04em; min-width: 86px; text-align: center; }
.tc-clock button { width: 32px; height: 32px; display: grid; place-items: center; border: 2px solid var(--ink); background: #fff; }
.tc-clock button:hover { background: var(--ink); color: #fff; }
.tc-clock .i { width: 16px; height: 16px; }
.tc-track { position: relative; height: 46px; margin: 8px 6px 4px; cursor: pointer; touch-action: none; }
.tc-ticks { position: absolute; inset: 14px 0 0; border-top: 2px solid var(--ink); }
.tc-ticks span { position: absolute; top: -6px; width: 1.5px; height: 10px; background: var(--ink); }
.tc-ticks span.h { height: 14px; top: -8px; }
.tc-ticks em { position: absolute; top: 10px; transform: translateX(-50%); font-style: normal; font-family: var(--mono); font-size: 9.5px; color: var(--mute); }
.tc-ticks .ev { position: absolute; top: -5px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: var(--brick); border: 2px solid #f7f3e6; }
.tc-fill { position: absolute; left: 0; top: 13px; height: 4px; background: linear-gradient(90deg, #8fb4d8, #f3c460 55%, #e0763c 80%, #2e3a6b); pointer-events: none; }
.tc-knob { position: absolute; top: 2px; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%; background: var(--ink); border: 3px solid #ffd36b; box-shadow: 0 4px 10px rgba(0, 0, 0, .35); display: grid; place-items: center; pointer-events: none; }
.tc-knob i { width: 6px; height: 6px; border-radius: 50%; background: #ffd36b; }
.tc-rows { display: flex; gap: 6px; overflow-x: auto; padding: 6px 2px 2px; scrollbar-width: thin; }
.tc-row { flex: none; width: 168px; text-align: left; background: #fff; border: 1.5px solid var(--ink); padding: 6px 8px 7px; position: relative; transition: background .2s, transform .2s; }
.tc-row time { font-family: var(--mono); font-weight: 700; font-size: 12px; color: var(--brick); }
.tc-row b { display: block; font-size: 12.5px; font-weight: 700; line-height: 1.2; margin: 1px 0 2px; }
.tc-row p { margin: 0; font-size: 11px; color: var(--mute); line-height: 1.35; }
.tc-row.on { background: #fff4d6; transform: translateY(-2px); }
.tc-row.on::after { content: 'ĐÃ CHẤM'; position: absolute; right: 6px; top: 5px; font-family: var(--mono); font-size: 8.5px; font-weight: 700; color: var(--red); border: 1.5px solid var(--red); padding: 1px 4px; transform: rotate(-8deg); opacity: .85; }

/* =====================================================================
   LỄ TÂN ẢO
   ===================================================================== */
#chat { position: fixed; right: 16px; bottom: calc(92px + var(--safe-b)); z-index: 23; width: 350px; height: min(500px, calc(100vh - 190px)); display: flex; flex-direction: column; background: var(--paper); border: var(--frame); box-shadow: var(--shadow); transform: translateY(16px); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; }
#chat.open { opacity: 1; transform: none; pointer-events: auto; }
.ch-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; background: var(--ink); color: #f2efe9; }
.ch-av { width: 34px; height: 34px; border-radius: 50%; background: var(--brick); display: grid; place-items: center; font-weight: 750; font-size: 13px; position: relative; flex: none; }
.ch-av::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--led); border: 2px solid var(--ink); }
.ch-head > div { flex: 1; display: flex; flex-direction: column; }
.ch-head b { font-size: 14px; }
.ch-head small { font-family: var(--mono); font-size: 10px; color: #b8b4ac; }
#chX { width: 30px; height: 30px; display: grid; place-items: center; }
.ch-log { flex: 1; overflow-y: auto; padding: 12px 12px 4px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 86%; padding: 8px 11px; font-size: 13.5px; line-height: 1.45; border-radius: 3px; animation: pop .25s ease; }
.msg.bot { background: #fff; border: 1.5px solid var(--ink); align-self: flex-start; }
.msg.me { background: var(--ink); color: #fff; align-self: flex-end; }
.msg .acts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.msg .acts button { font-size: 12px; font-weight: 650; padding: 4px 8px; background: var(--brick); color: #fff; }
.msg.typing { display: flex; gap: 4px; padding: 11px 12px; }
.msg.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--steel); animation: blink 1s infinite; }
.msg.typing i:nth-child(2) { animation-delay: .15s; } .msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .25; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.ch-chips { display: flex; gap: 5px; overflow-x: auto; padding: 6px 10px; scrollbar-width: none; }
.ch-chips button { flex: none; font-size: 12px; font-weight: 600; padding: 5px 9px; border: 1.5px solid var(--ink); background: #fff; white-space: nowrap; }
.ch-chips button:hover { background: var(--postit); }
.ch-in { display: flex; border-top: 2px solid var(--ink); }
.ch-in input { flex: 1; border: 0; padding: 11px 12px; background: #fff; outline: none; font-size: 14px; min-width: 0; }
.ch-in button { width: 46px; display: grid; place-items: center; background: var(--brick); color: #fff; }

/* =====================================================================
   BẢNG PHỤ (sheet) · POPUP · TOAST
   ===================================================================== */
#sheet { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
#sheet.open { pointer-events: auto; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 12, .18); opacity: 0; transition: opacity .3s; }
#sheet.open .sheet-backdrop { opacity: 1; }
.sheet-card { position: absolute; top: 0; right: 0; bottom: 0; width: min(470px, 100vw); background: var(--paper); border-left: var(--frame); box-shadow: -20px 0 50px rgba(0, 0, 0, .3); transform: translateX(104%); transition: transform .38s cubic-bezier(.6, 0, .2, 1); display: flex; flex-direction: column; }
#sheet.open .sheet-card { transform: none; }
.sheet-x { position: absolute; top: 10px; right: 10px; z-index: 2; width: 36px; height: 36px; display: grid; place-items: center; background: var(--ink); color: #fff; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.sh-head { background: var(--ink); color: #f3f0ea; padding: 18px 60px 16px 20px; position: relative; }
.sh-head .kick { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: #e8a58d; font-weight: 700; }
.sh-head h2 { margin: 4px 0 2px; font-size: 25px; line-height: 1.1; font-weight: 780; letter-spacing: -.02em; font-variation-settings: 'wdth' 88; }
.sh-head p { margin: 4px 0 0; font-size: 13px; color: #c5c1b9; line-height: 1.45; }
.sh-pad { padding: 16px 20px 22px; }
.sh-sec { margin-top: 20px; }
.sh-sec:first-child { margin-top: 0; }
.sh-sec > h3 { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; font-weight: 700; margin: 0 0 8px; color: var(--mute); text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.sh-sec > h3::after { content: ''; flex: 1; height: 1.5px; background: var(--ink); opacity: .2; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; font-weight: 700; font-size: 14px; letter-spacing: -.005em; text-decoration: none; transition: background .2s, color .2s, transform .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn .i { width: 18px; height: 18px; }
.btn-brick { background: var(--brick); color: #fff; }
.btn-brick:hover { background: var(--brick2); }
.btn-brick:disabled { background: #b9aaa3; cursor: wait; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #000; }
.btn-line { border: 2px solid var(--ink); background: #fff; }
.btn-line:hover { background: var(--ink); color: #fff; }
.btn-ghost { color: var(--mute); text-decoration: underline; text-underline-offset: 3px; padding: 0 8px; font-weight: 600; }
.btn-moss { background: var(--moss); color: #fff; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fld { display: block; margin-top: 10px; }
.fld > span { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin-bottom: 4px; }
.fld input, .fld select, .fld textarea { width: 100%; height: 42px; border: 2px solid var(--ink); background: #fff; padding: 0 11px; font-size: 14.5px; outline: none; border-radius: 0; }
.fld textarea { height: 76px; padding: 9px 11px; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--brick); box-shadow: 0 0 0 3px rgba(180, 80, 47, .18); }
.fld.err input { border-color: var(--red); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 11px; border: 2px solid var(--ink); background: #fff; font-size: 13px; font-weight: 600; }
.chip.on { background: var(--ink); color: #fff; }
.chip:disabled { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
.demo-note { margin-top: 14px; font-size: 11.5px; color: var(--mute); line-height: 1.45; padding: 8px 10px; background: rgba(0, 0, 0, .04); border-left: 3px solid var(--oak); }

/* --- công việc --- */
.job-card { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 12px; background: #fff; border: 2px solid var(--ink); margin-bottom: 8px; transition: transform .15s, box-shadow .15s; }
.job-card:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.job-card .chair { width: 38px; height: 38px; flex: none; }
.job-card .chair::before, .job-card .chair::after { display: none; }
.job-card .chair.off { background: var(--steel); }
.job-card b { display: block; font-size: 15px; line-height: 1.2; }
.job-card small { display: block; font-size: 12px; color: var(--mute); margin-top: 3px; }
.job-card em { font-style: normal; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--brick); }
.jd-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5px; background: var(--ink); border: 1.5px solid var(--ink); }
.jd-meta div { background: #fff; padding: 8px 10px; }
.jd-meta span { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; color: var(--mute); text-transform: uppercase; }
.jd-meta b { font-size: 13.5px; }
.ul { margin: 0; padding: 0; list-style: none; }
.ul li { position: relative; padding: 5px 0 5px 20px; font-size: 14px; line-height: 1.45; border-bottom: 1px dashed rgba(0, 0, 0, .14); }
.ul li::before { content: ''; position: absolute; left: 3px; top: 12px; width: 8px; height: 8px; background: var(--brick); }
.seat-note { display: flex; gap: 10px; align-items: center; background: var(--postit); padding: 10px 12px; font-family: var(--hand); font-size: 17px; line-height: 1.25; transform: rotate(-.6deg); box-shadow: 2px 4px 10px rgba(0, 0, 0, .15); }
.perks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.perks div { display: flex; gap: 8px; align-items: center; font-size: 12.5px; line-height: 1.3; padding: 8px; background: #fff; border: 1.5px solid rgba(0, 0, 0, .15); }
.perks .i { color: var(--moss); width: 18px; height: 18px; }
.steps { counter-reset: s; margin: 0; padding: 0; list-style: none; }
.steps li { counter-increment: s; display: flex; gap: 10px; align-items: center; padding: 6px 0; font-size: 13.5px; }
.steps li::before { content: counter(s); width: 24px; height: 24px; flex: none; display: grid; place-items: center; background: var(--ink); color: #fff; font-family: var(--mono); font-size: 12px; font-weight: 700; }

/* --- hồ sơ năng lực --- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5px; background: var(--ink); border: 2px solid var(--ink); }
.stats div { background: #fff; padding: 12px 12px 10px; }
.stats b { display: block; font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variation-settings: 'wdth' 80; color: var(--brick); }
.stats span { font-size: 12px; color: var(--mute); }
.svc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.svc div { padding: 10px; background: #fff; border: 1.5px solid var(--ink); }
.svc .i { color: var(--brick); }
.svc b { display: block; font-size: 13.5px; margin: 5px 0 2px; }
.svc small { font-size: 11.5px; color: var(--mute); line-height: 1.35; display: block; }
.tl { list-style: none; margin: 0; padding: 0 0 0 4px; border-left: 3px solid var(--ink); }
.tl li { position: relative; padding: 0 0 12px 18px; font-size: 13.5px; line-height: 1.45; }
.tl li::before { content: ''; position: absolute; left: -9px; top: 3px; width: 15px; height: 15px; background: var(--paper); border: 3px solid var(--brick); border-radius: 50%; }
.tl b { font-family: var(--mono); font-size: 13px; display: block; }
.clients { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.clients div { font-size: 12.5px; padding: 9px 10px; background: repeating-linear-gradient(135deg, #fff 0 8px, #f3f1ec 8px 16px); border: 1.5px dashed var(--steel); line-height: 1.3; }

/* --- đặt hẹn / vé hẹn --- */
.days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.day { flex: none; width: 58px; padding: 6px 0 7px; text-align: center; border: 2px solid var(--ink); background: #fff; }
.day small { display: block; font-family: var(--mono); font-size: 9.5px; color: var(--mute); }
.day b { font-size: 19px; font-weight: 750; }
.day.on { background: var(--ink); color: #fff; }
.day.on small { color: #ccc; }
.pass { background: #fff; border: 2px solid var(--ink); display: grid; grid-template-columns: 1fr 112px; position: relative; margin-top: 4px; }
.pass::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: var(--strap, var(--brick)); }
.pass .pa { padding: 20px 14px 14px; }
.pass .pa small { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; color: var(--mute); display: block; }
.pass .pa b { font-size: 17px; display: block; line-height: 1.2; margin-bottom: 6px; }
.pass .pa p { margin: 3px 0; font-size: 13px; }
.pass .pq { border-left: 2px dashed var(--ink); padding: 20px 10px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pass .pq svg { width: 92px; height: 92px; }
.pass .pq code { font-family: var(--mono); font-weight: 700; font-size: 12px; }

/* --- tính năng --- */
.feat { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.feat button { text-align: left; padding: 11px; background: #fff; border: 2px solid var(--ink); display: flex; flex-direction: column; gap: 4px; transition: transform .15s, box-shadow .15s; }
.feat button:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--brick); }
.feat .i { color: var(--brick); width: 22px; height: 22px; }
.feat b { font-size: 13.5px; line-height: 1.2; }
.feat small { font-size: 11.5px; color: var(--mute); line-height: 1.35; }

/* --- logo trên tường --- */
.wall-prev { display: block; width: 100%; height: auto; border: 2px solid var(--ink); background: #ccc; }
.finish { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.finish button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; text-align: center; padding: 6px 2px; border: 2px solid transparent; }
.finish button i { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid rgba(0, 0, 0, .25); }
.finish button.on { border-color: var(--ink); background: #fff; }
.rng { width: 100%; accent-color: var(--brick); }
.drop { display: flex; align-items: center; gap: 10px; padding: 12px; border: 2px dashed var(--ink); background: #fff; cursor: pointer; font-size: 13px; }
.drop:hover { background: #fff7e8; }

/* --- popup thông tin --- */
#pop { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; padding: 16px; pointer-events: none; }
#pop.open { pointer-events: auto; }
.pop-card { width: min(390px, 100%); max-height: calc(100vh - 140px); overflow-y: auto; background: var(--paper); border: var(--frame); box-shadow: var(--shadow); position: relative; transform: translateY(14px) scale(.97); opacity: 0; transition: transform .25s, opacity .25s; }
#pop.open .pop-card { transform: none; opacity: 1; }
.pop-x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; display: grid; place-items: center; background: var(--ink); color: #fff; z-index: 2; }
.pop-note { background: var(--postit); margin: 14px 54px 0 14px; padding: 10px 12px 9px; font-family: var(--hand); font-size: 22px; line-height: 1.15; transform: rotate(-1.4deg); box-shadow: 2px 5px 12px rgba(0, 0, 0, .18); position: relative; }
.pop-note.pink { background: var(--pink); color: #4b1622; }
.pop-note.moss { background: #cfe0b4; }
.pop-pad { padding: 12px 16px 16px; }
.pop-pad p { margin: 4px 0 0; font-size: 14px; line-height: 1.55; }
.pop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.wifi { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 10px; background: #fff; border: 2px solid var(--ink); }
.wifi svg { width: 96px; height: 96px; flex: none; }
.wifi code { font-family: var(--mono); font-size: 12.5px; display: block; line-height: 1.6; }

#toast { position: fixed; left: 50%; top: 84px; z-index: 60; transform: translate(-50%, -10px); background: var(--ink); color: #f6f3ed; padding: 9px 15px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: min(560px, calc(100vw - 24px)); text-align: center; line-height: 1.4; border-left: 4px solid var(--brick); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#caption { position: fixed; left: 50%; bottom: calc(40px + var(--safe-b)); z-index: 21; transform: translate(-50%, 10px); max-width: min(680px, calc(100vw - 30px)); background: var(--ink); color: #fff; padding: 12px 18px 14px; font-size: 16px; font-weight: 650; text-align: center; opacity: 0; transition: opacity .4s, transform .4s; pointer-events: none; }
#caption.show { opacity: 1; transform: translate(-50%, 0); }
.cap-bar { display: block; height: 3px; margin-top: 9px; background: rgba(255, 255, 255, .2); }
.cap-bar i { display: block; height: 100%; width: 0; background: var(--brick); }

/* =====================================================================
   QUẦY CHECK-IN (màn mở đầu)
   ===================================================================== */
#loader { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at 50% 40%, rgba(20, 21, 23, .35), rgba(12, 12, 14, .82)); transition: opacity .7s, visibility .7s; }
#loader.out { opacity: 0; visibility: hidden; pointer-events: none; }
#loader.enter .kiosk { transform: translateY(30px) scale(.96); opacity: 0; }
.kiosk { width: min(580px, 100%); background: #16181b; border-radius: 22px; padding: 12px 14px 12px; box-shadow: 0 40px 90px rgba(0, 0, 0, .6), inset 0 0 0 1px #2c2f34; transition: transform .6s, opacity .6s; }
.ks-top { display: flex; align-items: center; gap: 10px; padding: 4px 4px 12px; color: #efebe4; }
.ks-logo { width: 38px; height: 38px; }
.ks-top > div:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.ks-brand { font-size: 16px; font-weight: 750; }
.ks-floor { font-size: 10px; color: #a5a198; }
.ks-lang { display: flex; border: 1.5px solid #4a4e55; }
.ks-lang button { font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 5px 9px; color: #a8a49c; }
.ks-lang button.on { background: #efebe4; color: var(--ink); }
.ks-screen { position: relative; background: var(--paper); border-radius: 9px; padding: 22px 24px 20px; min-height: 380px; overflow: hidden; }
.ks-kick { font-size: 10.5px; color: var(--brick); font-weight: 700; }
.ks-screen h1 { margin: 4px 0 2px; font-size: clamp(25px, 4.6vw, 33px); line-height: 1.05; letter-spacing: -.025em; font-weight: 790; font-variation-settings: 'wdth' 86, 'opsz' 60; }
.ks-q { margin: 14px 0 8px; font-weight: 650; font-size: 14px; }
.ks-purpose { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ks-purpose button { text-align: left; padding: 11px 10px 10px; background: #fff; border: 2px solid var(--ink); display: flex; flex-direction: column; gap: 4px; position: relative; transition: transform .15s, box-shadow .15s, background .15s; }
.ks-purpose button:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--pc, var(--brick)); }
.ks-purpose button .i { width: 24px; height: 24px; color: var(--pc); }
.ks-purpose b { font-size: 14px; line-height: 1.15; }
.ks-purpose small { font-size: 11.5px; color: var(--mute); line-height: 1.3; }
.ks-purpose button.on { background: var(--pc); color: #fff; box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px); }
.ks-purpose button.on .i, .ks-purpose button.on small { color: #fff; }
.ks-purpose button.on::after { content: '✓'; position: absolute; top: 7px; right: 9px; font-weight: 800; }
.ks-name { display: block; margin-top: 14px; }
.ks-name span { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--mute); text-transform: uppercase; }
.ks-name input { width: 100%; border: 0; border-bottom: 2.5px solid var(--ink); background: transparent; padding: 6px 0 5px; font-size: 22px; font-weight: 700; outline: none; letter-spacing: -.01em; }
.ks-name input:focus { border-bottom-color: var(--brick); }
/* công tắc thuyết minh ở quầy check-in (kiểu công tắc bập bênh, đèn LED) */
.ks-voice { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 9px 12px; background: #fff; border: 2px solid var(--ink); text-align: left; transition: background .2s; }
.ks-voice:hover { background: #fffaf0; }
.ks-voice:focus-visible { outline: 3px solid var(--brick); outline-offset: 2px; }
.ks-voice > .i { width: 22px; height: 22px; color: var(--mute); transition: color .2s; }
.ks-voice.on > .i { color: var(--brick); }
.kv-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.2; }
.kv-txt b { font-size: 14px; font-weight: 700; }
.kv-txt small { font-size: 11.5px; color: var(--mute); }
.kv-sw { display: flex; align-items: center; gap: 8px; flex: none; }
.kv-sw em { font-style: normal; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); min-width: 30px; text-align: right; }
.kv-sw i { position: relative; width: 46px; height: 24px; background: var(--concrete2); border: 2px solid var(--ink); transition: background .2s; }
.kv-sw i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; background: var(--ink); transition: transform .2s, background .2s; }
.ks-voice.on .kv-sw em { color: var(--moss); }
.ks-voice.on .kv-sw i { background: var(--moss); }
.ks-voice.on .kv-sw i::after { transform: translateX(22px); background: #fff; box-shadow: 0 0 0 2px var(--ink); }
.ks-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.ks-actions .btn-brick { height: 48px; padding: 0 22px; font-size: 15.5px; }
.ks-bar { height: 3px; margin: 10px 6px 0; background: #2c2f34; border-radius: 2px; overflow: hidden; }
.ks-bar i { display: block; height: 100%; width: 0; background: var(--led); transition: width .3s; }
.ks-foot { display: flex; justify-content: space-between; gap: 10px; padding: 8px 6px 2px; font-size: 11.5px; color: #a5a198; }
.ks-clock { color: #ffd36b; }
.ld-maker { position: fixed; bottom: calc(14px + var(--safe-b)); left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 11px; color: rgba(255, 255, 255, .75); text-decoration: none; white-space: nowrap; }
.ld-maker b { color: #fff; }
/* máy in thẻ */
.ks-print { position: absolute; inset: 0; background: var(--paper); display: flex; flex-direction: column; align-items: center; padding-top: 18px; opacity: 0; pointer-events: none; transition: opacity .3s; }
.ks-print.on { opacity: 1; pointer-events: auto; }
.slot { width: 230px; height: 14px; background: var(--ink); border-radius: 7px; box-shadow: inset 0 3px 4px #000; position: relative; z-index: 2; }
.pcard { width: 196px; margin-top: -6px; clip-path: inset(0 0 100% 0); transition: clip-path 1.5s steps(24); }
.ks-print.on .pcard { clip-path: inset(0 0 0 0); }
.badge-card { --strap: var(--brick); width: 196px; background: #fbfaf7; border-radius: 9px; box-shadow: 0 16px 34px rgba(0, 0, 0, .3), inset 0 0 0 1px rgba(0, 0, 0, .1); overflow: hidden; text-align: center; padding-bottom: 12px; position: relative; }
.badge-card::before { content: ''; position: absolute; top: 9px; left: 50%; width: 34px; height: 6px; margin-left: -17px; border-radius: 4px; background: rgba(0, 0, 0, .28); }
.badge-card .bc-band { height: 40px; background: var(--strap); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 5px; }
.badge-card .bc-band span { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .26em; color: #fff; }
.badge-card .bc-ini { width: 62px; height: 62px; margin: 12px auto 6px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 25px; font-weight: 780; box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--strap); }
.badge-card .bc-name { font-size: 20px; font-weight: 780; letter-spacing: -.02em; padding: 0 10px; line-height: 1.1; word-break: break-word; }
.badge-card .bc-kind { font-size: 12px; color: var(--mute); margin-top: 2px; }
.badge-card .bc-qr { width: 78px; height: 78px; margin: 10px auto 4px; }
.badge-card .bc-qr svg { width: 100%; height: 100%; display: block; }
.badge-card .bc-meta { font-family: var(--mono); font-size: 9.5px; color: var(--mute); letter-spacing: .04em; line-height: 1.6; }
.badge-card .bc-logo { position: absolute; top: 46px; right: 10px; width: 22px; opacity: .9; }
.ks-print .p-msg { margin-top: 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--mute); }
.flybadge { position: fixed; z-index: 120; pointer-events: none; transition: transform .9s cubic-bezier(.6, 0, .2, 1), opacity .9s; transform-origin: top left; }

/* =====================================================================
   ĐIỆN THOẠI
   ===================================================================== */
@media (max-width: 1180px) {
  #sign { max-width: calc(100vw - 520px); min-width: 220px; }
  #dock button { min-width: 64px; padding: 8px 7px 7px; font-size: 10.5px; }
}
@media (max-width: 900px) {
  #top { padding: 10px 10px 0 82px; }
  #sign { top: 64px; left: 50%; max-width: calc(100vw - 24px); }
  .pl-name { font-size: 13.5px; }
  #toast { top: 128px; }
  #dock { left: 8px; right: 8px; transform: none; bottom: calc(8px + var(--safe-b)); justify-content: space-between; overflow-x: auto; scrollbar-width: none; }
  #dock button { flex: 1; min-width: 58px; font-size: 10px; gap: 3px; padding: 7px 3px 6px; }
  #dock button .i { width: 19px; height: 19px; }
  .dk-badge { right: 4px; }
  #btnAuto { bottom: calc(84px + var(--safe-b)); right: 10px; height: 34px; }
  #btnAuto span { display: none; }
  #valuesChip { bottom: calc(126px + var(--safe-b)); right: 10px; }
  #maker { display: none; }
  #planBox { left: 8px; right: 8px; width: auto; bottom: calc(84px + var(--safe-b)); max-width: 420px; }
  #timecard { bottom: calc(84px + var(--safe-b)); }
  #chat { right: 8px; left: 8px; width: auto; bottom: calc(84px + var(--safe-b)); height: min(470px, calc(100vh - 230px)); }
  #lanyard { left: 10px; transform: scale(.88); transform-origin: top left; }
}
@media (max-width: 560px) {
  #top { padding: 10px 8px 0 74px; }
  #tools { flex-direction: column; gap: 2px; padding: 3px; }
  #tools button { width: 34px; height: 34px; }
  #tools #btnFull { display: none; }
  #sign { left: 74px; right: 52px; transform: none; top: 62px; min-width: 0; max-width: none; }
  .sg-step { width: 28px; }
  .sg-body { padding: 5px 8px; column-gap: 8px; }
  .sg-code { font-size: 11.5px; padding: 5px 5px; }
  #toast { top: 120px; }
  #dock button { min-width: 0; font-size: 10px; padding: 7px 2px 6px; }
  #dock button span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  #plate { padding: 5px 10px 5px 5px; }
  .pl-logo { width: 30px; height: 30px; }
  .pl-name { font-size: 12.5px; }
  .pl-status { font-size: 9.5px; }
  .sg-body b { font-size: 14.5px; }
  .ks-screen { padding: 18px 16px 16px; }
  .ks-purpose { grid-template-columns: 1fr; gap: 6px; }
  .ks-purpose button { flex-direction: row; align-items: center; gap: 10px; padding: 9px 10px; }
  .ks-purpose button small { display: none; }
  .hs-sign b { font-size: 12.5px; }
  .job-pill b, .ft-pill b { font-size: 12px; }
  .tc-row { width: 150px; }
  .perks, .svc, .clients { grid-template-columns: 1fr; }
  .finish { grid-template-columns: repeat(3, 1fr); }
}
@media (max-height: 560px) and (orientation: landscape) {
  .ks-screen { min-height: 0; }
  .ks-purpose small { display: none; }
  .kv-txt small { display: none; }
  .ks-voice { margin-top: 10px; padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
