/* ====== THEME ====== */
:root{
  --bg:#05070c;
  --bg2:#000;
  --neon:#00ff99;
  --neon2:#00d1ff;
  --danger:#ff2a2a;
  --muted:rgba(0,255,153,.55);
  --text:#bfffe6;
  --glass: rgba(0, 255, 153, .08);
  --glass2: rgba(0, 209, 255, .08);
  --shadow: 0 0 22px rgba(0,255,153,.25);
  --shadow2: 0 0 22px rgba(0,209,255,.18);
}

*{ margin:0; padding:0; box-sizing:border-box; font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; }
body{ background: radial-gradient(1200px 700px at 50% -20%, rgba(0,255,153,.10), transparent 60%),
              radial-gradient(900px 600px at 80% 120%, rgba(0,209,255,.10), transparent 55%),
              #000;
      color: var(--text);
      height:100vh; overflow:hidden; }

/* ====== SCREENS ====== */
.screen{ display:none; height:100vh; width:100vw; position:relative; }
.screen.active{ display:flex; align-items:center; justify-content:center; }

.center{ text-align:center; padding: clamp(18px, 4vw, 36px); width:min(720px, 92vw); z-index: 2; }
h1{ letter-spacing: 2.5px; font-weight: 700; font-size: clamp(22px, 4vw, 34px); color: var(--neon); text-shadow: var(--shadow); }
h2{ letter-spacing: 2px; font-weight: 700; font-size: clamp(22px, 3.5vw, 34px); color: var(--neon); text-shadow: var(--shadow); margin-bottom: 10px; }

.subtle{ color: rgba(191,255,230,.75); }
.tiny{ font-size: 12px; }

/* ====== BUTTONS ====== */
.btn{
  border: 1.5px solid rgba(0,255,153,.65);
  background: linear-gradient(180deg, rgba(0,255,153,.10), rgba(0,255,153,.04));
  color: var(--text);
  padding: 14px 18px;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}

.btn:hover{ transform: translateY(-1px); box-shadow: var(--shadow); border-color: rgba(0,255,153,.9); }
.btn:active{ transform: translateY(0px) scale(.99); }

.btn.primary{
  display:inline-flex; align-items:center; gap:10px;
  font-size: 16px;
  padding: 14px 22px;
}

.btn-ic{
  width: 26px; height: 26px;
  display:inline-grid; place-items:center;
  border-radius: 50%;
  background: rgba(0,255,153,.12);
  border: 1px solid rgba(0,255,153,.35);
  box-shadow: var(--shadow);
}

.btn.ghost{
  background: rgba(0,0,0,.25);
  border-color: rgba(0,255,153,.35);
  padding: 10px 14px;
  border-radius: 10px;
}

.btn.card{
  width: min(820px, 92vw);
  display:flex; align-items:center; justify-content:space-between;
  gap: 14px;
  padding: 16px 16px;
  text-align:left;
}

.btn.card .ic{ font-size: 22px; width: 40px; display:flex; align-items:center; justify-content:center; }
.btn.card .txt{ display:flex; flex-direction:column; gap: 2px; flex: 1; }
.btn.card .txt .t{ color: var(--neon); text-shadow: var(--shadow); font-weight: 700; font-size: clamp(14px, 2.2vw, 18px); }
.btn.card .txt .d{ color: rgba(191,255,230,.70); font-size: clamp(12px, 1.8vw, 14px); }
.btn.card .chev{ color: rgba(191,255,230,.8); font-size: 22px; }

.btn.disabled{ opacity:.45; cursor:not-allowed; filter: saturate(.8); }

/* ====== DASHBOARD ====== */
.topbar{
  position:absolute; top: 12px; left: 12px; right: 12px;
  display:flex; align-items:center; justify-content:space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(0,255,153,.10), rgba(0,255,153,.03));
  border: 1px solid rgba(0,255,153,.25);
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
  backdrop-filter: blur(10px);
  z-index: 5;
}

.topbar--overlay{
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.20));
  border-color: rgba(0,255,153,.20);
}

.topbar-title{
  color: var(--neon);
  text-shadow: var(--shadow);
  font-weight: 800;
  letter-spacing: 1.5px;
  font-size: clamp(16px, 2.6vw, 22px);
}

