/*!
 * AVBJ KikiPay In-Site Anchor Modal
 * Brand Rose (#e11d48) + Champagne Gold (#d4af37), Light & Dark (body.night), zero blur.
 */

/* --- 2. In-Site Waiting Modal (zero blur for 0ms open & smooth GPU) --- */
body.avbj-kk-modal-open {
	overflow: hidden;
}
.avbj-kk-modal {
	position: fixed;
	inset: 0;
	z-index: 100060;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Noto Sans KR", sans-serif;
}
.avbj-kk-modal.is-open {
	display: flex;
}
.avbj-kk-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, .68);
}
.avbj-kk-dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 468px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	background: #ffffff;
	border-radius: 18px;
	border: 1px solid rgba(212, 175, 55, .28);
	box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
	padding: 20px 22px 22px;
	box-sizing: border-box;
	color: #0f172a;
}

.avbj-kk-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}
.avbj-kk-head-left {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}
.avbj-kk-brand-icon {
	flex-shrink: 0;
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.avbj-kk-brand-icon[hidden] {
	display: none !important;
}
.avbj-kk-title {
	margin: 0 0 3px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
	color: #0f172a;
}
.avbj-kk-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	color: #9f1239;
	background: linear-gradient(135deg, rgba(225, 29, 72, .10), rgba(212, 175, 55, .18));
	border: 1px solid rgba(212, 175, 55, .36);
}
#avbj-kk-modal .avbj-kk-close {
	flex-shrink: 0;
	width: 38px;
	height: 38px;
	border: none;
	border-radius: 50%;
	background: #f1f5f9 !important;
	color: #475569 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	cursor: pointer;
	padding: 0;
	transition: background-color .14s ease, color .14s ease;
}
#avbj-kk-modal .avbj-kk-close:hover {
	background: #e2e8f0 !important;
	color: #0f172a !important;
}

/* Summary Strip */
.avbj-kk-summary {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	padding: 13px 15px;
	border-radius: 12px;
	background: #faf8f5;
	border: 1px solid rgba(212, 175, 55, .30);
	margin-bottom: 16px;
}
.avbj-kk-summary-item {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}
.avbj-kk-summary-item.is-right {
	text-align: right;
	align-items: flex-end;
}
.avbj-kk-summary-item .k {
	font-size: 11.5px;
	color: #64748b;
	font-weight: 500;
}
.avbj-kk-summary-item .v {
	font-size: 19px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.01em;
}
.avbj-kk-summary-item .v.is-cny {
	color: #e11d48;
}
.avbj-kk-summary-item .v.is-pts {
	color: #0f172a;
	font-size: 16px;
}
.avbj-kk-summary-item .sub {
	font-size: 11.5px;
	color: #64748b;
}
.avbj-kk-summary-item .sub.is-timer {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-weight: 700;
	color: #b45309;
}
.avbj-kk-summary-item .sub.is-timer.is-warn {
	color: #d97706;
}
.avbj-kk-summary-item .sub.is-timer.is-expired {
	color: #dc2626;
}

/* Loading & Error States */
.avbj-kk-loading {
	padding: 28px 12px;
	text-align: center;
}
.avbj-kk-loading[hidden],
.avbj-kk-error[hidden],
.avbj-kk-ready[hidden] {
	display: none !important;
}
.avbj-kk-spinner {
	display: inline-block;
	width: 34px;
	height: 34px;
	border: 3px solid rgba(225, 29, 72, .16);
	border-top-color: #e11d48;
	border-radius: 50%;
	animation: avbj-kk-spin .75s linear infinite;
	margin-bottom: 12px;
}
@keyframes avbj-kk-spin {
	to { transform: rotate(360deg); }
}
.avbj-kk-loading-title {
	margin: 0 0 6px;
	font-size: 14.5px;
	font-weight: 600;
	color: #0f172a;
}
.avbj-kk-loading-sub {
	margin: 0;
	font-size: 12.5px;
	color: #64748b;
}

