/* 3D tower page: full-bleed WebGL stage, floating panel, HUD, name tags. Builds on tower.css components. */
.app { display: block; height: 100dvh; position: relative; }
.stage { position: absolute; inset: 0; background: #dbe7f3; touch-action: none; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.topbar { z-index: 4; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: rgba(15, 23, 42, .04); display: grid; place-items: center; color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: rgba(15, 23, 42, .08); }

/* floating summary panel */
.panel {
  position: absolute; z-index: 5; top: 76px; right: 16px; bottom: 16px; width: 380px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 20px 60px rgba(15, 23, 42, .18);
  transform: translateX(calc(100% + 24px)); opacity: 0; pointer-events: none;
  transition: transform .45s var(--ease), opacity .3s;
}
.panel.open { transform: none; opacity: 1; pointer-events: auto; }

/* HUD */
.hud-floor {
  position: absolute; z-index: 3; top: 76px; left: 16px; display: none; align-items: center; gap: 10px; padding: 8px 14px 8px 8px;
  border-radius: 14px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); max-width: min(420px, calc(100% - 32px));
}
.hud-floor b { display: block; font-size: 14px; }
.hud-floor small { display: block; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-mode="walk"] .hud-floor { display: flex; }

.lift {
  position: absolute; z-index: 3; right: 16px; top: 50%; transform: translateY(-50%); display: none; flex-direction: column; gap: 6px; padding: 10px 8px;
  border-radius: 16px; background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(238, 241, 246, .95)); border: 1px solid rgba(15, 23, 42, .1);
  box-shadow: 0 14px 40px rgba(15, 23, 42, .18);
}
[data-mode="walk"] .lift { display: flex; }
[data-mode="walk"][data-panel="1"] .lift { right: 412px; }
.lift-title { font-size: 9px; font-weight: 800; letter-spacing: .25em; color: #b45309; text-align: center; }
.lift button {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid #cbd5e1; background: radial-gradient(circle at 40% 35%, #ffffff, #e9edf3);
  color: #334155; font-weight: 800; font-size: 14px; transition: transform .15s, border-color .2s, box-shadow .2s;
}
.lift button:hover { transform: scale(1.06); border-color: #94a3b8; }
.lift button.on { border-color: #f59e0b; color: #b45309; box-shadow: 0 0 14px rgba(251, 191, 36, .55); }
.lift .lift-out { border-radius: 12px; margin-top: 4px; display: grid; place-items: center; }
.lift .lift-out svg { width: 20px; height: 20px; }
.lift.pulse { animation: liftPulse .9s var(--ease); }
@keyframes liftPulse { 40% { box-shadow: 0 0 0 6px rgba(251, 191, 36, .35); } }

.hint {
  position: absolute; z-index: 3; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); transform: translateX(-50%);
  padding: 8px 14px; border-radius: 99px; font-size: 12px; color: var(--ink-2); white-space: nowrap;
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); pointer-events: none;
  max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis;
}
.only-walk, [data-mode="walk"] .only-overview { display: none; }
[data-mode="walk"] .only-walk.desk { display: inline; }
@media (pointer: coarse) { [data-mode="walk"] .only-walk.desk { display: none; } [data-mode="walk"] .only-walk.mobile { display: inline; } }
.lift-prompt {
  position: absolute; z-index: 3; left: 50%; top: 58%; transform: translateX(-50%); padding: 9px 16px; border-radius: 12px; font-size: 13px; font-weight: 600;
  background: rgba(251, 191, 36, .92); color: #1c1402; box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}
.joy { display: none; position: absolute; z-index: 3; left: 24px; bottom: calc(env(safe-area-inset-bottom, 0px) + 56px); width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255, 255, 255, .55); border: 2px solid rgba(15, 23, 42, .15); touch-action: none; }
.joy i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(79, 70, 229, .85); box-shadow: 0 4px 14px rgba(15, 23, 42, .25); }
@media (pointer: coarse) { [data-mode="walk"] .joy { display: block; } }

/* name tags above employees */
.tag {
  pointer-events: auto; cursor: pointer; transform: translateY(-6px); text-align: center; padding: 5px 10px 6px; border-radius: 10px;
  background: rgba(255, 255, 255, .93); border: 1px solid rgba(15, 23, 42, .1); border-top: 3px solid var(--c, #38bdf8);
  color: #0f172a; font-family: var(--font); line-height: 1.15; white-space: nowrap; box-shadow: 0 6px 18px rgba(15, 23, 42, .18); user-select: none;
}
.tag b { display: block; font-size: 12.5px; }
.tag b::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: #7dd3fc; vertical-align: 1px; }
.tag[data-status="working"] b::before { background: #4ade80; box-shadow: 0 0 8px #4ade80; animation: pulse 1.4s infinite; }
.tag[data-status="off"] b::before { background: #64748b; }
.tag[data-status="error"] b::before { background: #f87171; }
.tag small { display: block; font-size: 10px; color: #64748b; }
.tag em { display: block; font-style: normal; font-size: 10.5px; color: #b45309; margin-top: 2px; }

.toasts { position: absolute; z-index: 4; left: 16px; top: 140px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; max-width: min(360px, calc(100% - 32px)); }
.toast { padding: 8px 12px; border-radius: 10px; font-size: 12px; background: rgba(255, 255, 255, .94); color: var(--ink); box-shadow: 0 6px 18px rgba(15, 23, 42, .12); border: 1px solid var(--line); animation: fadeUp .4s var(--ease); transition: opacity .5s, transform .5s; }
.toast b { color: #b45309; margin-right: 6px; }
.toast.out { opacity: 0; transform: translateX(-10px); }
[data-mode="walk"] .toasts { top: 140px; }

.drawer { z-index: 6; }
.btn-enter { width: 100%; margin-top: 12px; padding: 11px; border-radius: 11px; border: 0; font-weight: 700; color: #04111f; background: linear-gradient(135deg, #38bdf8, #818cf8); }
.btn-enter:hover { filter: brightness(1.08); }
.dr-head .avatar { width: 42px; height: 42px; font-size: 14px; }

.fade { position: absolute; inset: 0; z-index: 7; background: #f6f7fb; opacity: 0; pointer-events: none; transition: opacity .35s; }
.fade.on { opacity: 1; }
.loader { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #ffffff, #e8edf5); transition: opacity .8s; }
.loader.done { opacity: 0; pointer-events: none; }
.loader-box { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.loader-box b { font-size: 20px; letter-spacing: .02em; }
.loader-box small { color: var(--ink-2); }
.loader-box a { color: var(--ink-3); font-size: 12px; margin-top: 10px; }
.brand-mark.big { width: 56px; height: 56px; border-radius: 16px; }
.brand-mark.big svg { width: 32px; height: 32px; }
.bar { width: 220px; height: 5px; border-radius: 99px; background: rgba(15, 23, 42, .08); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #38bdf8, #818cf8); transition: width .3s; }

@media (max-width: 860px) {
  body { overflow: hidden; }
  .app { height: 100dvh; }
  .stage { height: auto; min-height: 0; }
  .panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 70svh; transform: translateY(calc(100% + 24px)); }
  .panel.open { transform: none; }
  [data-mode="walk"][data-panel="1"] .lift { right: 12px; }
  .hint { display: none; }
  .lift { top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 40px); transform: none; right: 12px; }
  .lift button { width: 36px; height: 36px; }
  .drawer { bottom: 8px; }
  .hud-floor { top: 84px; left: 10px; right: 10px; }
}
