:root {
  --cp-bg: var(--bg);
  --cp-text: var(--text);
  --cp-text-strong: var(--text);
  --cp-muted: var(--muted);
  --cp-border: var(--border);
  --cp-surface: var(--surface);
  --cp-surface-elevated: var(--surface);
  --cp-surface-soft: var(--soft);
  --cp-surface-tint: var(--hero);
  --cp-input-bg: var(--surface);
  --cp-placeholder: var(--muted);
  --cp-red: var(--accent);
  --cp-chip-bg: var(--tint);
  --cp-chip-bg-hover: var(--soft);
  --cp-chip-bg-active: var(--tint);
  --cp-chip-border: var(--border);
  --cp-chip-border-active: var(--accent);
  --cp-chip-shadow: inset 0 0 0 1px var(--border);
  --cp-overlay-border: var(--border);
  --cp-overlay-shadow: 0 24px 70px rgba(15, 15, 16, 0.26);
  --cp-modal-close-bg: var(--soft);
  --cp-code-bg: var(--soft);
  --cp-neutral-pill-bg: var(--soft);
  --cp-neutral-pill-text: var(--muted);
  --cp-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --cp-shadow: 0 18px 45px rgba(39, 39, 42, 0.12);
}

:root[data-theme="dark"] {
  --cp-overlay-shadow: 0 24px 70px rgba(0, 0, 0, 0.44);
  --cp-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.central-app-navigation {
  position: fixed;
  z-index: 1200;
  left: max(18px, env(safe-area-inset-left));
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + var(--central-push-prompt-offset, 0px));
  transition: bottom .2s var(--cp-ease);
}

.central-app-navigation-toggle {
  appearance: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--cp-shadow);
  cursor: pointer;
}

.central-app-navigation-toggle span {
  display: block;
  width: 19px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform .2s ease, opacity .2s ease;
}

.central-app-navigation.is-open .central-app-navigation-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.central-app-navigation.is-open .central-app-navigation-toggle span:nth-child(2) {
  opacity: 0;
}

.central-app-navigation.is-open .central-app-navigation-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.central-app-navigation-panel {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  display: grid;
  min-width: 156px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--cp-overlay-shadow);
}

.central-app-navigation-panel[hidden] { display: none; }

.central-app-navigation-panel a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: .8rem;
  font-weight: 800;
}

.central-app-navigation-panel a:hover,
.central-app-navigation-panel a:focus-visible {
  background: var(--tint);
}

.public-footer-wrap,
.public-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
  flex-wrap: wrap;
}

.public-footer-links a {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
}

.public-footer-links a:hover,
.public-footer-links a:focus-visible { color: var(--text); }

.central-push-control {
  display: grid;
  justify-items: end;
  gap: .35rem;
  margin-left: auto;
  text-align: right;
}

.central-push-toggle {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.central-push-toggle:disabled { cursor: wait; opacity: .65; }

.central-push-status {
  max-width: 24rem;
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.4;
}

.central-push-prompt {
  position: fixed;
  z-index: 1200;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  width: min(430px, calc(100vw - 36px));
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 22px 65px rgba(0, 0, 0, .24);
  color: var(--text);
}

.central-push-prompt-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.15rem;
}

.central-push-prompt-copy strong { display: block; margin-bottom: 4px; font-size: 1rem; }
.central-push-prompt-copy p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.central-push-prompt-actions { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; }

.central-push-prompt-actions button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
}

.central-push-prompt-actions .central-push-prompt-enable {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.central-push-prompt-actions button:disabled { cursor: wait; opacity: .7; }

.central-livestream-presence {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: 999px;
  background: var(--tint);
  color: var(--text);
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

.central-livestream-presence::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, .13);
}

.central-livestream-presence.is-compact {
  position: absolute;
  z-index: 4;
  right: 9px;
  bottom: 9px;
  min-height: 26px;
  padding: 4px 8px;
  border-color: rgba(255, 255, 255, .28);
  background: rgba(24, 24, 27, .86);
  color: #fff;
  backdrop-filter: blur(8px);
}

.central-livestream-presence[hidden] { display: none; }

@media (max-width: 760px) {
  .view > footer.public-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px 16px;
    padding: 22px 0 8px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    flex-wrap: wrap;
    text-align: center;
  }

  .central-app-navigation,
  .wayfinder-chat-root,
  .central-push-prompt {
    bottom: calc(var(--central-mobile-nav-height, 70px) + 12px + env(safe-area-inset-bottom));
  }

  .central-app-navigation {
    bottom: calc(var(--central-mobile-nav-height, 70px) + 12px + env(safe-area-inset-bottom) + var(--central-push-prompt-offset, 0px));
  }

  .central-push-prompt {
    right: max(88px, calc(env(safe-area-inset-right) + 74px));
    left: max(12px, env(safe-area-inset-left));
    width: auto;
  }
}

@media (max-width: 520px) {
  .central-push-prompt-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .wayfinder-chat-root.is-open { bottom: 0; }
}
