:root {
  --purple: #6a3cff; --purple-2: #9a6bff; --purple-3: #c9b6ff; --uw: #4b2e83; --gold: #ffc94d; --gold-2: #ffe08a;
  --ink: #f6f3ff; --ink-2: #d6cff0; --muted: #a49cc6; --line: rgba(255, 255, 255, 0.1); --line-2: rgba(255, 255, 255, 0.18);
  --panel: rgba(21, 15, 42, 0.8); --panel-solid: #1a1335; --field: rgba(255, 255, 255, 0.06); --hover: rgba(255, 255, 255, 0.08);
  --start: #22c58b; --end: #f25a52; --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 24px 60px rgba(4, 2, 16, .55), 0 2px 0 rgba(255, 255, 255, .04) inset;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; font: 15px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; }
body { background: radial-gradient(1200px 820px at 60% 35%, #34266e 0%, #1b1340 48%, #0b0718 100%); }
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 58%, rgba(4, 2, 12, 0.5) 100%); z-index: 1; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, li:focus-visible, .switch input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg { display: block; flex: none; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }

/* ---------- loader ---------- */
#loader { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 18px; background: radial-gradient(900px 600px at 50% 40%, #2c2060, #0d0920); transition: opacity .6s var(--ease), visibility .6s; }
body.ready #loader { opacity: 0; visibility: hidden; }
.ld-mark { width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, #7a4dff, var(--uw)); color: var(--gold); display: grid; place-items: center; box-shadow: 0 10px 40px rgba(106, 60, 255, .6); animation: bob 1.6s var(--ease) infinite alternate; }
.ld-bar { width: 160px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.ld-bar i { display: block; width: 40%; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--purple-2), var(--gold)); animation: slide 1.1s ease-in-out infinite; }
#loader p { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: .02em; }
@keyframes bob { to { transform: translateY(-6px); } }
@keyframes slide { from { transform: translateX(-110%); } to { transform: translateX(260%); } }

/* ---------- labels in the scene ---------- */
.lbl { position: absolute; left: 0; top: 0; text-align: center; white-space: nowrap; will-change: transform; line-height: 1.15; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 8px #fff; }
.lbl b { display: block; font-size: 12px; font-weight: 800; color: #221846; letter-spacing: .01em; }
.lbl span { display: block; font-size: 10px; font-weight: 600; color: #4a3f73; max-width: 130px; white-space: normal; }
.lbl.conn b { color: #6b5bb0; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.lbl.sel b { color: #fff; background: var(--purple); border-radius: 8px; padding: 3px 8px; text-shadow: none; display: inline-block; font-size: 13px; box-shadow: 0 6px 18px rgba(60, 20, 200, .5); }
.lbl.pin { font-weight: 800; font-size: 11.5px; color: #fff; padding: 5px 11px; border-radius: 999px; text-shadow: none; box-shadow: 0 6px 18px rgba(0,0,0,.4); letter-spacing: .01em; }
.lbl.pin::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: none; }
.lbl.pin.start { background: var(--start); } .lbl.pin.end { background: var(--end); }
.lbl.pin.door { background: var(--gold); color: #2b1d00; }
.lbl.pin.start::after { border-top-color: var(--start); } .lbl.pin.end::after { border-top-color: var(--end); } .lbl.pin.door::after { border-top-color: var(--gold); }
.lbl.floor { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: rgba(106, 60, 255, .88); border: 1px solid rgba(255,255,255,.25); padding: 4px 11px; border-radius: 999px; text-shadow: none; box-shadow: 0 6px 18px rgba(40, 10, 140, .5); }
.lbl.bldg { text-shadow: 0 1px 3px rgba(8, 4, 24, .95), 0 0 8px rgba(8, 4, 24, .9); }
.lbl.bldg b { color: #fff; font-size: 12px; letter-spacing: .03em; }
.lbl.bldg span { color: #cfc5f7; font-size: 10px; max-width: 150px; font-weight: 500; }
.lbl.bldg.hot b { display: inline-block; background: var(--gold); color: #2b1d00; border-radius: 7px; padding: 2px 7px; text-shadow: none; box-shadow: 0 4px 14px rgba(255, 190, 60, .45); }
.lbl.bldg.hot span { color: var(--gold-2); }
.lbl.bldg.sel b { background: #fff; color: var(--uw); }

/* ---------- panel ---------- */
#panel { position: fixed; top: 16px; left: 16px; width: 384px; max-height: calc(100% - 32px); display: flex; flex-direction: column; background: var(--panel); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 18px; gap: 14px; z-index: 5; animation: rise .6s var(--ease) both .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
#grab { display: none; }
header { display: flex; gap: 12px; align-items: center; }
.mark { width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(135deg, #7a4dff, var(--uw)); color: var(--gold); display: grid; place-items: center; flex: none; box-shadow: 0 8px 22px rgba(106, 60, 255, .45), inset 0 1px 0 rgba(255,255,255,.2); }
h1 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
h1 span { background: linear-gradient(90deg, var(--gold), #ffb36b); -webkit-background-clip: text; background-clip: text; color: transparent; }
header p { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); }

.route-box { position: relative; display: grid; grid-template-columns: 18px 1fr 40px; gap: 8px; align-items: center; padding: 8px; border-radius: 18px; background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.rails { display: flex; flex-direction: column; align-items: center; height: 100%; padding: 19px 0; }
.rails .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.rails .dot.start { border: 3px solid var(--start); box-shadow: 0 0 12px rgba(34,197,139,.5); }
.rails .dot.end { background: var(--end); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 0 12px rgba(242,90,82,.5); }
.rails .rail { flex: 1; width: 2px; margin: 4px 0; background-image: linear-gradient(var(--muted) 50%, transparent 0); background-size: 2px 6px; opacity: .6; }
.inputs { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field { position: relative; }
.field input { width: 100%; height: 46px; border-radius: 12px; border: 1.5px solid transparent; padding: 0 12px; font: 500 15px Inter, sans-serif; color: var(--ink); background: var(--field); outline: none; transition: border-color .2s, box-shadow .2s, background .2s; text-overflow: ellipsis; }
.field[data-role=from] input { padding-right: 46px; }
.field input::placeholder { color: #8f87b3; font-weight: 400; }
.field input:hover { background: rgba(255,255,255,.08); }
.field input:focus { border-color: var(--purple-2); background: rgba(255,255,255,.1); box-shadow: 0 0 0 4px rgba(122, 77, 255, .22); }
.field.filled input { font-weight: 600; }
#locate { position: absolute; right: 5px; top: 5px; width: 36px; height: 36px; border: none; border-radius: 10px; background: rgba(58, 160, 255, .14); color: #82c8ff; display: grid; place-items: center; transition: background .2s, transform .2s; }
#locate:hover { background: rgba(58, 160, 255, .3); transform: scale(1.05); }
#swap { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); color: var(--gold); display: grid; place-items: center; transition: background .2s, transform .35s var(--ease); }
#swap:hover { background: var(--hover); transform: rotate(180deg); }
.suggest { display: none; position: absolute; z-index: 20; left: 0; right: -48px; top: 52px; margin: 0; padding: 6px; list-style: none; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .6); max-height: 320px; overflow: auto; }
.suggest.open { display: block; animation: pop .16s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.suggest li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; cursor: pointer; min-height: 44px; }
.suggest li.on, .suggest li:hover { background: rgba(122, 77, 255, .26); }
.suggest .si { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.07); display: grid; place-items: center; color: var(--purple-3); flex: none; }
.suggest b { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.suggest .nm { color: var(--muted); font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest i { font-style: normal; font-size: 11px; font-weight: 700; color: #241a00; background: var(--gold); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; }
.switch { display: inline-flex; gap: 10px; align-items: center; font-size: 13.5px; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: rgba(255,255,255,.14); position: relative; transition: background .2s; flex: none; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform .25s var(--ease); }
.switch input:checked + .track { background: var(--purple); }
.switch input:checked + .track .knob { transform: translateX(16px); }
#reset { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font-size: 13px; font-weight: 600; color: var(--ink-2); transition: background .2s, color .2s, border-color .2s; }
#reset:hover { background: rgba(242, 90, 82, .14); border-color: rgba(242, 90, 82, .5); color: #ffb3ae; }
#reset[hidden] { display: none; }

#result { overflow: auto; min-height: 0; margin: 0 -8px; padding: 0 8px 2px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.foot { display: flex; flex-direction: column; gap: 8px; align-items: stretch; margin-top: -2px; }
#fb-open { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; border-radius: 12px; border: 1px dashed rgba(255, 201, 77, .45); background: rgba(255, 201, 77, .07); color: var(--gold-2); font-weight: 600; font-size: 13.5px; transition: background .2s, border-color .2s, transform .2s var(--ease); }
#fb-open[hidden] { display: none; }
#fb-open:hover { background: rgba(255, 201, 77, .16); border-color: var(--gold); transform: translateY(-1px); }
.note { font-size: 11px; color: #7d76a0; text-align: center; }
.hint { margin: 0; font-size: 13.5px; color: var(--ink-2); background: rgba(255,255,255,.05); border-radius: 14px; padding: 13px 14px; }
.hint b { color: var(--gold-2); }
.hint.err { background: rgba(242, 90, 82, .14); color: #ffb9b4; }

.idle { display: flex; flex-direction: column; gap: 12px; animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.idle .lead { margin: 0; font-size: 14px; color: var(--ink-2); }
.idle .lead b { color: var(--gold-2); }
.chips-title { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); font-size: 13px; font-weight: 600; color: var(--ink); transition: background .2s, border-color .2s, transform .2s var(--ease); }
.chip svg { color: var(--gold); }
.chip:hover { background: rgba(122, 77, 255, .22); border-color: rgba(154, 107, 255, .6); transform: translateY(-1px); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 11px; height: 11px; border-radius: 3px; background: var(--c); }

.skeleton { display: flex; flex-direction: column; gap: 8px; }
.skeleton i { height: 54px; border-radius: 14px; background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.11), rgba(255,255,255,.05)); background-size: 200% 100%; animation: shimmer 1s linear infinite; }
.skeleton i:first-child { height: 110px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- route summary ---------- */
.summary { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 20px; background: linear-gradient(135deg, #6a3cff 0%, #8f4dff 55%, #e0679a 120%); color: #fff; box-shadow: 0 14px 34px rgba(106, 60, 255, .42), inset 0 1px 0 rgba(255,255,255,.25); overflow: hidden; animation: fade .35s var(--ease); }
.summary::before { content: ""; position: absolute; right: -40px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 70%); pointer-events: none; }
.sum-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sum-top strong { display: block; font-size: 34px; line-height: 1; font-weight: 800; letter-spacing: -.03em; }
.sum-top strong small { font-size: 16px; font-weight: 700; letter-spacing: 0; opacity: .9; }
.sum-top span { display: block; font-size: 13px; opacity: .92; margin-top: 4px; }
.ghost-btn { width: 36px; height: 36px; border-radius: 11px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; transition: background .2s; flex: none; }
.ghost-btn:hover { background: rgba(255,255,255,.24); }
.sum-route { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; flex-wrap: wrap; }
.sum-route .d { width: 8px; height: 8px; border-radius: 50%; } .sum-route .d.s { background: #8ff0c6; } .sum-route .d.e { background: #ffb0aa; }
.sum-route .arrow { opacity: .7; margin: 0 2px; }
.sum-via { font-size: 12px; opacity: .85; margin-top: -4px; }
.player { display: flex; gap: 6px; margin-top: 4px; }
.player button { height: 40px; border-radius: 12px; border: none; background: rgba(0,0,0,.2); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 44px; transition: background .2s, transform .15s; }
.player button:hover { background: rgba(0,0,0,.32); }
.player button:active { transform: scale(.97); }
.player .primary { flex: 1; background: #fff; color: var(--uw); font-weight: 700; font-size: 14px; }
.player .primary:hover { background: #f1ecff; }

ol.steps { list-style: none; margin: 12px 0 0; padding: 0; position: relative; }
ol.steps li { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 14px; cursor: pointer; transition: background .15s; position: relative; outline: none; }
ol.steps li:hover { background: var(--hover); }
ol.steps li.active { background: rgba(122, 77, 255, .22); box-shadow: inset 3px 0 0 var(--purple-2); }
.ico { width: 38px; height: 38px; border-radius: 12px; background: rgba(122, 77, 255, .2); color: var(--purple-3); display: grid; place-items: center; }
li.transfer .ico { background: var(--gold); color: #3b2a00; }
li.endpoint.s .ico { background: var(--start); color: #fff; } li.endpoint.e .ico { background: var(--end); color: #fff; }
.steps .t { font-size: 14px; font-weight: 600; } .steps .t small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; margin-top: 1px; }
.steps .d { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
ol.steps li.floorhead { cursor: default; display: flex; align-items: center; gap: 7px; padding: 14px 8px 6px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); position: sticky; top: 0; z-index: 1; background: linear-gradient(#1c1538 75%, rgba(28, 21, 56, 0)); border-radius: 0; }
ol.steps li.floorhead:hover { background: linear-gradient(#1c1538 75%, rgba(28, 21, 56, 0)); }

/* ---------- side buttons ---------- */
#floors { position: fixed; right: 16px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: stretch; gap: 4px; background: var(--panel); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); border: 1px solid var(--line); border-radius: 20px; padding: 7px; box-shadow: var(--shadow); z-index: 5; }
#floors button { position: relative; width: 52px; height: 44px; border: none; border-radius: 13px; background: transparent; font-weight: 700; font-size: 14px; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: background .15s, transform .15s; }
#floors button.tall { height: 52px; }
#floors button small { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
#floors button:hover { background: var(--hover); }
#floors button:active { transform: scale(.95); }
#floors button.on { background: linear-gradient(135deg, #6a3cff, #9a6bff); color: #fff; box-shadow: 0 6px 18px rgba(106, 60, 255, .5); }
#floors button.on small { color: #fff; }
#floors button.bld { font-size: 12px; letter-spacing: .02em; color: var(--gold-2); }
#floors button.inroute::after { content: ""; position: absolute; right: 6px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
#floors .cap { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: center; padding: 8px 0 2px; border-top: 1px solid var(--line); margin-top: 3px; }

/* ---------- building header ---------- */
#bhead { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; background: var(--panel); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); z-index: 6; animation: drop .45s var(--ease); }
@media (min-width: 721px) { #bhead { left: calc(50% + 200px); } }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -10px); } }
#bhead[hidden] { display: none; }
#bback { width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255,255,255,.1); display: grid; place-items: center; transition: background .2s, transform .2s; }
#bback:hover { background: rgba(255,255,255,.2); transform: translateX(-2px); }
.btxt { display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; min-width: 0; }
.btxt b { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.btxt span { font-size: 12px; color: var(--gold-2); font-weight: 600; }

/* ---------- selection card, compass, toast ---------- */
#card { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; background: var(--panel); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); border: 1px solid var(--line); border-radius: 20px; padding: 10px 10px 10px 18px; box-shadow: var(--shadow); max-width: calc(100% - 32px); z-index: 6; animation: up .3s var(--ease); }
@media (min-width: 721px) { #card { left: calc(50% + 200px); } }
@keyframes up { from { opacity: 0; transform: translate(-50%, 10px); } }
#card[hidden] { display: none; }
.card-text { display: flex; flex-direction: column; min-width: 0; }
.card-text b { font-size: 16px; font-weight: 800; }
.card-text span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.card-btns { display: flex; gap: 6px; }
.card-btns button { height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--field); font-weight: 600; font-size: 13.5px; color: var(--ink); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: background .15s; }
.card-btns button:hover { background: var(--hover); }
.card-btns button.primary { background: linear-gradient(135deg, #6a3cff, #9a6bff); border-color: transparent; color: #fff; }
.card-btns button[hidden] { display: none; }
#card-in { color: var(--gold-2); }
#card-x { width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent; color: var(--muted); display: grid; place-items: center; }
#card-x:hover { background: var(--hover); color: var(--ink); }
#compass { position: fixed; right: 20px; bottom: 20px; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); box-shadow: var(--shadow); z-index: 5; padding: 0; color: var(--ink); transition: transform .2s; }
#compass:hover { transform: scale(1.06); }
#compass span { position: absolute; inset: 0; display: block; }
#compass span::before { content: ""; position: absolute; left: 50%; top: 5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 9px solid var(--end); border-top: none; }
#compass i { position: absolute; left: 0; right: 0; top: 18px; text-align: center; font-size: 12px; font-weight: 800; font-style: normal; }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: #fff; color: var(--uw); font-weight: 700; font-size: 13.5px; padding: 10px 16px; border-radius: 999px; box-shadow: 0 12px 30px rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s var(--ease); z-index: 30; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- suggest a feature ---------- */
#fb { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(8, 5, 20, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .2s var(--ease); }
#fb[hidden] { display: none; }
#fb-form, #fb-done { position: relative; width: min(460px, 100%); max-height: calc(100% - 8px); overflow: auto; display: flex; flex-direction: column; gap: 10px; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 24px; padding: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: pop .25s var(--ease); }
#fb-form[hidden], #fb-done[hidden] { display: none; }
#fb-done { align-items: center; text-align: center; }
#fb-x { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(255,255,255,.07); color: var(--ink-2); display: grid; place-items: center; }
#fb-x:hover { background: rgba(255,255,255,.14); }
.fb-badge { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(135deg, var(--gold), #ff9d5c); color: #2b1d00; box-shadow: 0 10px 26px rgba(255, 180, 60, .35); }
.fb-badge.ok { background: linear-gradient(135deg, var(--start), #1aa3c9); color: #fff; }
#fb h2 { margin: 4px 0 0; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.fb-lead { margin: 0; color: var(--ink-2); font-size: 14px; }
.fb-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted); margin-top: 6px; }
.fb-label span { font-weight: 500; letter-spacing: 0; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.fb-chips .chip[aria-pressed=true] { background: var(--purple); border-color: var(--purple-2); color: #fff; }
#fb textarea, #fb input[type=email] { width: 100%; border-radius: 13px; border: 1.5px solid var(--line-2); background: var(--field); color: var(--ink); font: 500 15px/1.45 Inter, sans-serif; padding: 11px 13px; outline: none; resize: vertical; transition: border-color .2s, box-shadow .2s; }
#fb textarea:focus, #fb input[type=email]:focus { border-color: var(--purple-2); box-shadow: 0 0 0 4px rgba(122, 77, 255, .22); }
#fb ::placeholder { color: #8f87b3; font-weight: 400; }
#fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#fb-err { margin: 0; min-height: 18px; font-size: 13px; color: #ffb3ae; }
#fb .primary { height: 46px; border: none; border-radius: 13px; background: linear-gradient(135deg, #6a3cff, #9a6bff); color: #fff; font-weight: 700; font-size: 15px; padding: 0 22px; transition: transform .15s, filter .2s; }
#fb .primary:hover { filter: brightness(1.1); } #fb .primary:active { transform: scale(.98); } #fb .primary:disabled { opacity: .6; cursor: default; }

/* ---------- nearby, next class, tour, getting here ---------- */
.sw-text small { display: block; font-size: 11px; color: var(--muted); }
.chip.near { border-color: rgba(154, 107, 255, .45); background: rgba(122, 77, 255, .12); }
.next { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(255, 201, 77, .18), rgba(255, 157, 92, .1)); border: 1px solid rgba(255, 201, 77, .35); }
.next div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.next small { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-2); }
.next b { font-size: 15px; } .next span { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next .go, .mini { height: 38px; padding: 0 16px; border-radius: 11px; border: none; background: var(--gold); color: #2b1d00; font-weight: 800; font-size: 13.5px; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.duo button { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); font-weight: 600; font-size: 13.5px; transition: background .2s, transform .2s var(--ease); }
.duo button:hover { background: rgba(122, 77, 255, .2); transform: translateY(-1px); } .duo svg { color: var(--gold); }
#getting { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; } #getting:empty { display: none; }
#getting button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: 9px 11px; border-radius: 13px; border: 1px solid var(--line); background: rgba(255,255,255,.04); min-width: 0; transition: background .2s; }
#getting button:hover { background: rgba(122, 77, 255, .18); }
#getting small { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
#getting b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; } #getting span { font-size: 11.5px; color: var(--muted); }
.tour { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 20px; background: linear-gradient(135deg, #2a1f63, #3a2a86); border: 1px solid var(--line-2); animation: fade .3s var(--ease); }
.tour small { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.tour h3 { margin: 0; font-size: 20px; letter-spacing: -.02em; } .tour p { margin: 0 0 4px; font-size: 14px; color: var(--ink-2); }
.tour .player button { background: rgba(255,255,255,.1); } .tour .player .primary { background: #fff; } .tour .player button:disabled { opacity: .35; cursor: default; }
.linkish { align-self: center; background: none; border: none; color: var(--muted); font-size: 13px; text-decoration: underline; padding: 6px; }
/* shared pop-up sheet */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(8, 5, 20, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .2s var(--ease); }
.modal[hidden] { display: none; }
.sheet { position: relative; width: min(480px, 100%); max-height: calc(100% - 8px); overflow: auto; display: flex; flex-direction: column; gap: 10px; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 24px; padding: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: pop .25s var(--ease); }
.sheet h2 { margin: 4px 0 0; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.sheet .x { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(255,255,255,.07); color: var(--ink-2); display: grid; place-items: center; }
.sheet form { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.sheet .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .sheet .two > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sheet input { width: 100%; height: 44px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--field); color: var(--ink); font: 500 15px Inter, sans-serif; padding: 0 12px; outline: none; color-scheme: dark; }
.sheet input:focus { border-color: var(--purple-2); box-shadow: 0 0 0 4px rgba(122, 77, 255, .22); }
.sheet .primary { height: 46px; border: none; border-radius: 13px; background: linear-gradient(135deg, #6a3cff, #9a6bff); color: #fff; font-weight: 700; font-size: 15px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days button { height: 38px; min-width: 50px; padding: 0 10px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); font-weight: 600; font-size: 13px; }
.days button[aria-pressed=true] { background: var(--purple); border-color: var(--purple-2); color: #fff; }
#sc-list, #sc-warn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#sc-list li { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 12px; border-radius: 13px; background: rgba(255,255,255,.05); }
#sc-list li div { display: flex; flex-direction: column; flex: 1; min-width: 0; } #sc-list span { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } #sc-list small { font-size: 11.5px; color: var(--muted); }
#sc-list li.empty { color: var(--muted); font-size: 13.5px; justify-content: center; }
.mini.ghost { width: 34px; padding: 0; background: rgba(255,255,255,.08); color: var(--ink-2); display: grid; place-items: center; }
#sc-warn li { font-size: 13px; padding: 9px 12px; border-radius: 12px; background: rgba(34, 197, 139, .12); color: #a8f0d2; } #sc-warn li.tight { background: rgba(242, 90, 82, .15); color: #ffb9b4; }
#sc-err { margin: 0; min-height: 18px; font-size: 13px; color: #ffb3ae; }
#sc-paste { border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 0 14px; }
#sc-paste summary { cursor: pointer; padding: 13px 0; font-weight: 700; font-size: 14px; color: var(--gold-2); }
#sc-paste .paste-body { display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; }
#sc-paste textarea { width: 100%; border-radius: 13px; border: 1.5px solid var(--line-2); background: var(--field); color: var(--ink); font: 500 14px/1.45 Inter, sans-serif; padding: 11px 13px; outline: none; resize: vertical; }
#sc-paste textarea:focus { border-color: var(--purple-2); box-shadow: 0 0 0 4px rgba(122, 77, 255, .22); }
#sc-imp { margin: 0; font-size: 13px; color: #a8f0d2; } #sc-imp.err { color: #ffb3ae; } #sc-imp:empty { display: none; }
.suggest li.tip .nm { white-space: normal; overflow: visible; color: var(--ink-2); } .suggest li.tip .nm b { color: var(--gold-2); }
.report { display: block; margin: 14px auto 2px; min-height: 44px; padding: 0 10px; background: none; border: none; color: var(--muted); font: 600 13px Inter, sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.report:hover { color: #fff; } .report[hidden] { display: none; }

/* ---------- phone ---------- */
@media (max-width: 720px) {
  #panel { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: 46%; border-radius: 24px 24px 0 0; padding: 6px 14px calc(12px + env(safe-area-inset-bottom)); gap: 10px; animation: none; }
  #panel.collapsed #result, #panel.collapsed .row, #panel.collapsed .note { display: none; }
  #grab { display: block; align-self: center; width: 44px; height: 5px; border-radius: 3px; border: none; background: rgba(255,255,255,.3); padding: 0; margin: 4px 0 2px; position: relative; }
  #grab::before { content: ""; position: absolute; left: 50%; width: 120px; height: 28px; transform: translate(-50%, -12px); }
  header, .note { display: none; }
  .foot { margin-top: 0; }
  #floors { top: 14px; right: 10px; transform: none; padding: 5px; border-radius: 16px; max-height: calc(44% - 28px); overflow: auto; }
  #floors button { width: 44px; height: 38px; } #floors button.tall { height: 46px; }
  #bhead { top: 14px; left: 10px; transform: none; max-width: calc(100% - 80px); animation: none; }
  .btxt b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
  #card { bottom: auto; top: 70px; left: 10px; right: 66px; transform: none; flex-wrap: wrap; padding: 10px 10px 10px 14px; animation: none; }
  .card-btns { width: 100%; } .card-btns button { flex: 1; justify-content: center; padding: 0 8px; }
  #card-x { position: absolute; right: 6px; top: 6px; }
  #compass { right: auto; left: 10px; bottom: auto; top: 14px; width: 42px; height: 42px; }
  #compass i { top: 15px; }
  body[data-view=inside] #compass, body:has(#card:not([hidden])) #compass { display: none; }
  #toast { bottom: 60%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