.avbj-kk-error {
	padding: 20px 10px 8px;
	text-align: center;
}
.avbj-kk-error > i {
	font-size: 34px;
	color: #e11d48;
	display: block;
	margin-bottom: 8px;
}
.avbj-kk-error > p {
	margin: 0 0 16px;
	font-size: 13.5px;
	color: #334155;
	line-height: 1.5;
}
.avbj-kk-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}
.avbj-kk-btn-primary,
.avbj-kk-btn-secondary {
	border-radius: 10px;
	padding: 9px 16px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	border: none;
}
.avbj-kk-btn-primary {
	background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
	color: #ffffff;
}
.avbj-kk-btn-secondary {
	background: #f1f5f9;
	color: #334155;
	border: 1px solid #cbd5e1;
}

/* Ready / Waiting Guide Card */
.avbj-kk-guide-card {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 13px 14px;
	border-radius: 12px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	margin-bottom: 14px;
}
.avbj-kk-guide-card.is-blocked {
	background: #fffbeb;
	border-color: #f59e0b;
}
.avbj-kk-guide-icon {
	flex-shrink: 0;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: rgba(225, 29, 72, .10);
	color: #e11d48;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 17px;
	margin-top: 1px;
}
.avbj-kk-guide-card.is-blocked .avbj-kk-guide-icon {
	background: rgba(245, 158, 11, .16);
	color: #d97706;
}
.avbj-kk-guide-copy strong {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: #0f172a;
	margin-bottom: 4px;
}
.avbj-kk-guide-copy p {
	margin: 0;
	font-size: 12.5px;
	color: #475569;
	line-height: 1.5;
}

/* Primary Cashier CTA */
.avbj-kk-primary-wrap {
	margin-bottom: 14px;
}
.avbj-kk-open-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 12px 16px;
	border-radius: 12px;
	text-decoration: none !important;
	font-size: 14.5px;
	font-weight: 700;
	color: #ffffff !important;
	background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
	box-shadow: 0 8px 20px rgba(225, 29, 72, .24);
	box-sizing: border-box;
	transition: transform .12s ease, opacity .12s ease;
}
.avbj-kk-open-btn:hover {
	opacity: .94;
	color: #ffffff !important;
}
.avbj-kk-open-btn:active {
	transform: scale(.99);
}

/* Polling Status Pill */
.avbj-kk-status {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 10px 13px;
	border-radius: 10px;
	font-size: 12.5px;
	font-weight: 600;
	margin-bottom: 12px;
	background: #f1f5f9;
	color: #334155;
}
.avbj-kk-status-dot {
	flex-shrink: 0;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #d4af37;
	animation: avbj-kk-pulse 1.5s ease-in-out infinite;
}
@keyframes avbj-kk-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: .4; transform: scale(.82); }
}
.avbj-kk-status.is-paying {
	background: #fffbeb;
	color: #b45309;
}
.avbj-kk-status.is-paying .avbj-kk-status-dot {
	background: #f59e0b;
}
.avbj-kk-status.is-paid {
	background: #ecfdf5;
	color: #047857;
}
.avbj-kk-status.is-paid .avbj-kk-status-dot {
	background: #10b981;
	animation: none;
}
.avbj-kk-status.is-error {
	background: #fef2f2;
	color: #b91c1c;
}
.avbj-kk-status.is-error .avbj-kk-status-dot {
	background: #ef4444;
	animation: none;
}
.avbj-kk-status-text {
	flex: 1;
	min-width: 0;
}
.avbj-kk-regen-btn {
	flex-shrink: 0;
	border: none;
	border-radius: 7px;
	padding: 5px 10px;
	font-size: 12px;
	font-weight: 600;
	background: #e11d48;
	color: #fff;
	cursor: pointer;
}
.avbj-kk-regen-btn[hidden] {
	display: none !important;
}

.avbj-kk-foot-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	font-size: 11.5px;
	color: #64748b;
	padding-top: 8px;
	border-top: 1px solid #f1f5f9;
}
.avbj-kk-foot-meta code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 11.5px;
	color: #334155;
	background: #f1f5f9;
	padding: 1px 5px;
	border-radius: 4px;
}