.topbar-left{ display:flex; align-items:center; gap: 10px; }
.logo-dot{
  width: 10px; height:10px; border-radius:50%;
  background: var(--neon);
  box-shadow: 0 0 16px rgba(0,255,153,.9);
}
.topbar-sub{ font-size: 12px; color: rgba(191,255,230,.75); letter-spacing: .8px; }
.topbar-right{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,255,153,.35);
  background: rgba(0,255,153,.08);
}

.dash-wrap{
  width: 100%;
  padding-top: clamp(70px, 10vh, 100px);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 14px;
}

.panel-title{
  font-size: clamp(14px, 2vw, 16px);
  color: rgba(191,255,230,.78);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.menu{ display:flex; flex-direction:column; align-items:center; gap: 12px; }

.foot{ margin-top: 6px; }

/* ====== SPLASH ====== */
.pulse{
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,255,153,.55);
  margin: 26px auto 16px;
  position: relative;
  box-shadow: var(--shadow);
}
.pulse:before, .pulse:after{
  content:"";
  position:absolute; inset:0;
  border-radius:50%;
  border: 1px solid rgba(0,255,153,.45);
  animation: pulse 2.2s infinite;
}
.pulse:after{ animation-delay: 1.1s; opacity:.8; }

@keyframes pulse{
  0%{ transform: scale(.85); opacity:.25; }
  50%{ transform: scale(1.05); opacity:.9; }
  100%{ transform: scale(1.35); opacity:0; }
}

.logs{
  margin-top: 14px;
  font-size: 12px;
  opacity: .75;
  height: 68px;
  overflow: hidden;
  line-height: 1.4;
  color: rgba(191,255,230,.70);
}

/* ====== VIDEO SCREENS ====== */
video{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit: cover;
  filter: contrast(1.05) saturate(1.05) brightness(.92);
}

/* ====== FACE SCAN UI ====== */
.hud-top{
  position:absolute; top: 12px; left: 12px; right: 12px;
  display:flex; align-items:center; justify-content:space-between;
  z-index: 6;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.20));
  border: 1px solid rgba(0,255,153,.20);
  backdrop-filter: blur(8px);
}

.hud-title{ color: var(--neon); text-shadow: var(--shadow); font-weight: 800; letter-spacing: 1px; font-size: 14px; }
.hud-chip{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,255,153,.35);
  background: rgba(0,255,153,.10);
}

.scan-mask{
  position:absolute;
  width: min(280px, 66vw);
  height: min(280px, 66vw);
  border-radius: 50%;
  border: 2px solid rgba(0,255,153,.95);
  box-shadow: 0 0 30px rgba(0,255,153,.28);
  z-index: 4;
}

.scan-corners{
  position:absolute;
  width: min(300px, 72vw);
  height: min(300px, 72vw);
  border-radius: 18px;
  border: 1px dashed rgba(0,255,153,.25);
  z-index: 3;
  box-shadow: var(--shadow2);
}

.scan-line{
  position:absolute;
  width: min(280px, 66vw);
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon), transparent);
  filter: drop-shadow(0 0 12px rgba(0,255,153,.8));
  animation: scan 1.8s infinite;
  z-index: 5;
}

@keyframes scan{
  0%{ transform: translateY(calc(-1 * min(140px, 33vw))); opacity:.55; }
  50%{ transform: translateY(min(140px, 33vw)); opacity: 1; }
  100%{ transform: translateY(calc(-1 * min(140px, 33vw))); opacity:.55; }
}

.scan-text{
  position:absolute;
  bottom: 16%;
  font-size: clamp(18px, 3.3vw, 24px);
  color: var(--neon);
  text-shadow: var(--shadow);
  z-index: 6;
}

.scan-sub{
  position:absolute;
  bottom: 12%;
  font-size: clamp(12px, 2.2vw, 14px);
  color: rgba(191,255,230,.75);
  z-index: 6;
}

/* ====== 360 SCAN UI ====== */
.hud{
  position:absolute;
  top: 72px;
  left: 12px; right: 12px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  z-index: 6;
}

.hud-row{ display:flex; gap: 8px; flex-wrap: wrap; }
.chip{
  font-size: 11px;
  letter-spacing: 1px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,255,153,.30);
  background: rgba(0,255,153,.08);
  backdrop-filter: blur(6px);
}

.signal{
  min-width: min(240px, 40vw);
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,255,153,.20);
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}

