:root {
  --brand: #d9604a;
  --brand-soft: #f8e3de;
  --navy: #16203d;
  --tile: #fcefe3;
  --text: #1c2233;
  --muted: #6c7282;
  --line: #e7e7ea;
  --bg: #ffffff;
  --map: #e8e8e4;
  --blue: #2f7cf6;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(20, 24, 40, .12), 0 1px 2px rgba(20, 24, 40, .08);
  --shadow-lg: 0 10px 40px rgba(20, 24, 40, .18);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --sheet-w: 100%;
  font-family: Lato, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--map); overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ic { display: block; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* loader */
.loader { position: fixed; inset: 0; z-index: 100; background: #fff; display: grid; place-content: center; justify-items: center; gap: 22px; transition: opacity .35s; }
.loader.done { opacity: 0; pointer-events: none; }
.loader p { margin: 0; font-size: 20px; color: var(--navy); }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 48px; }
.bars i { width: 10px; height: 22px; background: var(--navy); border-radius: 1px; animation: bar 1s infinite ease-in-out; }
.bars i:nth-child(2) { animation-delay: .1s } .bars i:nth-child(3) { animation-delay: .2s } .bars i:nth-child(4) { animation-delay: .3s } .bars i:nth-child(5) { animation-delay: .4s; }
@keyframes bar { 0%, 100% { height: 22px } 50% { height: 48px } }

.app { position: fixed; inset: 0; }
.map { position: absolute; inset: 0; touch-action: none; background: radial-gradient(120% 90% at 50% 38%, #f6f6f4 0%, #eceeef 45%, #dcdfe5 100%); }
.map::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(140% 100% at 50% 45%, transparent 60%, rgba(30,36,60,.10) 100%); }
.map-canvas { width: 100%; height: 100%; display: block; outline: none; }
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

/* markers */
.marker { position: absolute; left: 0; top: 0; will-change: transform; pointer-events: none; transition: opacity .28s ease; }
.marker.hid, .marker[data-floor="off"] { opacity: 0; }
.marker.hid *, .marker[data-floor="off"] * { pointer-events: none !important; }
.pin.sel { animation: pinDrop .7s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes pinDrop { 0% { transform: translate(-50%, -160%) scale(.6); opacity: 0; } 60% { opacity: 1; } 100% { transform: translate(-50%, -100%) scale(1); } }
.pin.sel .pin-ic { position: relative; }
.pin.sel .pin-ic::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid #f4c542; animation: ring 1.8s ease-out infinite; }
@keyframes ring { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }
.bubble { animation: pop .45s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes pop { from { transform: translate(-50%, -80%) scale(.7); opacity: 0; } to { transform: translate(-50%, -100%) scale(1); opacity: 1; } }
.stack-label { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 0; background: rgba(255,255,255,.92); box-shadow: 0 6px 20px rgba(20,24,40,.14); font: 700 13px Lato, system-ui, sans-serif; color: #1c2233; cursor: pointer; pointer-events: auto; transform-origin: 0 0; margin: -16px 0 0 -8px; transition: opacity .3s, background .2s; white-space: nowrap; backdrop-filter: blur(6px); }
.stack-label.hid { opacity: 0 !important; pointer-events: none; }
.stack-label .sl-short { width: 24px; height: 24px; border-radius: 50%; background: #eef0f3; display: grid; place-items: center; font-weight: 900; font-size: 12px; }
.stack-label.on { background: var(--navy); color: #fff; }
.stack-label.on .sl-short { background: var(--brand); color: #fff; }
.ctrl.on-stack { background: var(--navy); color: #fff; }
.tour-chip { position: absolute; left: 50%; bottom: 18px; white-space: nowrap; transform: translateX(-50%); z-index: 16; background: rgba(22,32,61,.9); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; display: flex; gap: 8px; align-items: center; pointer-events: none; backdrop-filter: blur(8px); transition: opacity .4s; }
.tour-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #ff5b3a; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.sheet, .floor-btn, .a11y-fab, .ctrls, .topbar { transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .4s, height .28s cubic-bezier(.2,.8,.2,1), bottom .25s; }
body.cinema .sheet { transform: translateY(110%); }
body.cinema .topbar, body.cinema .ctrls, body.cinema .a11y-fab, body.cinema .powered { opacity: 0; pointer-events: none; }
body.cinema .floor-btn { bottom: 18px; }
@media (min-width: 900px) { body.cinema .sheet { transform: translateX(-120%); } body.cinema .floor-btn { left: 16px; } }
.marker > * { transform: translate(-50%, -100%); }
.marker.clickable > * { pointer-events: auto; cursor: pointer; }
.pin { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pin-ic { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0,0,0,.25); }
.pin-ic .ic { width: 15px; height: 15px; }
.pin-ic.grey { background: #fff; color: var(--navy); box-shadow: 0 0 0 1.5px #c9ccd3, 0 2px 5px rgba(0,0,0,.18); }
.pin-label { font-size: 12px; font-weight: 700; color: #2c3244; white-space: nowrap; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.pin.sel { transform: translate(-50%, -100%); }
.pin.sel .pin-ic { width: 46px; height: 46px; box-shadow: 0 0 0 4px #f4c542, 0 0 0 7px #fff, 0 4px 14px rgba(0,0,0,.3); }
.pin.sel .pin-ic .ic { width: 24px; height: 24px; }
.pin.sel .pin-label { font-size: 15px; margin-top: 6px; }
.pin.origin .pin-ic { box-shadow: 0 0 0 4px #9cc3ff, 0 0 0 7px #fff, 0 4px 14px rgba(0,0,0,.3); }
.bubble { background: #fff; border: 1.5px solid #e2a79a; border-radius: 6px; padding: 7px 11px; font-size: 14px; white-space: nowrap; box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.bubble b { font-size: 15px; }
.bubble .sub { color: var(--text); font-size: 13px; }
.bubble.go { padding: 5px 10px 5px 5px; }
.bubble.go .ci { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; }
.bubble.sum { flex-direction: column; align-items: flex-start; gap: 1px; }

/* top bar */
.topbar { position: absolute; left: 12px; right: 12px; top: calc(12px + var(--safe-t)); z-index: 20; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.search { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 8px 0 16px; background: #fff; border-radius: 26px; box-shadow: var(--shadow); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; font-size: 17px; background: transparent; height: 100%; }
.search input::placeholder { color: #8a8f9c; }
.search input::-webkit-search-cancel-button { display: none; }
.search-ic { color: #3d4250; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #3d4250; }
.icon-btn:hover { background: #f3f3f5; }
.nav-banner { display: flex; gap: 14px; align-items: center; background: var(--navy); color: #fff; border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-lg); min-height: 76px; }
.nav-banner .nb-ic { width: 46px; height: 46px; flex: none; display: grid; place-items: center; }
.nav-banner .nb-ic .ic { width: 42px; height: 42px; }
.nb-dist { font-size: 24px; font-weight: 900; line-height: 1.1; }
.nb-main { font-size: 17px; font-weight: 700; line-height: 1.25; }
.nb-sub { font-size: 14px; opacity: .8; }
.nav-banner.connector { background: var(--brand); }
.nav-banner.arrive { background: #2c8a57; }

/* map controls */
.ctrls { position: absolute; right: 12px; top: calc(76px + var(--safe-t)); z-index: 15; display: flex; flex-direction: column; gap: 10px; }
.ctrl { width: 42px; height: 42px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); display: grid; place-items: center; color: #343a4a; }
.ctrl.txt { font-weight: 900; font-size: 14px; }
.ctrl.on { color: var(--blue); }
.ctrl-group { display: flex; flex-direction: column; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.ctrl-group .ctrl { box-shadow: none; border-radius: 0; }
.ctrl-group .ctrl + .ctrl { border-top: 1px solid var(--line); }
#compassNeedle { display: block; transition: transform .1s linear; }
body.nav .ctrls { top: calc(110px + var(--safe-t)); }

.floor-btn { position: absolute; left: 12px; bottom: calc(var(--sheet-h, 150px) + 14px); z-index: 15; height: 50px; padding: 0 16px 0 12px; display: flex; align-items: center; gap: 9px; background: #fff; border-radius: 10px; box-shadow: var(--shadow); font-size: 17px; color: var(--text); transition: bottom .25s; }
.floor-menu { position: absolute; left: 12px; bottom: calc(var(--sheet-h, 150px) + 72px); z-index: 25; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 190px; display: flex; flex-direction: column; }
.floor-menu button { text-align: left; padding: 11px 14px; border-radius: 8px; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.floor-menu button:hover { background: #f4f4f6; }
.floor-menu button.on { background: var(--brand-soft); font-weight: 700; }
.floor-menu .fl-short { width: 28px; height: 28px; border-radius: 7px; background: #eef0f3; display: grid; place-items: center; font-weight: 900; font-size: 13px; }
.floor-menu .on .fl-short { background: var(--brand); color: #fff; }
.floor-menu .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--navy); margin-left: auto; }
.a11y-fab { position: absolute; right: 12px; bottom: calc(var(--sheet-h, 150px) + 14px); z-index: 15; width: 46px; height: 46px; border-radius: 6px; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow); transition: bottom .25s; }
.a11y-fab[aria-pressed="true"] { background: var(--navy); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--navy); }
.recenter { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--sheet-h, 150px) + 14px); z-index: 16; background: #fff; border-radius: 22px; padding: 10px 18px; box-shadow: var(--shadow); font-weight: 700; display: flex; gap: 8px; align-items: center; color: var(--blue); }

/* bottom sheet */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 18; background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -4px 24px rgba(20,24,40,.12); display: flex; flex-direction: column; height: var(--sheet-h, 150px); transition: height .28s cubic-bezier(.2,.8,.2,1); padding-bottom: var(--safe-b); max-height: calc(100% - 20px); }
.sheet.dragging { transition: none; }
.grab { height: 22px; display: grid; place-items: center; cursor: grab; flex: none; touch-action: none; }
.grab i { width: 42px; height: 5px; border-radius: 3px; background: #dadbe0; }
.sheet-body { overflow-y: auto; flex: 1; padding: 0 16px 16px; overscroll-behavior: contain; }

.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 8px; padding: 6px 0 12px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 15px; text-align: center; line-height: 1.2; padding: 4px; border-radius: 12px; }
.cat:hover { background: #fafafa; }
.tile { width: 48px; height: 48px; border-radius: 6px; background: var(--tile); display: grid; place-items: center; }
.tile .round { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; }
.tile .round .ic { width: 19px; height: 19px; }
.sec-title { font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 10px 0 6px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 14px 0 6px; border-radius: 18px; background: var(--brand-soft); display: flex; align-items: center; gap: 7px; font-size: 15px; }
.chip .round { width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; }
.chip .round .ic { width: 14px; height: 14px; }
.chip.on { background: var(--brand); color: #fff; }
.chip.on .round { background: #fff; color: var(--brand); }

.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-radius: 10px; text-align: left; width: 100%; }
.row:hover, .row:focus-visible { background: #f2f2f3; outline: none; }
.row .round { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; flex: none; }
.row .round .ic { width: 17px; height: 17px; }
.row .round.me { background: var(--blue); }
.row .round.ghost { background: #eef0f3; color: var(--navy); }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 13px; color: var(--muted); }
.row .chev { color: #9a9ea9; }
.empty { padding: 30px 0; text-align: center; color: var(--muted); }

/* place card */
.card-head { display: flex; align-items: flex-start; gap: 12px; padding: 4px 0 12px; }
.card-head .round { width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; flex: none; margin-top: 2px; }
.card-head h2 { margin: 0; font-size: 21px; font-weight: 900; }
.card-head .meta { color: var(--muted); font-size: 14px; display: flex; gap: 10px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.card-head .meta .ic { display: inline-block; vertical-align: -2px; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; }
.circle-btn { width: 32px; height: 32px; border-radius: 50%; background: #f0f0f2; display: grid; place-items: center; color: #444a5a; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.btn { height: 46px; padding: 0 18px; border-radius: 23px; display: inline-flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; background: var(--brand-soft); color: var(--text); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.dark { background: var(--navy); color: #fff; }
.btn.block { flex: 1; justify-content: center; }
.btn:disabled { opacity: .5; }
.info { display: grid; gap: 10px; font-size: 15px; line-height: 1.45; padding: 4px 0 8px; }
.info-row { display: flex; gap: 10px; color: #3a4052; }
.info-row .ic { color: var(--muted); margin-top: 2px; }
.info a { color: var(--brand); }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 700; background: #e7f4ec; color: #2c8a57; }
.pill.closed { background: #f7e5e3; color: #b0463a; }

/* directions */
.odbox { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 4px 4px 4px 10px; margin: 2px 0 12px; }
.od { flex: 1; min-width: 0; }
.od .row { padding: 8px 4px; }
.od .row + .row { border-top: 1px solid var(--line); border-radius: 0; }
.od .name { font-size: 16px; }
.summary { display: flex; align-items: center; gap: 16px; font-size: 16px; margin: 0 0 12px; flex-wrap: wrap; }
.summary span { display: inline-flex; align-items: center; gap: 5px; }
.summary .tag { font-size: 13px; color: var(--muted); }
.origin-input { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 24px; padding: 0 6px 0 14px; height: 46px; margin: 2px 0 10px; }
.origin-input input { flex: 1; border: 0; outline: none; font-size: 16px; min-width: 0; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); align-items: center; }
.steps li.cur { background: #f6f7fb; border-radius: 10px; }
.steps .sic { width: 34px; height: 34px; border-radius: 50%; background: #eef0f4; display: grid; place-items: center; color: var(--navy); flex: none; }
.steps .sic.con { background: var(--brand); color: #fff; }
.steps .stxt { flex: 1; font-size: 15px; }
.steps .sd { font-size: 13px; color: var(--muted); }
.navbar { display: flex; align-items: center; gap: 10px; padding: 4px 0 8px; }
.navbar .step-arrow { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; }
.navbar .step-arrow.next { background: var(--brand-soft); border-color: transparent; }
.navbar .mid { flex: 1; text-align: center; font-size: 16px; display: flex; gap: 8px; justify-content: center; align-items: center; }
.nav-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 2px; }
.nav-top h3 { margin: 0; font-size: 18px; }
.seg { display: inline-flex; background: #f0f0f2; border-radius: 16px; padding: 3px; gap: 2px; }
.seg button { padding: 5px 10px; border-radius: 13px; font-size: 13px; font-weight: 700; color: #555b6a; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.prompt { background: var(--brand-soft); border-radius: 12px; padding: 12px; display: flex; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 15px; }
.prompt .btn { height: 38px; font-size: 14px; margin-left: auto; }

.pick-hint { position: absolute; left: 50%; top: calc(76px + var(--safe-t)); transform: translateX(-50%); z-index: 30; background: var(--navy); color: #fff; padding: 10px 10px 10px 16px; border-radius: 22px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow-lg); font-weight: 700; white-space: nowrap; }
.pick-hint button { color: #fff; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.15); }
.toast { position: absolute; left: 50%; top: calc(80px + var(--safe-t)); transform: translate(-50%, -20px); z-index: 60; background: rgba(22, 32, 61, .95); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 15px; opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100% - 40px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(10, 14, 28, .55); display: grid; place-items: center; padding: 16px; }
.modal-card { background: #fff; border-radius: 18px; width: min(420px, 100%); padding: 14px 16px 16px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; font-size: 18px; margin-bottom: 10px; }
.qr-view { position: relative; aspect-ratio: 1; background: #111; border-radius: 12px; overflow: hidden; }
.qr-view video { width: 100%; height: 100%; object-fit: cover; }
.qr-frame { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.9); border-radius: 16px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.powered { position: absolute; right: 70px; bottom: calc(var(--sheet-h, 150px) + 18px); z-index: 14; font-size: 11px; color: #8c909b; text-decoration: none; }

/* desktop: sheet becomes a side panel like Situm's web viewer */
@media (min-width: 900px) {
  .topbar { right: auto; width: 400px; left: 16px; top: 16px; }
  .sheet { left: 16px; right: auto; width: 400px; top: 80px; bottom: auto; height: auto !important; max-height: calc(100% - 96px); border-radius: var(--radius); }
  .sheet .grab { display: none; }
  .sheet-body { padding-top: 14px; }
  .floor-btn, .a11y-fab, .recenter, .powered { bottom: 20px; }
  .floor-btn { left: 432px; }
  .floor-menu { left: 432px; bottom: 78px; }
  .ctrls { top: 16px; right: 16px; }
  body.nav .ctrls { top: 16px; }
  .recenter { left: calc(50% + 208px); }
  .toast, .pick-hint { left: calc(50% + 208px); top: 20px; }
  .nav-banner { width: 400px; }
}

@media (max-width: 700px) { .tour-chip { font-size: 11px; padding: 6px 11px; } }
body.cinema .floor-btn, body.cinema .recenter { opacity: 0; pointer-events: none; }
