/* Pulse Push — front-end prompt, bell and button. */
.pulse-push-prompt,
.pulse-push-bell {
	--pp-accent: var(--pulse-push-accent, #2563eb);
	--pp-bg: #ffffff;
	--pp-fg: #111827;
	--pp-muted: #4b5563;
	--pp-border: rgba(17, 24, 39, 0.08);
	--pp-shadow: 0 12px 32px rgba(17, 24, 39, 0.18), 0 2px 6px rgba(17, 24, 39, 0.08);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--pp-fg);
	box-sizing: border-box;
}

.pulse-push-prompt *,
.pulse-push-bell * {
	box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
	.pulse-push-prompt,
	.pulse-push-bell {
		--pp-bg: #1f2937;
		--pp-fg: #f9fafb;
		--pp-muted: #d1d5db;
		--pp-border: rgba(255, 255, 255, 0.08);
		--pp-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
	}
}

/* Slide-in prompt */
.pulse-push-prompt {
	position: fixed;
	left: 50%;
	z-index: 2147483000;
	width: min(440px, calc(100vw - 24px));
	padding: 18px 18px 14px;
	background: var(--pp-bg);
	border: 1px solid var(--pp-border);
	border-radius: 14px;
	box-shadow: var(--pp-shadow);
	opacity: 0;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.pulse-push-prompt--top {
	top: 12px;
	transform: translate(-50%, -24px);
}

.pulse-push-prompt--bottom {
	bottom: 12px;
	transform: translate(-50%, 24px);
}

.pulse-push-prompt.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

.pulse-push-prompt__body {
	display: flex;
	gap: 14px;
	align-items: flex-start;
}

.pulse-push-prompt__icon {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	border-radius: 10px;
	object-fit: cover;
}

.pulse-push-icon-fallback {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	background: var(--pp-accent);
}

.pulse-push-prompt__title {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 600;
	color: var(--pp-fg);
}

.pulse-push-prompt__message {
	margin: 0;
	color: var(--pp-muted);
}

.pulse-push-prompt__actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 14px;
}

.pulse-push-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 8px 16px;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	transition: filter 0.15s ease, background-color 0.15s ease;
}

.pulse-push-btn:focus-visible,
.pulse-push-bell__button:focus-visible,
.pulse-push-bell__close:focus-visible {
	outline: 2px solid var(--pp-accent);
	outline-offset: 2px;
}

.pulse-push-btn--primary {
	color: #fff;
	background: var(--pp-accent);
}

.pulse-push-btn--primary:hover {
	filter: brightness(1.08);
}

.pulse-push-btn--primary:disabled {
	opacity: 0.6;
	cursor: default;
}

.pulse-push-btn--ghost {
	color: var(--pp-muted);
	background: transparent;
}

.pulse-push-btn--ghost:hover {
	background: var(--pp-border);
}

@media (max-width: 600px) {
	.pulse-push-prompt--top,
	.pulse-push-prompt--bottom {
		top: auto;
		bottom: 0;
		width: 100vw;
		border-radius: 14px 14px 0 0;
		transform: translate(-50%, 100%);
		padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
	}

	.pulse-push-prompt .pulse-push-btn {
		flex: 1;
	}
}

/* Bell */
.pulse-push-bell {
	position: fixed;
	bottom: 20px;
	z-index: 2147482999;
}

.pulse-push-bell--bottom-right {
	right: 20px;
}

.pulse-push-bell--bottom-left {
	left: 20px;
}

.pulse-push-bell__button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	color: var(--pp-accent);
	background: var(--pp-bg);
	border: 2px solid var(--pp-accent);
	border-radius: 50%;
	box-shadow: var(--pp-shadow);
	cursor: pointer;
	transition: transform 0.15s ease;
}

.pulse-push-bell__button:hover {
	transform: scale(1.06);
}

.pulse-push-bell.is-subscribed .pulse-push-bell__button {
	color: #fff;
	background: var(--pp-accent);
}

.pulse-push-bell__panel {
	position: absolute;
	bottom: 64px;
	width: 260px;
	padding: 16px;
	background: var(--pp-bg);
	border: 1px solid var(--pp-border);
	border-radius: 12px;
	box-shadow: var(--pp-shadow);
}

.pulse-push-bell__panel[hidden] {
	display: none;
}

.pulse-push-bell--bottom-right .pulse-push-bell__panel {
	right: 0;
}

.pulse-push-bell--bottom-left .pulse-push-bell__panel {
	left: 0;
}

.pulse-push-bell__status {
	margin: 0 20px 12px 0;
	color: var(--pp-fg);
}

.pulse-push-bell__panel .pulse-push-btn {
	width: 100%;
}

.pulse-push-bell__panel .pulse-push-btn[hidden] {
	display: none;
}

.pulse-push-bell__close {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 28px;
	height: 28px;
	padding: 0;
	font-size: 20px;
	line-height: 1;
	color: var(--pp-muted);
	background: transparent;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
}

/* Shortcode button: inherits theme button styles; only hide until ready. */
.pulse-push-toggle[hidden] {
	display: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.pulse-push-prompt,
	.pulse-push-bell__button {
		transition: none;
	}
}

@media print {
	.pulse-push-prompt,
	.pulse-push-bell {
		display: none !important;
	}
}