.signal-label{ font-size: 12px; color: rgba(191,255,230,.75); margin-bottom: 6px; }
.signal-bar{
  width: 100%;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,255,153,.25);
  background: rgba(0,255,153,.06);
  overflow:hidden;
}
.signal-fill{
  height:100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0,255,153,.25), rgba(0,255,153,.95));
  box-shadow: 0 0 18px rgba(0,255,153,.45);
  transition: width .12s ease;
}
.signal-val{ margin-top: 6px; font-size: 12px; color: rgba(191,255,230,.85); text-align:right; }

/* Radar */
.radar{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  z-index: 3;
  pointer-events:none;
}

.radar-grid{
  position:absolute;
  width: min(520px, 92vw);
  height: min(520px, 92vw);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(0,255,153,.09) 1px, transparent 1px) 0 0/18px 18px,
    radial-gradient(circle at center, rgba(0,255,153,.08), transparent 58%);
  mask-image: radial-gradient(circle, #000 56%, transparent 70%);
  opacity: .8;
}

.radar-ring{
  position:absolute;
  width: min(520px, 92vw);
  height: min(520px, 92vw);
  border-radius: 50%;
  border: 1px solid rgba(0,255,153,.18);
  box-shadow: 0 0 40px rgba(0,255,153,.08);
}
.r1{ transform: scale(.35); }
.r2{ transform: scale(.62); }
.r3{ transform: scale(.92); }

.radar-sweep{
  position:absolute;
  width: min(520px, 92vw);
  height: min(520px, 92vw);
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(0,255,153,.0) 0deg, rgba(0,255,153,.22) 14deg, rgba(0,255,153,.0) 45deg);
  filter: blur(.2px);
  animation: sweep 2.6s linear infinite;
  opacity: .85;
}
@keyframes sweep{ to{ transform: rotate(360deg); } }

/* Infrared dots */
.dots{
  position:absolute;
  inset:0;
  z-index: 4;
  pointer-events:none;
}
.dot{
  position:absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(255,40,40,.95);
  box-shadow: 0 0 14px rgba(255,40,40,.55);
  opacity: .9;
  animation: drift 2.8s ease-in-out infinite;
}
.dot.big{ width: 6px; height: 6px; opacity: .95; }
@keyframes drift{
  0%{ transform: translate(0,0); opacity:.65; }
  50%{ transform: translate(10px, -12px); opacity:1; }
  100%{ transform: translate(0,0); opacity:.65; }
}

/* EM waves */
.waves{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  z-index: 2;
  pointer-events:none;
}
.wave{
  position:absolute;
  width: min(560px, 100vw);
  height: min(560px, 100vw);
  border-radius: 50%;
  border: 1px solid rgba(0,209,255,.18);
  box-shadow: 0 0 18px rgba(0,209,255,.10);
  opacity:.65;
  animation: wave 3.2s ease-out infinite;
}
.w2{ animation-delay: 1.1s; opacity:.55; }
.w3{ animation-delay: 2.2s; opacity:.45; }
@keyframes wave{
  0%{ transform: scale(.25); opacity:.0; }
  15%{ opacity:.6; }
  60%{ opacity:.35; }
  100%{ transform: scale(1.05); opacity:0; }
}

/* Alert */
.alert{
  position:absolute;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%);
  width: min(560px, 92vw);
  padding: 16px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,42,42,.55);
  background: rgba(0,0,0,.65);
  box-shadow: 0 0 40px rgba(255,42,42,.18);
  backdrop-filter: blur(10px);
  text-align:center;
  z-index: 9;
  opacity: 0;
  pointer-events:none;
  transition: opacity .12s ease, transform .12s ease;
}
.alert.on{
  opacity: 1;
  transform: translate(-50%, -52%);
}
.alert-title{
  color: rgba(255,42,42,.98);
  text-shadow: 0 0 22px rgba(255,42,42,.22);
  font-weight: 900;
  letter-spacing: 2px;
  font-size: clamp(18px, 3.8vw, 28px);
}
.alert-sub{ margin-top: 6px; color: rgba(255,200,200,.85); font-size: 13px; }

/* Hold button */
.hold-wrap{
  position:absolute;
  left:50%;
  bottom: clamp(22px, 4vh, 42px);
  transform: translateX(-50%);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 10px;
  z-index: 8;
  width: 92vw;
}