/* VPN / Proxy Notice Tip */
.avbj-kk-vpn-tip {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 9px 12px;
	margin-bottom: 14px;
	border-radius: 10px;
	background: #fffbeb;
	border: 1px solid rgba(217, 119, 6, .28);
	color: #92400e;
	font-size: 12px;
	line-height: 1.5;
}
.avbj-kk-vpn-tip i {
	flex-shrink: 0;
	font-size: 15px;
	color: #d97706;
	margin-top: 1px;
}
body.night .avbj-kk-vpn-tip {
	background: rgba(245, 158, 11, .11);
	border-color: rgba(245, 158, 11, .32);
	color: #fde68a;
}
body.night .avbj-kk-vpn-tip i {
	color: #fbbf24;
}

/* --- 3. Dark Mode (body.night) --- */
body.night .avbj-kk-dialog {
	background: #181922;
	border-color: rgba(212, 175, 55, .28);
	color: #f8fafc;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
body.night .avbj-kk-title {
	color: #f8fafc;
}
body.night .avbj-kk-badge {
	color: #f5d08a;
	background: linear-gradient(135deg, rgba(225, 29, 72, .22), rgba(212, 175, 55, .18));
	border-color: rgba(212, 175, 55, .36);
}
body.night #avbj-kk-modal .avbj-kk-close {
	background: rgba(255, 255, 255, .10) !important;
	color: #cbd5e1 !important;
}
body.night #avbj-kk-modal .avbj-kk-close:hover {
	background: rgba(255, 255, 255, .16) !important;
	color: #ffffff !important;
}
body.night .avbj-kk-summary {
	background: #22232f;
	border-color: rgba(212, 175, 55, .22);
}
body.night .avbj-kk-summary-item .k,
body.night .avbj-kk-summary-item .sub {
	color: #94a3b8;
}
body.night .avbj-kk-summary-item .v.is-cny {
	color: #fb7185;
}
body.night .avbj-kk-summary-item .v.is-pts {
	color: #f8fafc;
}
body.night .avbj-kk-summary-item .sub.is-timer {
	color: #f5d08a;
}
body.night .avbj-kk-loading-title {
	color: #f8fafc;
}
body.night .avbj-kk-loading-sub,
body.night .avbj-kk-error > p {
	color: #cbd5e1;
}
body.night .avbj-kk-btn-secondary {
	background: #252736;
	color: #e2e8f0;
	border-color: rgba(255, 255, 255, .14);
}
body.night .avbj-kk-guide-card {
	background: #22232f;
	border-color: rgba(255, 255, 255, .09);
}
body.night .avbj-kk-guide-card.is-blocked {
	background: rgba(245, 158, 11, .12);
	border-color: rgba(245, 158, 11, .45);
}
body.night .avbj-kk-guide-copy strong {
	color: #f8fafc;
}
body.night .avbj-kk-guide-copy p {
	color: #cbd5e1;
}
body.night .avbj-kk-status {
	background: #22232f;
	color: #e2e8f0;
}
body.night .avbj-kk-status.is-paying {
	background: rgba(245, 158, 11, .14);
	color: #fcd34d;
}
body.night .avbj-kk-status.is-paid {
	background: rgba(16, 185, 129, .16);
	color: #6ee7b7;
}
body.night .avbj-kk-status.is-error {
	background: rgba(239, 68, 68, .16);
	color: #fca5a5;
}
body.night .avbj-kk-foot-meta {
	color: #94a3b8;
	border-top-color: rgba(255, 255, 255, .08);
}
body.night .avbj-kk-foot-meta code {
	background: #252736;
	color: #e2e8f0;
}


.avbj-kk-vpn-q {
	flex-shrink: 0;
	font-size: 13px;
	line-height: 1.45;
}
/* --- 4. Mobile Optimization --- */
@media (max-width: 640px) {
	#avbj-kk-modal .avbj-kk-close {
		width: 42px;
		height: 42px;
		font-size: 22px;
	}
	.avbj-kk-modal {
		padding: 12px;
		align-items: flex-end;
	}
	.avbj-kk-dialog {
		padding: 18px 16px 20px;
		border-radius: 18px 18px 14px 14px;
		max-height: calc(100vh - 24px);
	}
	.avbj-kk-summary {
		padding: 11px 12px;
	}
	.avbj-kk-summary-item .v {
		font-size: 17px;
	}
	.avbj-kk-foot-meta {
		flex-direction: column;
		align-items: flex-start;
	}
}
