/* Ortak stiller: görüntüleyici çekirdeği, işaretçiler, kat planı */
:root {
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --tag: #f97316;
  --glass: rgba(17, 20, 28, 0.72);
  --glass-strong: rgba(17, 20, 28, 0.9);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f3f5f8;
  --muted: #a3acb9;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #0c0e12; color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
svg { fill: currentColor; }

/* ---------- Görüntüleyici ---------- */
.pv-root { position: relative; overflow: hidden; outline: none; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; background: #0c0e12; }
.pv-root.pv-grabbing { cursor: grabbing; }
.pv-canvas { position: absolute; inset: 0; display: block; }
.pv-overlay { position: absolute; inset: 0; pointer-events: none; transition: opacity .25s; }
.pv-overlay.pv-hidden { opacity: 0; }
.pv-hotspot { position: absolute; left: 0; top: 0; pointer-events: auto; will-change: transform; }
.pv-error { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); }

/* Geçiş oku */
.hs-link { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.hs-link .hs-btn {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.22); border: 2px solid rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .35); transition: transform .2s, background .2s;
}
.hs-link .hs-btn svg { width: 26px; height: 26px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.hs-link:hover .hs-btn { transform: scale(1.12); background: var(--accent); border-color: #fff; }
.hs-link.kind-up .hs-btn, .hs-link.kind-down .hs-btn, .hs-link.kind-elevator .hs-btn { background: rgba(245, 158, 11, .55); }
.hs-link.kind-door .hs-btn { background: rgba(20, 184, 166, .6); }
.hs-link .hs-label {
  white-space: nowrap; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--glass-strong); opacity: 0; transform: translateY(-4px); transition: .2s; pointer-events: none;
}
.hs-link:hover .hs-label, .hs-link.next .hs-label, .hs-link.always-label .hs-label { opacity: 1; transform: none; }
.hs-link.next .hs-btn { background: var(--accent); animation: hsPulse 1s ease-in-out infinite; }
@keyframes hsPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(59,130,246,.7); } 50% { box-shadow: 0 0 0 16px rgba(59,130,246,0); } }