.hold-btn{
  width: clamp(70px, 10vw, 92px);
  height: clamp(70px, 10vw, 92px);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,60,60,.95), rgba(160,0,0,.95));
  border: 2px solid rgba(255,90,90,.85);
  box-shadow: 0 0 22px rgba(255,42,42,.25);
  cursor: pointer;
  position: relative;
}

.hold-btn:before{
  content:"";
  position:absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(255,42,42,.25);
  animation: holdPulse 2s infinite;
  opacity: .9;
}

@keyframes holdPulse{
  0%{ transform: scale(.9); opacity: .35; }
  60%{ transform: scale(1.08); opacity: .25; }
  100%{ transform: scale(1.18); opacity: 0; }
}

.hold-btn.holding{
  filter: brightness(1.05) saturate(1.15);
  box-shadow: 0 0 36px rgba(255,42,42,.35);
}

.hold-hint{ text-align:center; }

/* Background logs overlay */
.bg-logs{
  position:absolute;
  inset:0;
  z-index: 1;
  pointer-events:none;
  opacity: .22;
  font-size: 12px;
  color: rgba(191,255,230,.55);
  padding: 110px 14px 120px;
  overflow:hidden;
  line-height: 1.45;
  mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
}
.bg-logs--scan{ padding-top: 92px; }

/* ====== RESPONSIVE ====== */
@media (min-width: 900px){
  .menu{ gap: 14px; }
  .btn.card{ padding: 18px 18px; }
  .signal{ min-width: 320px; }
}

@media (orientation: landscape) and (max-height: 520px){
  .dash-wrap{ padding-top: 78px; }
  .hold-wrap{ bottom: 16px; gap: 8px; }
  .scan-text{ bottom: 18%; }
}


/* ====== WIFI / BT ANALYSIS ====== */
.btn.danger{
  border-color: rgba(255,42,42,.7);
  background: linear-gradient(180deg, rgba(255,42,42,.14), rgba(255,42,42,.05));
}
.btn.danger:hover{
  box-shadow: 0 0 28px rgba(255,42,42,.20);
  border-color: rgba(255,42,42,.95);
}
.danger-ic{
  background: rgba(255,42,42,.12);
  border-color: rgba(255,42,42,.35);
  box-shadow: 0 0 18px rgba(255,42,42,.18);
}

.hidden{ display:none !important; }

.wifi-wrap{
  width: 100%;
  padding: 88px 12px 22px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 14px;
}

.wifi-head{
  width: min(980px, 94vw);
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.wifi-sub{
  font-size: clamp(12px, 2.1vw, 14px);
  line-height: 1.4;
}

.switch-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}

.switch-label{
  font-size: 12px;
  letter-spacing: 1px;
  color: rgba(191,255,230,.75);
}

.switch{
  position: relative;
  display:flex;
  border: 1px solid rgba(0,255,153,.25);
  background: rgba(0,255,153,.06);
  border-radius: 999px;
  padding: 4px;
  overflow:hidden;
  width: min(420px, 74vw);
}

.sw{
  flex:1;
  padding: 10px 10px;
  background: transparent;
  border: none;
  color: rgba(191,255,230,.80);
  cursor:pointer;
  z-index: 2;
  font-weight: 700;
  letter-spacing: .4px;
  font-size: clamp(12px, 1.9vw, 14px);
}
.sw.on{ color: #00140c; }
.sw-ind{
  position:absolute;
  top: 4px;
  bottom: 4px;
  width: calc(50% - 4px);
  left: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0,255,153,.55), rgba(0,255,153,.95));
  box-shadow: 0 0 22px rgba(0,255,153,.20);
  transition: left .18s ease;
  z-index: 1;
}

.wifi-panel{
  width: min(980px, 94vw);
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(0,255,153,.20);
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
  position:relative;
  overflow:hidden;
}

@media (min-width: 900px){
  .wifi-panel{
    grid-template-columns: 360px 1fr;
    align-items: center;
  }
}

.radar-mini{
  position: relative;
  width: min(320px, 74vw);
  height: min(320px, 74vw);
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(0,255,153,.18);
  box-shadow: 0 0 40px rgba(0,255,153,.08);
  background: radial-gradient(circle at center, rgba(0,255,153,.10), transparent 62%);
  overflow:hidden;
}
.radar-mini-ring{
  position:absolute;
  inset: 8%;
  border-radius:50%;
  border: 1px solid rgba(0,255,153,.18);
}
.radar-mini-ring.r1{ inset: 28%; }
.radar-mini-ring.r2{ inset: 18%; }
.radar-mini-ring.r3{ inset: 8%; }

