/* Navbar shell — independent of the Tailwind CDN (prevents layout flash on first paint). */
*, *::before, *::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  max-width: 100%;
  overflow-x: clip;
}

.kidz-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 50;
  background-color: #2563eb;
  color: #fff;
  overflow-x: clip;
}

.kidz-nav-offset {
  display: block;
  min-height: 4rem;
}

/* Must match main.js: hidden md:flex / md:hidden */
.kidz-nav-desktop {
  display: none;
}

.kidz-nav-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kidz-nav-mobile-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.kidz-nav-install-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
}

.kidz-nav-install-btn:hover {
  background: #1d4ed8;
}

.kidz-nav-install-btn.hidden {
  display: none;
}

#kidz-nav-menu {
  display: none;
}

#kidz-nav-menu:not(.hidden) {
  display: block;
}

@media (min-width: 768px) {
  .kidz-nav-desktop {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .kidz-nav-toggle-btn {
    display: none;
  }

  .kidz-nav-mobile-actions {
    display: none;
  }

  #kidz-nav-menu {
    display: none !important;
  }
}

/* PWA install prompt */
.kidz-pwa-install {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  background: rgba(15, 23, 42, 0.45);
}

.kidz-pwa-install.hidden {
  display: none;
}

.kidz-pwa-install-card {
  width: 100%;
  max-width: 22rem;
  background: #fff;
  color: #1f2937;
  border-radius: 1rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
  padding: 1.25rem;
}

.kidz-pwa-install-header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 1rem;
}

.kidz-pwa-install-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  flex-shrink: 0;
}

.kidz-pwa-install-title {
  margin: 0 0 0.25rem;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}

.kidz-pwa-install-desc {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #4b5563;
}

.kidz-pwa-install-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kidz-pwa-install-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.625rem;
  background: #2563eb;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.kidz-pwa-install-btn:hover {
  background: #1d4ed8;
}

.kidz-pwa-install-dismiss {
  width: 100%;
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 0.625rem;
  background: transparent;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
}

.kidz-pwa-install-dismiss:hover {
  color: #374151;
}

@media (min-width: 768px) {
  .kidz-pwa-install {
    align-items: center;
  }
}

/* Interactive spotlight tours */
.kidz-tour-root {
  position: fixed;
  inset: 0;
  z-index: 250;
  pointer-events: none;
}

.kidz-tour-root:not(.hidden) {
  pointer-events: auto;
}

.kidz-tour-root.hidden {
  display: none;
}

body.kidz-tour-open {
  overflow: hidden;
}

.kidz-tour-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.kidz-tour-spotlight-wrap.hidden {
  display: none;
}

.kidz-tour-spotlight {
  position: fixed;
  border-radius: 0.75rem;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55);
  border: 2px solid #93c5fd;
  pointer-events: none;
  transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.kidz-tour-card {
  position: fixed;
  z-index: 2;
  width: min(calc(100vw - 1.5rem), 22rem);
  background: #fff;
  color: #1f2937;
  border-radius: 1rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
  padding: 1rem 1.125rem 1.125rem;
  pointer-events: auto;
}

.kidz-tour-card-centered {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%);
}

.kidz-tour-progress {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.kidz-tour-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
}

.kidz-tour-body {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #374151;
}

.kidz-tour-body strong {
  color: #111827;
}

.kidz-tour-illustration {
  margin-top: 0.875rem;
}

.kidz-tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}

.kidz-tour-skip {
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0;
}

.kidz-tour-nav {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.kidz-tour-back,
.kidz-tour-next {
  border: none;
  border-radius: 0.625rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.kidz-tour-back {
  background: #f3f4f6;
  color: #374151;
}

.kidz-tour-back:disabled {
  opacity: 0.45;
  cursor: default;
}

.kidz-tour-next {
  background: #2563eb;
  color: #fff;
}

.kidz-tour-next:hover {
  background: #1d4ed8;
}

/* Mock UI panels inside tours and help demos */
.kidz-tour-mock-phone,
.kidz-help-demo-slide-inner {
  border: 1px solid #e5e7eb;
  border-radius: 0.875rem;
  background: linear-gradient(180deg, #f9fafb 0%, #fff 100%);
  padding: 1rem;
  text-align: left;
}

.kidz-tour-mock-title,
.kidz-help-demo-slide-inner .kidz-tour-mock-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}

.kidz-tour-mock-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.kidz-tour-mock-badge-loan {
  background: #fef3c7;
  color: #92400e;
}

.kidz-tour-mock-badge-ok {
  background: #d1fae5;
  color: #065f46;
}

.kidz-tour-mock-line {
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 0.75rem;
}

.kidz-tour-mock-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #5b21b6;
  margin-bottom: 0.35rem;
}

.kidz-tour-mock-select {
  display: block;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #ddd6fe;
  border-radius: 0.5rem;
  background: #fff;
  font-size: 0.875rem;
  margin-bottom: 0.625rem;
}

.kidz-tour-mock-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
}

.kidz-tour-mock-btn-primary {
  background: #16a34a;
}

.kidz-tour-mock-btn-violet {
  background: #7c3aed;
  margin-top: 0.25rem;
}

.kidz-tour-mock-btn-indigo {
  background: #4f46e5;
  width: auto;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
}

.kidz-tour-mock-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.kidz-tour-mock-chip {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #3730a3;
}

.kidz-tour-mock-hint {
  margin: 0.625rem 0 0;
  font-size: 0.8125rem;
  color: #6b7280;
  line-height: 1.45;
}

.kidz-tour-mock-pulse {
  animation: kidz-tour-pulse 1.6s ease-in-out infinite;
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

@keyframes kidz-tour-pulse {
  0%,
  100% {
    outline-color: #2563eb;
  }
  50% {
    outline-color: #93c5fd;
  }
}

/* Help page demo slideshow */
.kidz-help-demo {
  margin-top: 1.25rem;
  border: 1px solid #dbeafe;
  border-radius: 1rem;
  background: #eff6ff;
  padding: 1rem;
}

.kidz-help-demo-title {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1e3a8a;
}

.kidz-help-demo-stage {
  background: #fff;
  border-radius: 0.875rem;
  border: 1px solid #e5e7eb;
  padding: 0.875rem;
  min-height: 10rem;
}

.kidz-help-demo-caption {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #374151;
}

.kidz-help-demo-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.875rem;
}

.kidz-help-demo-dots {
  display: flex;
  gap: 0.375rem;
}

.kidz-help-demo-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #bfdbfe;
  border: none;
  padding: 0;
  cursor: pointer;
}

.kidz-help-demo-dot.kidz-help-demo-dot-active {
  background: #2563eb;
}

.kidz-help-demo-nav {
  display: flex;
  gap: 0.5rem;
}

.kidz-help-demo-nav button {
  border: none;
  border-radius: 0.5rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
}

.kidz-help-demo-nav button:disabled {
  opacity: 0.45;
  cursor: default;
}

.kidz-help-tour-launch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.kidz-help-tour-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.625rem;
  background: #2563eb;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  touch-action: manipulation;
}

.kidz-help-tour-btn:hover {
  background: #1d4ed8;
}

.kidz-help-tour-btn-secondary {
  background: #fff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.kidz-help-tour-btn-secondary:hover {
  background: #eff6ff;
}

.kidz-help-video-wrap {
  margin-top: 1rem;
  border-radius: 0.875rem;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #000;
}

.kidz-help-video-wrap video {
  display: block;
  width: 100%;
  max-height: 16rem;
}

.kidz-help-video-note {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: #6b7280;
}