/* Etiket */
/* .hs-tag sıfır boyutlu ve uç noktada; kart --ox / --oy kadar kaydırılır, çizgi uçtan karta uzanır */
.hs-tag { position: absolute; left: 0; top: 0; width: 0; height: 0; cursor: pointer; }
.hs-tag .hs-card {
  position: absolute; left: var(--ox, 0px); bottom: var(--oy, 28px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px;
  background: var(--glass-strong); border: 1px solid var(--line); white-space: nowrap;
  font-size: 14px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.35); transition: transform .2s;
}
.hs-tag .hs-ico { width: 28px; height: 28px; border-radius: 50%; background: var(--tag); display: grid; place-items: center; flex: none; }
.hs-tag .hs-ico svg { width: 17px; height: 17px; color: #fff; }
.hs-tag .hs-stem { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.hs-tag .hs-stem line { stroke: rgba(255,255,255,.85); stroke-width: 2; stroke-linecap: round; filter: drop-shadow(0 0 2px rgba(0,0,0,.6)); }
.hs-tag .hs-dot { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(249,115,22,.55); }
.hs-tag .hs-dot::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; } /* tutma alanı */
.hs-tag:hover .hs-card { transform: translateX(-50%) translateY(-2px) scale(1.04); }
.hs-tag.target .hs-card { background: var(--tag); border-color: #fff; animation: tagPulse 1.2s ease-in-out 4; }
.hs-tag.target .hs-ico { background: #fff; } .hs-tag.target .hs-ico svg { color: var(--tag); }
@keyframes tagPulse { 0%,100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.12); } }

/* Görüş alanı dışındaki etiket: ekran kenarında yön oku + ad */
.pv-edge {
  position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; will-change: transform;
  display: flex; flex-direction: row-reverse; align-items: center; gap: 6px; max-width: 180px;
  padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.35); transition: opacity .2s;
}
.pv-edge.left { flex-direction: row; padding: 4px 10px 4px 4px; }
.pv-edge-label { overflow: hidden; text-overflow: ellipsis; }
.pv-edge-arrow { width: 22px; height: 22px; border-radius: 50%; background: var(--tag); display: grid; place-items: center; flex: none; }
.pv-edge-arrow svg { width: 14px; height: 14px; fill: #fff; transform: rotate(var(--ang, 0deg)); }
.pv-edge:hover { background: var(--tag); }
.pv-edge:hover .pv-edge-arrow { background: #fff; } .pv-edge:hover .pv-edge-arrow svg { fill: var(--tag); }
.pv-overlay.pv-hidden .pv-edge { pointer-events: none; }

/* ---------- Kat planı ---------- */
.plan-svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.plan-svg.panning { cursor: grabbing; }
.plan-bg { fill: #161a22; }
.plan-img { opacity: .92; }
.plan-frame { fill: none; stroke: rgba(255,255,255,.18); stroke-width: 2; vector-effect: non-scaling-stroke; }
.plan-grid line { stroke: rgba(255,255,255,.05); stroke-width: 1; vector-effect: non-scaling-stroke; }
.plan-grid line.major { stroke: rgba(255,255,255,.1); }
.plan-edge { stroke: rgba(160, 190, 255, .55); stroke-linecap: round; }
/* Yerleşke: bina sınırları */
.plan-bld { fill: rgba(20, 184, 166, .16); stroke: #2dd4bf; stroke-linejoin: round; cursor: pointer; }
.plan-bld.selected { fill: rgba(250, 204, 21, .18); stroke: #facc15; }
.plan-bld-cand { fill: rgba(249, 115, 22, .10); stroke: #fb923c; stroke-linejoin: round; cursor: pointer; }
.plan-bld-cand.selected { fill: rgba(250, 204, 21, .22); stroke: #facc15; }
.plan-bld-label { fill: #ecfeff; stroke: rgba(0, 0, 0, .75); paint-order: stroke; text-anchor: middle; dominant-baseline: middle; font-weight: 700; pointer-events: none; }
.plan-bld-label.cand { fill: #fed7aa; font-weight: 600; }
.plan-bld-draft { fill: rgba(250, 204, 21, .15); stroke: #facc15; stroke-linejoin: round; pointer-events: none; }
.plan-bld-vertex { fill: #facc15; stroke: #111; pointer-events: none; }
.plan-bld-vertex.first { fill: #fff; stroke: #facc15; }
.plan-handle.bld circle { fill: #facc15; stroke: #111; cursor: move; }
.plan-edge.one-way { stroke-dasharray: 6 6; }
.plan-edge.selected { stroke: var(--warn); }
.plan-edge-hit { stroke: transparent; cursor: pointer; }
.plan-route { fill: none; stroke: var(--accent-2); stroke-linecap: round; stroke-linejoin: round; animation: routeDash 1s linear infinite; }
@keyframes routeDash { to { stroke-dashoffset: -44; } }
.plan-node { cursor: pointer; }
.plan-node-dot { fill: #e8eefc; stroke: #2a3242; }
.plan-node-halo { fill: transparent; }
.plan-node:hover .plan-node-halo { fill: rgba(255,255,255,.15); }
.plan-node.on-path .plan-node-dot { fill: var(--accent-2); }
.plan-node.current .plan-node-dot { fill: var(--accent); stroke: #fff; }
.plan-node.selected .plan-node-halo { fill: rgba(245,158,11,.35); }
.plan-node.selected .plan-node-dot { stroke: var(--warn); }
.plan-node.link-from .plan-node-halo { fill: rgba(34,197,94,.45); }
.plan-node.hl .plan-node-halo { fill: rgba(249,115,22,.5); animation: hl 1s ease-in-out infinite; }
@keyframes hl { 50% { opacity: .3; } }
.plan-node.start .plan-node-dot { stroke: var(--ok); }
.plan-north { fill: var(--ok); opacity: .9; }
.plan-cross { fill: var(--warn); font-weight: 700; }
.plan-label { fill: #fff; text-anchor: middle; font-weight: 600; paint-order: stroke; stroke: rgba(10,12,16,.85); stroke-linejoin: round; pointer-events: none; }
.plan-cone { fill: rgba(59,130,246,.35); stroke: rgba(96,165,250,.8); stroke-width: 1; vector-effect: non-scaling-stroke; }
.plan-me-dot { fill: var(--accent); stroke: #fff; }

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.plan-scale rect { fill: rgba(255,255,255,.75); }
.plan-scale text { fill: rgba(255,255,255,.8); font-weight: 600; }
.plan-walk { fill: none; stroke: #facc15; stroke-linecap: round; stroke-linejoin: round; opacity: .95; }
.plan-edge { fill: none; stroke-linejoin: round; }
.plan-edge-hit { fill: none; }
.plan-edge.routed { stroke: rgba(250, 204, 21, .75); }
.plan-handle { cursor: move; }
.plan-handle circle { fill: #facc15; stroke: #111; }
.plan-handle.add { cursor: copy; opacity: .75; }
.plan-handle.add circle { fill: rgba(17,20,28,.85); stroke: #facc15; }
.plan-handle.add path { stroke: #facc15; }