.radar-mini-sweep{
  position:absolute;
  inset:-20%;
  border-radius:50%;
  background: conic-gradient(from 0deg, rgba(0,255,153,0) 0deg, rgba(0,255,153,.26) 16deg, rgba(0,255,153,0) 55deg);
  animation: sweep 2.2s linear infinite;
  opacity:.9;
}

.scan-ui{
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.scan-title{
  font-size: 12px;
  letter-spacing: 1px;
  color: rgba(191,255,230,.78);
}

.scan-big{
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--neon);
  text-shadow: var(--shadow);
  font-size: clamp(20px, 4.2vw, 34px);
}

.progress{
  display:flex;
  align-items:center;
  gap: 10px;
}
.progress-bar{
  flex:1;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,255,153,.25);
  background: rgba(0,255,153,.06);
  overflow:hidden;
}
.progress-fill{
  height:100%;
  width:0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0,255,153,.25), rgba(0,255,153,.95));
  box-shadow: 0 0 18px rgba(0,255,153,.35);
  transition: width .12s ease;
}
.progress-val{ font-size: 12px; color: rgba(191,255,230,.85); width: 44px; text-align:right; }

.meters{
  display:grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 520px){
  .meters{ grid-template-columns: 1fr 1fr 1fr; }
}
.meter{ display:flex; flex-direction:column; gap: 6px; }
.m-label{ font-size: 12px; color: rgba(191,255,230,.78); }
.m-bar{
  height: 9px;
  border-radius: 999px;
  border: 1px solid rgba(0,255,153,.20);
  background: rgba(0,255,153,.05);
  overflow:hidden;
}
.m-fill{
  height:100%;
  width: 18%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0,209,255,.15), rgba(0,255,153,.95));
  box-shadow: 0 0 16px rgba(0,255,153,.20);
  transition: width .12s ease;
}

.wifi-list{
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,255,153,.15);
  background: rgba(0,0,0,.35);
  height: 150px;
  overflow:auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  color: rgba(191,255,230,.78);
  mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent);
}

.actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.result{
  margin-top: 6px;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(0,255,153,.20);
  background: rgba(0,255,153,.06);
  color: rgba(191,255,230,.95);
  display:none;
}
.result.on{ display:block; }
.result.danger{
  border-color: rgba(255,42,42,.55);
  background: rgba(255,42,42,.10);
}
.result.success{
  border-color: rgba(0,255,153,.35);
  background: rgba(0,255,153,.08);
}
.result .big{
  font-weight: 900;
  letter-spacing: 2px;
  font-size: clamp(16px, 3.4vw, 24px);
  color: var(--neon);
  text-shadow: var(--shadow);
}
.result.danger .big{ color: rgba(255,42,42,.98); text-shadow: 0 0 22px rgba(255,42,42,.22); }
.result .sub{ margin-top: 6px; font-size: 12px; color: rgba(191,255,230,.80); line-height:1.4; }


/* ====== MOBILE FIX: allow vertical scroll on Wi-Fi screen (does not affect tablet layout) ====== */
/* Body stays locked to avoid breaking other screens. We enable scrolling only inside the Wi-Fi screen. */
#wifi{
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* On smaller phones, add extra bottom padding so results/buttons are never cut off */
@media (max-width: 520px){
  .wifi-wrap{
    padding-bottom: 90px;
  }
}

/* Make sure the topbar remains visible while scrolling on the Wi-Fi screen */
#wifi .topbar{
  position: sticky;
  top: 12px;
}


/* ====== LISTENING SCANS ====== */
.listen-wrap{
  width: 100%;
  padding: 88px 12px 22px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 14px;
}

