:root{
  --bg:#07080b;
  --text:#f4f6fb;
  --muted:rgba(244,246,251,.72);

  --line:rgba(255,255,255,.12);
  --line2:rgba(255,255,255,.08);

  --card:rgba(18,20,26,.58);
  --card2:rgba(18,20,26,.92);

  --accent:#8B5CFF;
  --accent2:#5EEAD4;
  --glow: 0 0 28px rgba(139,92,255,.38);

  --shadow: 0 20px 60px rgba(0,0,0,.55);
  --radius: 18px;
  --radius-sm: 14px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; background:var(--bg); color:var(--text); }
body{ font: 14px/1.35 system-ui, -apple-system, Segoe UI, Roboto, Arial; }

.hidden{ display:none !important; }

.app{ height:100%; display:flex; flex-direction:column; }

.topbar{
  padding: 14px 16px;
  display:flex; align-items:center; justify-content:space-between;
  border-bottom:1px solid var(--line2);
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(10,12,18,.72), rgba(10,12,18,.32));
  position: relative;
  z-index: 50;
}

.brand{ display:flex; gap:12px; align-items:center; min-width:0; }

.brand__logoWrap{
  width:34px; height:34px;
  border-radius:12px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.10);
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
  display:flex; align-items:center; justify-content:center;
  flex:0 0 auto;
}
.brand__logo{
  width:22px; height:22px;
  object-fit:contain;
  display:block;
}

.brand__txt{ min-width:0; }
.brand__name{ font-weight:900; letter-spacing:.2px; }
.brand__sub{ color:var(--muted); font-size:12px; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:55vw; }

.stage{ position:relative; flex:1; overflow:hidden; }

.ar-mount{
  position:absolute; inset:0;
  z-index: 1;
  background:
    radial-gradient(1200px 600px at 50% 10%, rgba(139,92,255,.18), transparent 65%),
    radial-gradient(900px 520px at 12% 32%, rgba(94,234,212,.06), transparent 72%);
}
#arMount canvas { position:absolute !important; inset:0 !important; z-index:1 !important; }

.overlay-ui{
  position:absolute; left:0; right:0; bottom:0;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  pointer-events:none;
  z-index: 60;
}

.card{
  pointer-events:auto;
  border:1px solid var(--line2);
  background: linear-gradient(180deg, var(--card), var(--card2));
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: 14px;
  backdrop-filter: blur(14px);
}

.card__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
}

.muted{ color:var(--muted); }
.spacer{ height:10px; }
.tiny{ margin-top:10px; font-size:12px; }

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 11px;
  border:1px solid var(--line);
  border-radius:999px;
  font-size:12px;
  background: rgba(255,255,255,.06);
}
.pill__dot{
  width:8px;height:8px;border-radius:999px;
  background: rgba(167,175,194,.70);
}

.micro{
  color: var(--muted);
  font-size:12px;
  display:flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
}
.badge-lite{
  display:inline-flex;align-items:center;justify-content:center;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--line2);
  background: rgba(255,255,255,.06);
  font-size:11px;
  color: rgba(244,246,251,.85);
}

.btn{
  width:auto;
  border:1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color:var(--text);
  background: rgba(255,255,255,.06);
  font-weight:900;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover{ transform: translateY(-1px); box-shadow: 0 10px 20px rgba(0,0,0,.30); }
.btn:disabled{ opacity:.55; cursor:not-allowed; transform:none; box-shadow:none; }

.btn--wide{ width:100%; }

.btn--primary{
  background: linear-gradient(135deg, var(--accent), rgba(139,92,255,.55));
  border-color: rgba(139,92,255,.55);
  box-shadow: var(--glow);
}

.btn--ghost{
  padding:10px 12px;
  border-radius:12px;
  background: rgba(255,255,255,.05);
}

.row{
  display:flex; justify-content:space-between; gap:14px;
  margin-top: 10px;
}

.link{
  color: var(--muted);
  text-decoration:none;
  border-bottom: 1px dashed rgba(167,175,194,.35);
  padding-bottom: 2px;
  font-size:12px;
}

.toast{
  position:absolute; left:12px; right:12px; top:12px;
  padding:12px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,.62);
  border:1px solid var(--line2);
  backdrop-filter: blur(10px);
  z-index: 70;
  white-space: pre-wrap;
}

.renew{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line2);
}
.renew__title{ font-weight:900; }
.renew__text{ color:var(--muted); margin-top:6px; margin-bottom:10px; }

.hint{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

/* Mini bar */
.found-mini{
  pointer-events:auto;
  position:absolute;
  left:14px;
  right:14px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 65;
  border:1px solid var(--line2);
  background: rgba(18,20,26,.62);
  backdrop-filter: blur(14px);
  border-radius: 999px;
  padding: 10px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  box-shadow: var(--shadow);
}
.found-mini__left{
  display:flex; align-items:center; gap:10px;
  min-width:0;
}
.found-mini__dot{
  width:8px;height:8px;border-radius:999px;
  background: rgba(34,197,94,.90);
  box-shadow: 0 0 16px rgba(34,197,94,.22);
}
.found-mini__txt{
  font-size:12px;
  color: rgba(244,246,251,.90);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.found-mini__actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}
.found-mini__btn{
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 900;
  font-size: 12px;
  text-decoration:none;
}
.found-mini__btn2{
  border:1px solid rgba(139,92,255,.45);
  background: rgba(139,92,255,.18);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 900;
  font-size: 12px;
}

/* ✅ FIX: Kai randa, didelę kortelę NUIMAM VISIŠKAI */
.overlay-ui.is-found #mainCard{
  display: none !important;
}

/* Fatal overlay */
.fatal{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  padding: 18px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(12px);
  z-index: 100;
  pointer-events:auto;
}
.fatal *{ pointer-events:auto; }

.fatal__card{
  width:min(520px, 100%);
  border:1px solid var(--line2);
  background: linear-gradient(180deg, rgba(18,20,26,.72), rgba(18,20,26,.92));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.fatal__title{ font-weight:900; font-size:16px; }
.fatal__msg{ color:var(--muted); margin-top:8px; }
.fatal__actions{ display:flex; gap:10px; margin-top:12px; }
.fatal__actions .btn{ width:50%; }

/* DEBUG panel */
.debug{
  position:absolute;
  left:12px; right:12px;
  top:70px;
  max-height:45vh;
  overflow:auto;
  padding:12px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,.72);
  border:1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  font-size:12px;
  line-height:1.35;
  z-index: 200;
  white-space: pre-wrap;
}

.toast { z-index: 70; }
.overlay-ui { z-index: 60; }
#fatal.hidden { display: none !important; }
