/* Onboarding tour */
#tourBackdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px) saturate(140%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 100000;
}
#tourBackdrop.show{
  opacity: 1;
  pointer-events: auto;
}
#tourCard{
  position: fixed;
  left: 20px;
  top: 20px;
  max-width: min(480px, 92vw);
  background: rgba(14,15,18,0.88);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow:
    0 24px 60px rgba(0,0,0,0.55),
    0 0 0 1px rgba(255,255,255,0.05) inset,
    0 1px 0 rgba(255,255,255,0.08) inset;
  border-radius: 18px;
  padding: 16px 16px 14px;
  color: #f4f4f5;
  backdrop-filter: blur(18px) saturate(140%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .22s ease, transform .22s ease, left .16s ease, top .16s ease, bottom .22s ease;
  z-index: 100002;
}
#tourCard.show{
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#tourCard.tour-docked{
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: max(14px, env(safe-area-inset-bottom, 0px) + 12px) !important;
  transform: translate(-50%, 0);
  width: min(520px, calc(100vw - 24px));
}
#tourCard.tour-centered{
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  width: min(560px, calc(100vw - 24px));
}
#tourCard:focus{
  outline: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 20px 44px rgba(0,0,0,0.5);
}
.tour-head{
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 10px;
}
.tour-kicker{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a1a1aa;
}
.tour-dot{
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: rgba(59,130,246,0.82);
  box-shadow: 0 0 0 6px rgba(59,130,246,0.14);
}
#tourProgress{
  font-size: 11px;
  color: #9ca3af;
  margin-left: auto;
}
.tour-title{
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
  color: #f8fafc;
}
.tour-body{
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.6;
  color: #d4d4d8;
  white-space: pre-line;
}
#tourBody{
  white-space: pre-line;
}
.tour-nav{
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tour-nav button{
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: #e5e7eb;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
  transition: all .16s ease;
}
.tour-nav button:hover{
  border-color: rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.08);
}
.tour-nav button:active{
  transform: translateY(1px);
}
#tourNext{
  background: linear-gradient(135deg, rgba(59,130,246,0.28), rgba(59,130,246,0.18));
  border-color: rgba(59,130,246,0.45);
  color: #f8fafc;
}
#tourNext:hover{
  border-color: rgba(59,130,246,0.75);
  box-shadow: 0 12px 32px rgba(59,130,246,0.28);
}
#tourPrev[disabled]{
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 640px){
  #tourCard{
    transition: bottom 220ms cubic-bezier(.2,.8,.2,1), transform 220ms cubic-bezier(.2,.8,.2,1), opacity 160ms ease;
  }
  #tourCard.tour-lift{
    bottom: 180px !important;
  }
}
#tourClose{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #e5e7eb;
  transition: all .16s ease;
}
#tourClose:hover{
  background: rgba(255,255,255,0.08);
}
#tourClose:active{
  transform: translateY(1px);
}
.tour-highlight{
  position: relative;
  z-index: 100001 !important;
  border-radius: var(--tour-br, 12px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.32),
    0 0 0 6px rgba(255,255,255,0.08),
    0 16px 40px rgba(0,0,0,0.55),
    0 0 24px rgba(59,130,246,0.22);
  transition: box-shadow .18s ease;
}
.tour-help-btn{
  height: 36px;
  padding: 0 12px;
}

@media (max-width: 640px){
  #tourCard.tour-card--top{
    top: calc(env(safe-area-inset-top, 0px) + 12px) !important;
    bottom: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: min(92vw, 520px) !important;
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - 24px) !important;
    overflow: auto !important;
  }
}

@media (max-width: 639px){
  #authPanel #btnTourHelp.tour-help-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: auto !important;
    min-height: 0 !important;
    padding: 0.5rem 0.75rem !important; /* py-2 px-3 */
    line-height: 1.25rem;              /* text-sm leading-5 */
  }
}