.listen-head{
  width: min(980px, 94vw);
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.listen-sub{
  font-size: clamp(12px, 2.1vw, 14px);
  line-height: 1.4;
}

.listen-panel{
  width: min(980px, 94vw);
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(0,255,153,.20);
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
  position:relative;
  overflow:hidden;
}

@media (min-width: 900px){
  .listen-panel{
    grid-template-columns: 360px 1fr;
    align-items: center;
  }
}

.listen-radar{
  position: relative;
  width: min(320px, 74vw);
  height: min(320px, 74vw);
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(0,255,153,.18);
  box-shadow: 0 0 40px rgba(0,255,153,.08);
  background: radial-gradient(circle at center, rgba(0,255,153,.10), transparent 62%);
  overflow:hidden;
}

.listen-ring{
  position:absolute;
  inset: 8%;
  border-radius:50%;
  border: 1px solid rgba(0,255,153,.18);
}
.listen-ring.r1{ inset: 28%; }
.listen-ring.r2{ inset: 18%; }
.listen-ring.r3{ inset: 8%; }

.listen-grid{
  position:absolute;
  inset: 10%;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(0,255,153,.10) 1px, transparent 1px) 0 0/18px 18px,
    radial-gradient(circle at center, rgba(0,209,255,.08), transparent 60%);
  mask-image: radial-gradient(circle, #000 56%, transparent 72%);
  opacity: .75;
}

.listen-sweep{
  position:absolute;
  inset:-20%;
  border-radius:50%;
  background: conic-gradient(from 0deg, rgba(0,255,153,0) 0deg, rgba(0,255,153,.24) 14deg, rgba(0,255,153,0) 52deg);
  animation: sweep 2.0s linear infinite;
  opacity:.9;
}

.listen-ui{ display:flex; flex-direction:column; gap: 10px; }

.eq{
  display:flex;
  align-items:flex-end;
  gap: 6px;
  height: 72px;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,255,153,.15);
  background: rgba(0,0,0,.32);
  overflow:hidden;
}
.eq .bar{
  width: 8px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, rgba(0,209,255,.18), rgba(0,255,153,.95));
  box-shadow: 0 0 16px rgba(0,255,153,.15);
  animation: eq 1.2s ease-in-out infinite;
  height: 18px;
  opacity: .9;
}
.eq .b2{ animation-delay: .10s; }
.eq .b3{ animation-delay: .20s; }
.eq .b4{ animation-delay: .30s; }
.eq .b5{ animation-delay: .40s; }
.eq .b6{ animation-delay: .50s; }
.eq .b7{ animation-delay: .60s; }
.eq .b8{ animation-delay: .70s; }
.eq .b9{ animation-delay: .80s; }
.eq .b10{ animation-delay: .90s; }
.eq .b11{ animation-delay: 1.00s; }
.eq .b12{ animation-delay: 1.10s; }

@keyframes eq{
  0%{ height: 12px; opacity:.55; }
  40%{ height: 62px; opacity: 1; }
  80%{ height: 22px; opacity:.75; }
  100%{ height: 12px; opacity:.55; }
}

.listen-list{
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,255,153,.15);
  background: rgba(0,0,0,.35);
  height: 170px;
  overflow:auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  color: rgba(191,255,230,.78);
  mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent);
}


}


/* ====== MOBILE ONLY: scroll vertical + evitar cortes (Wi-Fi e Listening) ====== */
/* Não altera o tablet. Em celular, liberamos rolagem na PRÓPRIA tela (screen) e mantemos layout centralizado. */
@media (max-width: 520px){
  #wifi, #listen{
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  /* Dá espaço extra no fim para resultados/botões */
  #wifi .wifi-wrap,
  #listen .listen-wrap{
    padding-bottom: 140px;
  }

  /* Evita que painéis “estourem” e criem faixas pretas */
  .wifi-panel, .listen-panel{
    width: min(980px, 94vw);
  }

  /* Switch ocupa melhor o mobile e evita cortes visuais */
  .switch{
    width: min(420px, 92vw);
  }

  /* Botão de varredura sempre visível no Listening (sem mexer no tablet) */
  #listen .actions{
    position: sticky;
    bottom: 14px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(0,255,153,.14);
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(8px);
  }
}

