﻿:root {
  --ink: #101820;
  --muted: #6b7785;
  --line: rgba(16, 24, 32, .10);
  --paper: #f4f2ee;
  --card: #ffffff;
  --accent: #13707c;
  --accent-2: #c2703a;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16,24,32,.06), 0 12px 40px -12px rgba(16,24,32,.22);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.shell {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ---------- stage ---------- */

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.map {
  position: relative;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #eef1f5 0%, #e9ecef 100%);
  isolation: isolate;
  touch-action: pan-y;
}

.map.style-campus {
  background: linear-gradient(180deg, #cfe0ee 0%, #e6ecef 42%, #f3ece2 100%);
}

.map canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  cursor: grab;
  touch-action: none;
}
.map canvas:active { cursor: grabbing; }

/* ---------- labels ---------- */

.labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 4;
}

.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px 4px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  border: 1px solid rgba(16,24,32,.10);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 2px 10px -2px rgba(16,24,32,.28);
  transition: opacity .2s, transform .12s, background .15s, color .15s;
  will-change: transform, opacity;
}
.pin::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}
.pin:hover { transform: translate(-50%, -50%) scale(1.05); }
.pin.sel {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.pin.sel::before { background: #fff; }
.pin.hide { opacity: 0; pointer-events: none; }
.pin.dim { opacity: .45; }

/* ---------- points of interest ---------- */

.pois {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 3;
}

.poi {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border: 0;
  padding: 0;
  background: none;
  pointer-events: auto;
  cursor: pointer;
  will-change: transform;
}
.poi::after {
  content: "";
  position: absolute;
  left: -12px;
  top: -12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
}
.poi .dot {
  position: absolute;
  left: -9px;
  top: -9px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--pc, #556070);
  color: #fff;
  box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(16,24,32,.45);
  transition: box-shadow .15s, transform .15s;
}
.poi .dot svg { width: 11px; height: 11px; display: block; }
.poi span {
  display: none;
  position: absolute;
  left: 13px;
  top: -9px;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(16,24,32,.10);
  box-shadow: 0 2px 8px -3px rgba(16,24,32,.35);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  white-space: nowrap;
}
.poi.lbl span { display: block; }
.poi.left span { left: auto; right: 13px; }
.poi:hover { z-index: 5; }
.poi:hover .dot { transform: scale(1.25); }
.poi:hover span { display: block; z-index: 6; }
.poi.sel .dot {
  transform: scale(1.15);
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--pc, #556070);
}
.poi.sel span { display: block; background: var(--pc, #556070); color: #fff; border-color: transparent; }
.poi.hide { display: none; }

.c-cafe     { --pc: #8a5a2b; }
.c-food     { --pc: #d4552f; }
.c-shop     { --pc: #6b4ef0; }
.c-lounge   { --pc: #0d7f8c; }
.c-hotel    { --pc: #1f6feb; }
.c-parking  { --pc: #2f8f46; }
.c-atm      { --pc: #4b5a6b; }
.c-landmark { --pc: #c2185b; }
.c-charge   { --pc: #e0a300; }
.c-gate     { --pc: #12324f; }
.c-arrivals   { --pc: #16a34a; }
.c-departures { --pc: #1d4ed8; }
.c-security   { --pc: #7c3aed; }
.c-baggage    { --pc: #92612f; }
.c-lost       { --pc: #b23a48; }
.c-smoking    { --pc: #6b7280; }
.c-pickup     { --pc: #0f766e; }
.c-rental     { --pc: #c2410c; }
.c-taxi       { --pc: #d9a300; }
.c-bus        { --pc: #0e7490; }
.c-train      { --pc: #4338ca; }
.c-fuel       { --pc: #b45309; }

/* gate numbers: compact centred pills, no dot */
.poi.c-gate .dot { display: none; }
.poi.c-gate span {
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  padding: 1px 5px;
  max-width: none;
  border-radius: 5px;
  background: #fff;
  border: 1px solid rgba(16,24,32,.18);
  box-shadow: 0 1px 4px rgba(16,24,32,.20);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #12324f;
  font-variant-numeric: tabular-nums;
}
.poi.c-gate:hover span { z-index: 6; }
.poi.c-gate.sel span { background: #12324f; color: #fff; border-color: transparent; }

.poi-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
  pointer-events: auto;
  scrollbar-width: none;
  z-index: 4;
}
.poi-bar::-webkit-scrollbar { display: none; }
.poi-bar button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(16,24,32,.10);
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(8px);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #5c6672;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.poi-bar button i {
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--pc, #556070);
  color: #fff;
  flex: 0 0 auto;
}
.poi-bar button i svg { width: 9px; height: 9px; display: block; }
.poi-bar button.on i { background: rgba(255,255,255,.22); }
.poi-bar button b {
  font-weight: 600;
  opacity: .55;
  font-size: 10px;
}
.poi-bar button.on {
  background: var(--ink);
  color: #fff;
  border-color: transparent;
}
.poi-bar button.on i { background: #fff; }
.poi-bar button.on b { opacity: .7; }

/* ---------- layers / controls ---------- */

.layers {
  position: absolute;
  left: 12px;
  top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  z-index: 5;
  max-width: calc(100% - 120px);
}
.layers[hidden] { display: none; }
.layers button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px 0 8px;
  border: 1px solid rgba(16,24,32,.09);
  border-radius: 999px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(8px);
  font: inherit;
  font-size: 11.5px;
  font-weight: 550;
  color: #6b7785;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.layers button.on {
  color: var(--ink);
  border-color: rgba(16,24,32,.16);
}
.layers button:not(.on) { opacity: .55; }
.sw {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}
.sw-rw { background: #556070; }
.sw-tm { background: #13707c; }
.sw-pk { background: #9aa8b6; }
.sw-rd { background: #e0b23c; }

.hint {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  max-width: min(74%, 460px);
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(16,24,32,.74);
  color: #fff;
  backdrop-filter: blur(8px);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity .4s;
  z-index: 4;
  pointer-events: none;
}
.hint.gone { opacity: 0; }

.fs {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(16,24,32,.10);
  border-radius: 9px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  font-size: 15px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  z-index: 5;
}
.fs:hover { background: #fff; }

.readout {
  position: absolute;
  right: 12px;
  top: 54px;
  text-align: right;
  font: 10.5px/1.3 ui-monospace, Consolas, monospace;
  color: rgba(16,24,32,.42);
  pointer-events: none;
  z-index: 5;
  white-space: pre;
}
.readout[hidden] { display: none; }

/* ---------- loading ---------- */

.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: rgba(244,242,238,.92);
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .02em;
  z-index: 30;
  transition: opacity .45s;
}
.loading.done { opacity: 0; pointer-events: none; }
.spinner {
  width: 26px;
  height: 26px;
  border: 2px solid rgba(16,24,32,.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- info panel ---------- */

.panel {
  position: absolute;
  right: 26px;
  bottom: 80px;
  width: 268px;
  padding: 18px 18px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(16,24,32,.08);
  box-shadow: var(--shadow);
  z-index: 12;
  animation: rise .22s ease-out;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
}
.panel[hidden] { display: none; }
.panel-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  font-size: 19px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  border-radius: 7px;
}
.panel-close:hover { background: rgba(16,24,32,.06); }
.panel-kind {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.panel h2 {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -.01em;
  padding-right: 22px;
}
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
}
.facts div { min-width: 0; }
.facts dt {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 2px;
}
.facts dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.primary {
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.primary:hover { background: #24313d; }

.embed-box {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}
.embed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.copy {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 3px 8px;
  font: inherit;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .04em;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.copy:hover { background: var(--ink); color: #fff; border-color: transparent; }
.copy.done { background: #13707c; color: #fff; border-color: transparent; }
#embed-code {
  width: 100%;
  height: 62px;
  resize: none;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f8f9;
  color: #44505c;
  font: 9.5px/1.4 ui-monospace, Consolas, monospace;
  word-break: break-all;
  outline: none;
}
#embed-code:focus { border-color: var(--accent); background: #fff; }

/* ---------- footer ---------- */

.foot {
  position: absolute;
  left: 14px;
  bottom: 56px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 52%;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(6px);
  font-size: 9.5px;
  color: #7b8691;
  line-height: 1.35;
  pointer-events: none;
}
.foot span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.proto {
  margin-left: auto;
  white-space: nowrap;
  color: #a2abb5;
}

/* ---------- mobile ---------- */

@media (max-width: 780px) {
  .map { border-radius: 0; }
  .layers { left: 8px; top: 8px; max-width: calc(100% - 16px); gap: 5px; }
  .layers button { height: 28px; font-size: 10.5px; padding: 0 9px 0 7px; }
  .poi-bar { left: 10px; right: 10px; bottom: 10px; gap: 5px; }
  .poi-bar button { font-size: 10.5px; padding: 5px 9px; }
  .poi span { font-size: 10px; max-width: 130px; }
  .poi.c-gate span { font-size: 9px; padding: 1px 4px; }
  .poi::after { left: -14px; top: -14px; width: 30px; height: 30px; }
  .hint {
    top: 10px;
    max-width: calc(100% - 96px);
    font-size: 10.5px;
    padding: 6px 10px;
  }
  .foot {
    left: 10px;
    bottom: 52px;
    max-width: 64%;
    font-size: 8.5px;
    padding: 2px 7px;
  }
  .panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    border-radius: 16px 16px 0 0;
    padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
    z-index: 40;
    animation: sheet .26s cubic-bezier(.2,.8,.2,1);
  }
  @keyframes sheet { from { transform: translateY(100%); } }
  .panel h2 { font-size: 16px; }
  .readout { display: none; }
  .fs { width: 30px; height: 30px; top: 8px; right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
  .panel { animation: none; }
}

/* short viewports: landscape phones, small iframes */
@media (max-height: 560px) {
  .poi-bar { bottom: 8px; }
  .poi-bar button { font-size: 10px; padding: 4px 8px; }
  .layers { top: 6px; left: 6px; }
  .layers button { height: 26px; font-size: 10px; }
  .hint { display: none; }
  .foot { display: none; }
  .poi span { font-size: 10px; }
}
