/* Overlay */
#app-popup-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 9999;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 0;
	animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes slideUp {
	from { transform: translateY(100%); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

/* Popup card */
#app-popup {
	background: #fff;
	border-radius: 20px 20px 0 0;
	padding: 2rem 1.75rem 2.5rem;
	width: 100%;
	max-width: 480px;
	text-align: center;
	position: relative;
	animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Drag handle */
#app-popup::before {
	content: '';
	display: block;
	width: 40px;
	height: 4px;
	background: #e0e0e0;
	border-radius: 2px;
	margin: 0 auto 1.5rem;
}

/* Close button */
#app-popup-close {
	position: absolute;
	top: 1.25rem;
	right: 1.25rem;
	background: #f5f5f5;
	border: none;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 14px;
	color: #666;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}
#app-popup-close:hover { background: #ebebeb; }

/* App icon */
#app-popup-icon {
	width: 80px;
	height: 80px;
	border-radius: 20px;
	margin: 0 auto 1rem;
	overflow: hidden;
	box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
#app-popup-icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Text */
#app-popup-title {
	font-size: 20px;
	font-weight: 600;
	margin: 0 0 6px;
	color: #111;
}
#app-popup-desc {
	font-size: 14px;
	color: #666;
	margin: 0 0 1.5rem;
	line-height: 1.5;
}

/* Badges */
#app-popup-badges {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
	margin-bottom: 1rem;
}
#app-popup-badges a {
	display: inline-block;
	border: none;
}
#app-popup-badges img {
	height: 52px;
	display: block;
}

/* Fallback styled button */
.app-store-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: #111;
	color: #fff;
	text-decoration: none;
	padding: 10px 20px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 500;
}

#app-popup-note {
	font-size: 12px;
	color: #aaa;
	margin: 0;
}

/* Desktop: centered modal instead of bottom sheet */
@media (min-width: 600px) {
	#app-popup-overlay {
		align-items: center;
	}
	#app-popup {
		border-radius: 20px;
		max-width: 380px;
		padding: 2rem 2rem 2.5rem;
	}
	#app-popup::before { display: none; }
}


/* Header */
* { box-sizing: border-box; margin: 0; padding: 0; }

.app-top-banner {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.09);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 52px;
  gap: 16px;
  overflow: hidden;
  transition: height .3s ease, opacity .25s ease;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 1000;
}
.app-top-banner.is-hidden {
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.atb-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.atb-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #222;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.atb-icon svg { width: 17px; height: 17px; }
.atb-title { font-size: 13px; color: #555; white-space: nowrap; }
.atb-title strong { color: #111; font-weight: 600; }

.atb-center {
  display: flex; align-items: center; gap: 10px;
  flex: 1; justify-content: center;
}

.atb-badge {
  display: inline-flex; align-items: center;
  text-decoration: none; cursor: pointer;
  transition: opacity .15s;
  border-radius: 6px;
  overflow: hidden;
}
.atb-badge:hover { opacity: .8; }
.atb-badge img { height: 36px; display: block; }

.atb-sep {
  width: 1px; height: 24px;
  background: rgba(0,0,0,.1);
  flex-shrink: 0;
}

.atb-right {
  display: flex; align-items: center;
  flex-shrink: 0;
}

.atb-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  color: #999;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.atb-close:hover { background: #f4f4f4; color: #333; }

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 58px;
  background: #fff; border-bottom: 1px solid rgba(0,0,0,.08);
}
.site-logo { font-size: 16px; font-weight: 600; color: #111; display: flex; align-items: center; gap: 8px; }
.site-logo-dot { width: 8px; height: 8px; border-radius: 50%; background: #5B5BD6; }
.site-nav { display: flex; gap: 2px; }
.site-nav a { font-size: 14px; color: #666; text-decoration: none; padding: 6px 12px; border-radius: 7px; }
.site-nav a:hover { background: #f4f4f4; color: #111; }
.site-header-btn { font-size: 13px; padding: 7px 16px; border-radius: 8px; background: #111; color: #fff; border: none; cursor: pointer; font-weight: 500; }

.site-body { height: 130px; background: #f8f8f8; display: flex; align-items: center; justify-content: center; }
.site-body p { font-size: 13px; color: #ccc; }

.demo-wrap { border: 0.5px solid var(--color-border-tertiary); border-radius: var(--border-radius-lg); overflow: hidden; }

.restore-wrap { padding: 10px 0 0; display: none; }
.restore-wrap.visible { display: block; }
.restore-btn {
  font-size: 12px; color: var(--color-text-secondary);
  background: none; border: 0.5px solid var(--color-border-tertiary);
  border-radius: 6px; padding: 5px 12px; cursor: pointer; font-family: inherit;
}
.restore-btn:hover { background: var(--color-background-secondary); }

.badge-placeholder {
  height: 36px;
  border-radius: 6px;
  border: 1px dashed rgba(0,0,0,.2);
  display: flex; align-items: center; justify-content: center;
  padding: 0 14px; font-size: 11px; color: #aaa;
}
@media (max-width: 992px) {
	.atb-left {
		display: none;
	}
	.atb-center {
		justify-content: start;
	}
}