/* ====== MOBILE TOPBAR FIX: botão voltar à esquerda, título central, badge à direita ====== */
@media (max-width: 520px){
  .topbar.topbar--overlay{
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .topbar.topbar--overlay .topbar-title{
    text-align: center;
    justify-self: center;
    font-size: clamp(14px, 4.2vw, 18px);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar.topbar--overlay .btn.ghost{
    justify-self: start;
  }
  .topbar.topbar--overlay .topbar-right{
    justify-self: end;
  }
}

/* ====== SCAN PC ====== */
.pc-wrap{
  width: 100%;
  padding: 88px 12px 22px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 14px;
}

.pc-head{
  width: min(980px, 94vw);
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.pc-sub{
  font-size: clamp(12px, 2.1vw, 14px);
  line-height: 1.4;
}

.pc-panel{
  width: min(980px, 94vw);
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(0,255,153,.20);
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
  position:relative;
  overflow:hidden;
}

@media (min-width: 900px){
  .pc-panel{
    grid-template-columns: 360px 1fr;
    align-items: start;
  }
}

.pc-device-title{
  font-size: 12px;
  letter-spacing: 1px;
  color: rgba(191,255,230,.78);
  margin-bottom: 8px;
}

.pc-device-box{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(0,255,153,.18);
  background: rgba(0,0,0,.35);
}

.pc-led{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(0,255,153,.18);
  box-shadow: 0 0 18px rgba(0,255,153,.10);
}

.pc-led.on{
  background: rgba(0,255,153,.95);
  box-shadow: 0 0 26px rgba(0,255,153,.30);
}

.pc-device-main{
  font-weight: 900;
  letter-spacing: .6px;
  color: rgba(191,255,230,.95);
}

.pc-device-meta{
  margin-top: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color: rgba(191,255,230,.70);
}

.pc-bars{
  display:flex;
  align-items:flex-end;
  gap: 6px;
  height: 70px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,255,153,.15);
  background: rgba(0,0,0,.32);
  overflow:hidden;
}
.pc-bars .pbar{
  width: 8px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, rgba(0,209,255,.18), rgba(0,255,153,.95));
  box-shadow: 0 0 16px rgba(0,255,153,.15);
  animation: pcEq 1.1s ease-in-out infinite;
  height: 18px;
  opacity: .9;
}
.pc-bars .b2{ animation-delay: .10s; }
.pc-bars .b3{ animation-delay: .20s; }
.pc-bars .b4{ animation-delay: .30s; }
.pc-bars .b5{ animation-delay: .40s; }
.pc-bars .b6{ animation-delay: .50s; }
.pc-bars .b7{ animation-delay: .60s; }
.pc-bars .b8{ animation-delay: .70s; }
.pc-bars .b9{ animation-delay: .80s; }
.pc-bars .b10{ animation-delay: .90s; }
.pc-bars .b11{ animation-delay: 1.00s; }
.pc-bars .b12{ animation-delay: 1.10s; }

@keyframes pcEq{
  0%{ height: 12px; opacity:.55; }
  45%{ height: 64px; opacity: 1; }
  85%{ height: 22px; opacity:.75; }
  100%{ height: 12px; opacity:.55; }
}

.pc-list{
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,255,153,.15);
  background: rgba(0,0,0,.35);
  height: 180px;
  overflow:auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  color: rgba(191,255,230,.78);
  mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent);
}

@media (max-width: 520px){
  #scanpc{
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  #scanpc .pc-wrap{
    padding-bottom: 140px;
  }
  #scanpc .actions{
    position: sticky;
    bottom: 14px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(0,255,153,.14);
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(8px);
  }
}

/* ====== PERFORMANCE: Tablet otimizações (reduz carga do 360 scan) ====== */
body.is-tablet #scan360 .radar-sweep{ animation-duration: 2.8s; }
body.is-tablet #scan360 .waves .wave{ animation-duration: 2.4s; opacity: .55; }

/* ====== Advanced 360: botão de detecção (toggle) ====== */
#scan360 #holdBtn{
  width: 54px;
  height: 54px;
  border-radius: 999px;
  position: fixed;
  left: 16px;
  bottom: 18px;
  z-index: 9999;
}
@media (min-width: 900px){
  #scan360 #holdBtn{ left: 20px; bottom: 20px; }
}

/* ====== ULTRA PERFORMANCE (tablet): máximo desempenho durante câmera ====== */
body.is-tablet.cam360-active #scan360 .bg-logs,
body.is-tablet.cam360-active #scan360 .waves,
body.is-tablet.cam360-active #scan360 .dots,
body.is-tablet.cam360-active #scan360 .scan-chips,
body.is-tablet.cam360-active #scan360 .scan-metrics{
  display: none !important;
}
body.is-tablet.cam360-active #scan360 .panel{
  backdrop-filter: none !important;
  background: rgba(0,0,0,.18) !important;
}
