.topbar {
  height: var(--topbar-height);
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: rgba(15, 15, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar__title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  flex: 1;
  text-align: center;
}

.topbar__action {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-size: 18px;
  transition: background var(--transition-fast);
}

.topbar__action:active {
  background: rgba(255,255,255,0.05);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(15, 15, 26, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: var(--z-nav);
  transition: transform var(--transition-base);
}

.bottom-nav--hidden {
  transform: translateY(100%);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.nav-item__icon {
  font-size: 22px;
  color: var(--text-muted);
  transition: color var(--transition-base), transform var(--transition-spring);
}

.nav-item__label {
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
  transition: color var(--transition-base);
}

.nav-item--active .nav-item__icon {
  color: var(--teal-light);
  transform: scale(1.1);
}

.nav-item--active .nav-item__label {
  color: var(--teal-light);
}

.nav-item--active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--teal-light);
  border-radius: 0 0 4px 4px;
}

/* Raised center logo button */
.nav-item--center {
  position: relative;
  margin-top: -22px;
}

.nav-item__logo-ring {
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  max-width: 52px;
  max-height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0D7377, #14b8a6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(13,115,119,0.4), 0 0 0 4px rgba(15,15,26,0.92);
  transition: transform var(--transition-spring), box-shadow var(--transition-base);
}

.nav-item--center:active .nav-item__logo-ring {
  transform: scale(0.92);
}

.nav-item--active.nav-item--center .nav-item__logo-ring {
  box-shadow: 0 4px 24px rgba(13,115,119,0.5), 0 0 0 4px rgba(15,15,26,0.92), 0 0 40px rgba(13,115,119,0.2);
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(13,115,119,0.5), 0 0 0 4px rgba(15,15,26,0.92), 0 0 40px rgba(13,115,119,0.2); }
  50% { box-shadow: 0 4px 28px rgba(13,115,119,0.65), 0 0 0 4px rgba(15,15,26,0.92), 0 0 50px rgba(13,115,119,0.3); }
}

.nav-item__logo-img {
  width: 36px !important;
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  object-fit: contain;
  border-radius: 50%;
  display: block;
}

.nav-item--center .nav-item__label {
  margin-top: 2px;
}

.nav-item--center::before {
  display: none !important;
}

.nav-item__badge {
  position: absolute;
  top: 2px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--coral);
  border-radius: 50%;
  border: 2px solid var(--midnight);
}

.nav-item--center .nav-item__badge {
  top: -2px;
  right: 2px;
}

/* Topbar inline logo for tab root screens */
.topbar__logo {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  min-width: 28px;
  min-height: 28px;
  object-fit: contain !important;
  border-radius: 50%;
  opacity: 0.85;
  flex-shrink: 0;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: var(--z-modal);
  transform: translateY(100%);
  transition: transform var(--transition-slow);
  max-height: 85dvh;
  overflow-y: auto;
}

.bottom-sheet--open {
  transform: translateY(0);
}

.bottom-sheet__handle {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  margin: 12px auto;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: var(--z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

.back-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-size: 18px;
}
