.qhz-redeem {
	--qhz-redeem-blue: #0f367a;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(300px, 460px);
	gap: 24px;
	margin-top: 28px;
	padding: 26px;
	align-items: center;
	border: 1px solid #d8e3f2;
	border-radius: 18px;
	background: #f8fafc;
}

.qhz-redeem h2 { margin: 0; color: #0a2540; }
.qhz-redeem__intro > p:last-child { margin: 6px 0 0; color: #64748b; line-height: 1.65; }
.qhz-redeem-eyebrow { margin: 0 0 4px; color: var(--qhz-redeem-blue); font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.qhz-redeem input { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: 12px; font: inherit; }
.qhz-redeem button,
.qhz-redeem-action { display: inline-flex; min-height: 46px; padding: 0 24px; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: #0b5fff; color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.qhz-redeem-result { grid-column: 1 / -1; margin: 0; color: #475569; }
.qhz-redeem-result:empty { display: none; }

.qhz-redeem form {
	min-width: 0;
	align-items: start;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
}

.qhz-redeem-code {
	align-items: center;
	border: 0;
	display: grid;
	gap: 8px;
	grid-auto-columns: minmax(0, 1fr);
	grid-auto-flow: column;
	margin: 0;
	min-width: 0;
	padding: 0;
}

.qhz-redeem form > button {
	grid-column: 2;
	grid-row: 1;
}

.qhz-redeem-code input {
	box-sizing: border-box;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: .02em;
	min-width: 0;
	padding-inline: 6px;
	text-align: center;
	text-transform: none;
}

.qhz-redeem-code span {
	color: #8a96a8;
}

.qhz-redeem-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 0 14px;
	border: 1px solid rgba(15, 54, 122, .24);
	border-radius: 7px;
	color: #0f367a;
	background: #fff;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.qhz-redeem-trigger:hover {
	color: #fff;
	border-color: #0f367a;
	background: #0f367a;
}

.qhz-redeem-trigger:focus-visible,
.qhz-redeem-dialog__close:focus-visible,
.qhz-redeem--dialog :where(input, button):focus-visible {
	outline: 3px solid rgba(4, 75, 199, .28);
	outline-offset: 3px;
}

.qhz-redeem-dialog[hidden] { display: none !important; }

.qhz-redeem-dialog {
	position: fixed;
	inset: var(--qhz-redeem-viewport-top, 0px) 0 auto;
	box-sizing: border-box;
	width: 100%;
	height: 100vh;
	height: var(--qhz-redeem-viewport-height, 100dvh);
	z-index: 100100;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: minmax(0, 1fr);
	place-items: center;
	overflow: hidden;
	overscroll-behavior: contain;
	padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.qhz-redeem-dialog__backdrop {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background: rgba(7, 20, 43, .48);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	cursor: default;
}

.qhz-redeem-dialog__panel {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	width: 100%;
	max-width: 440px;
	min-width: 0;
	max-height: 100%;
	overflow: auto;
	overscroll-behavior: contain;
	padding: 22px;
	border: 1px solid rgba(15, 54, 122, .12);
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 18px 54px rgba(7, 20, 43, .18);
}

.qhz-redeem-dialog__close {
	position: sticky;
	top: 0;
	grid-column: 1;
	grid-row: 1;
	align-self: start;
	justify-self: end;
	margin: -10px -10px 0 0;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 7px;
	color: #53627a;
	background: #fff;
	font: 24px/1 sans-serif;
	cursor: pointer;
}
.qhz-redeem-dialog__close:hover { background: #f2f5fa; color: #0f367a; }

.qhz-redeem--dialog {
	display: grid;
	grid-column: 1;
	grid-row: 1;
	grid-template-columns: minmax(0, 1fr);
	min-width: 0;
	gap: 16px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
}

.qhz-redeem--dialog > .qhz-redeem__intro { padding-right: 38px; }
.qhz-redeem--dialog .qhz-redeem-eyebrow { margin-bottom: 3px; font-size: 11px; letter-spacing: .1em; }
.qhz-redeem--dialog h2 { font-size: 20px; line-height: 1.4; color: #0f367a; }
.qhz-redeem--dialog .qhz-redeem__intro > p:last-child { font-size: 13px; }
.qhz-redeem--dialog form { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; }
.qhz-redeem--dialog form > button { grid-column: 2; grid-row: 1; justify-self: end; min-height: 44px; padding: 0 14px; border-radius: 7px; background: #0f54c7; font-size: 13px; white-space: nowrap; }
.qhz-redeem--dialog .qhz-redeem-code { width: 100%; gap: 5px; }
.qhz-redeem--dialog .qhz-redeem-code input { min-height: 44px; padding-inline: 10px; border-color: #cbd7e8; border-radius: 7px; background: #fbfcfe; color: #18345c; font-size: 16px; }
.qhz-redeem--dialog .qhz-redeem-code input:focus-visible { border-color: #507cbf; outline-width: 2px; outline-offset: 2px; }
.qhz-redeem-code [data-qhz-redeem-input] { width: 100%; min-width: 0; text-align: left; font-weight: 500; letter-spacing: .025em; }
.qhz-redeem-code [data-qhz-redeem-input]::placeholder { color: #8290a4; font-family: inherit; font-size: 14px; font-weight: 400; letter-spacing: 0; opacity: 1; }
.qhz-redeem-code [data-qhz-redeem-input] { grid-column: 1; grid-row: 1; }
.qhz-redeem-input-error { grid-column: 1; grid-row: 2; margin: 0; color: #a91d29; font-size: 12px; font-weight: 400; line-height: 1.5; overflow-wrap: anywhere; }
.qhz-redeem-input-error[hidden] { display: none !important; }
.qhz-redeem--dialog .qhz-redeem-code input[aria-invalid="true"] { border-color: #bc4250; outline-color: rgba(169, 29, 41, .2); }
.qhz-redeem--dialog .qhz-redeem-code span { color: #a3adbb; font-size: 12px; }
.qhz-redeem--dialog .qhz-redeem-result { min-height: 18px; font-size: 13px; line-height: 1.55; }
.qhz-redeem--dialog > :where(.qhz-academy-success,.qhz-academy-notice,.qhz-academy-error) { margin: 0; padding: 10px 12px; border: 1px solid #dbe5ee; border-radius: 8px; font-size: 13px; line-height: 1.55; }
.qhz-redeem--dialog > .qhz-academy-success { padding: 0; border: 0; border-radius: 0; background: transparent; color: #34455f; }
.qhz-redeem--dialog > .qhz-academy-success:focus { outline: none; }
.qhz-redeem--dialog > .qhz-academy-notice { background: #f8fafc; color: #53627a; }
.qhz-redeem--dialog > .qhz-academy-error { border-color: #efc8cc; background: #fff5f5; color: #a91d29; }
.qhz-redeem--dialog > .qhz-academy-success p { margin: 0; color: #557064; font-size: 13px; font-weight: 400; }
.qhz-redeem .qhz-redeem-success-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.qhz-redeem .qhz-redeem-success-list > li { margin: 0; padding: 0; list-style: none; }
.qhz-redeem .qhz-redeem-success-list > li + li { padding-top: 12px; border-top: 1px solid #e5eaf1; }
.qhz-redeem .qhz-redeem-success-details { display: grid; gap: 6px; margin: 0; font-size: 14px; line-height: 1.65; }
.qhz-redeem .qhz-redeem-success-details > div { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: start; column-gap: 4px; }
.qhz-redeem .qhz-redeem-success-details dt { margin: 0; color: #64748b; font-weight: 400; white-space: nowrap; }
.qhz-redeem .qhz-redeem-success-details dd { min-width: 0; margin: 0; color: #34455f; overflow-wrap: anywhere; }
.qhz-redeem .qhz-redeem-success-details strong { color: #18345c; font-weight: 600; }
.qhz-redeem--dialog[data-qhz-redeem-status="success"] > form,
.qhz-redeem--dialog[data-qhz-redeem-status="success"] > .qhz-redeem-result { display: none; }
.qhz-redeem--dialog[data-qhz-redeem-status="success"] { gap: 14px; }

body.qhz-redeem-dialog-open { overflow: hidden; }
body.qhz-redeem-dialog-open .mobile-bar { display: none !important; }

@media (max-width: 520px) {
	.qhz-redeem { grid-template-columns: minmax(0, 1fr); padding: 20px; }
	.qhz-redeem-action { width: 100%; }
	.qhz-redeem form {
		grid-template-columns: minmax(0, 1fr);
	}

	.qhz-redeem form > button {
		grid-column: 1;
		grid-row: auto;
	}

	.qhz-redeem-code {
		gap: 4px;
	}

	.qhz-redeem-code input {
		padding-inline: 4px;
	}

	.qhz-redeem-code span {
		display: none;
	}

	.qhz-redeem-dialog__panel {
		padding: 22px 18px;
	}

	.qhz-redeem--dialog { padding: 0; }
	.qhz-redeem--dialog > .qhz-redeem__intro { padding-right: 40px; }
	.qhz-redeem--dialog form { grid-template-columns: minmax(0,1fr); }
	.qhz-redeem--dialog form > button { width: auto; min-width: 100px; }
	.qhz-redeem--dialog form > button { grid-column: 1; grid-row: auto; }
	.qhz-redeem--dialog .qhz-redeem-code { gap: 6px; }
	.qhz-redeem--dialog .qhz-redeem-code input { min-height: 44px; padding-inline: 10px; font-size: 16px; }
	.qhz-redeem-dialog__close { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
	.qhz-redeem-trigger { transition: none; }
}
