/*
 * GoEast Chinese Name Generator — Page-specific styles
 * Loaded ONLY on /chinese-name-generator/ (enqueued by shortcode presence check)
 * ──────────────────────────────────────────────────────────────────────────────
 */

/* ── Custom properties (GoEast brand palette) ──────────────────────────────── */
:root {
	--cng-primary:       #f15a65;
	--cng-primary-dark:  #d94a55;
	--cng-secondary:     #ff674d;
	--cng-text:          #2d2d2d;
	--cng-text-light:    #666;
	--cng-bg:            #ffffff;
	--cng-bg-alt:        #f9f9f9;
	--cng-border:        #e5e5e5;
	--cng-shadow:        0 2px 12px rgba(0, 0, 0, 0.08);
	--cng-shadow-hover:  0 6px 24px rgba(241, 90, 101, 0.18);
	--cng-radius:        8px;
	--cng-radius-lg:     12px;
	--cng-chinese-font:  'Noto Serif SC', 'SimSun', serif;
	--cng-transition:    0.18s ease;
}

/* ── Hero section (inside tool) ────────────────────────────────────────────── */
.cng-hero {
	text-align: center;
	margin-bottom: 24px;
}

.cng-hero-title {
	font-size: clamp(1.6rem, 4vw, 2.2rem);
	font-weight: 700;
	color: var(--cng-text);
	margin: 0 0 6px;
}

.cng-hero-subtitle {
	font-size: 1rem;
	color: var(--cng-text-light);
	margin: 0;
	font-style: italic;
}

/* ── Trust line ────────────────────────────────────────────────────────────── */
.cng-trust-line {
	background: var(--cng-bg-alt);
	border-left: 3px solid var(--cng-primary);
	border-radius: 0 var(--cng-radius) var(--cng-radius) 0;
	padding: 12px 16px;
	margin-bottom: 20px;
}

.cng-trust-line p {
	margin: 0 0 4px;
	font-size: 0.84rem;
	color: var(--cng-text-light);
	line-height: 1.5;
}

.cng-trust-line p:last-child {
	margin-bottom: 0;
}

/* ── App container ─────────────────────────────────────────────────────────── */
#cng-app {
	max-width: 960px;
	margin: 0 auto;
	padding: 24px 16px 48px;
	color: var(--cng-text);
	font-size: 1rem;
	line-height: 1.6;
}

.cng-section {
	margin-bottom: 40px;
}

/* ── Input form ────────────────────────────────────────────────────────────── */
.cng-form-wrapper {
	background: var(--cng-bg-alt);
	border: 1px solid var(--cng-border);
	border-radius: var(--cng-radius-lg);
	padding: 28px 28px 24px;
}

.cng-form-row {
	display: flex;
	gap: 16px;
}

.cng-form-group {
	margin-bottom: 20px;
}

.cng-form-group--half {
	flex: 1 1 0;
	min-width: 0;
}

.cng-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--cng-text);
}

.cng-input,
.cng-select {
	width: 100%;
	padding: 10px 14px;
	border: 1.5px solid var(--cng-border);
	border-radius: var(--cng-radius);
	font-size: 1rem;
	color: var(--cng-text);
	background: var(--cng-bg);
	box-sizing: border-box;
	transition: border-color var(--cng-transition), box-shadow var(--cng-transition);
	-webkit-appearance: none;
	appearance: none;
}

.cng-select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 36px;
}

.cng-input:focus,
.cng-select:focus {
	outline: none;
	border-color: var(--cng-primary);
	box-shadow: 0 0 0 3px rgba(241, 90, 101, 0.12);
}

.cng-error-inline {
	color: #c0392b;
	font-size: 0.84rem;
	margin: 4px 0 0;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.cng-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 12px 24px;
	border: none;
	border-radius: var(--cng-radius);
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition:
		background var(--cng-transition),
		box-shadow var(--cng-transition),
		transform 0.1s ease,
		color var(--cng-transition);
	line-height: 1.4;
}

.cng-btn:active {
	transform: translateY(1px);
}

.cng-btn--primary {
	background: var(--cng-primary);
	color: #fff;
	width: 100%;
	font-size: 1.05rem;
	padding: 14px 24px;
	border-radius: var(--cng-radius);
}

.cng-btn--primary:hover,
.cng-btn--primary:focus-visible {
	background: var(--cng-primary-dark);
	box-shadow: var(--cng-shadow-hover);
	color: #fff;
}

.cng-btn--secondary {
	background: var(--cng-bg);
	color: var(--cng-text);
	border: 1.5px solid var(--cng-border);
}

.cng-btn--secondary:hover {
	background: var(--cng-bg-alt);
}

.cng-btn--back {
	background: transparent;
	color: var(--cng-primary);
	padding: 6px 0;
	font-size: 0.9rem;
	font-weight: 500;
	margin-bottom: 28px;
	border-bottom: 1px solid transparent;
}

.cng-btn--back:hover {
	border-bottom-color: var(--cng-primary);
}

.cng-btn--audio {
	background: #fff;
	color: var(--cng-primary);
	border: 2px solid var(--cng-primary);
	border-radius: 50px;
	padding: 10px 22px;
	margin-top: 12px;
	font-size: 0.95rem;
}

.cng-btn--audio:hover {
	background: var(--cng-primary);
	color: #fff;
}

.cng-btn--cta {
	background: var(--cng-primary);
	color: #fff;
	border-radius: 50px;
	padding: 14px 36px;
	font-size: 1.05rem;
	display: inline-flex;
}

.cng-btn--cta:hover {
	background: var(--cng-primary-dark);
	box-shadow: var(--cng-shadow-hover);
	color: #fff;
}

/* ── Loading state ─────────────────────────────────────────────────────────── */
.cng-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 72px 20px;
	gap: 20px;
}

.cng-spinner {
	width: 48px;
	height: 48px;
	border: 4px solid var(--cng-border);
	border-top-color: var(--cng-primary);
	border-radius: 50%;
	animation: cng-spin 0.75s linear infinite;
	flex-shrink: 0;
}

@keyframes cng-spin {
	to { transform: rotate(360deg); }
}

.cng-loading-text {
	color: var(--cng-text-light);
	font-size: 1.1rem;
	margin: 0;
	transition: opacity 0.28s ease;
}

/* ── Error block ───────────────────────────────────────────────────────────── */
.cng-error-block {
	background: #fff5f5;
	border: 1px solid #fca5a5;
	border-radius: var(--cng-radius);
	padding: 28px;
	text-align: center;
}

.cng-error-block p {
	color: #b91c1c;
	margin: 0 0 20px;
}

/* ── Results intro ─────────────────────────────────────────────────────────── */
.cng-results-intro {
	font-size: 0.95rem;
	color: var(--cng-text-light);
	margin: 0 0 16px;
}

/* ── Results grid ──────────────────────────────────────────────────────────── */
.cng-results-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
	margin-bottom: 20px;
}

@media (min-width: 600px) {
	.cng-results-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 900px) {
	.cng-results-grid {
		grid-template-columns: repeat(5, 1fr);
	}
}

/* ── Name card ─────────────────────────────────────────────────────────────── */
.cng-card {
	position: relative; /* needed for the "Our Pick" badge */
	background: var(--cng-bg);
	border: 2px solid var(--cng-border);
	border-radius: var(--cng-radius);
	padding: 18px 12px 14px;
	text-align: center;
	cursor: pointer;
	transition:
		border-color var(--cng-transition),
		box-shadow var(--cng-transition),
		transform var(--cng-transition),
		background var(--cng-transition);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 100%;
	box-sizing: border-box;
}

.cng-card:hover {
	border-color: var(--cng-primary);
	box-shadow: var(--cng-shadow-hover);
	transform: translateY(-3px);
}

.cng-card:focus-visible {
	outline: 3px solid var(--cng-primary);
	outline-offset: 2px;
}

.cng-card--selected {
	border-color: var(--cng-primary);
	background: #fff5f6;
	box-shadow: var(--cng-shadow-hover);
}

.cng-card-chinese {
	font-size: clamp(2rem, 5vw, 3.5rem);
	font-family: var(--cng-chinese-font);
	color: var(--cng-text);
	letter-spacing: 0.1em;
	line-height: 1.2;
	display: block;
}

.cng-card-pinyin {
	font-size: 0.78rem;
	color: var(--cng-text-light);
	display: block;
	letter-spacing: 0.02em;
}

.cng-card-meaning {
	font-size: 0.73rem;
	color: var(--cng-text-light);
	line-height: 1.4;
	/* Clamp to 2 lines */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cng-card-select {
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--cng-primary);
	display: block;
	margin-top: 6px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

/* "⭐ Our Pick" badge — top-right corner of the card */
.cng-card-top-pick {
	position: absolute;
	top: -1px;
	right: -1px;
	background: var(--cng-primary);
	color: #fff;
	font-size: 0.62rem;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 0 var(--cng-radius) 0 var(--cng-radius);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	line-height: 1.5;
	white-space: nowrap;
}

/* Slightly elevated top-pick card */
.cng-card--top-pick {
	border-color: var(--cng-primary);
	box-shadow: 0 4px 20px rgba(241, 90, 101, 0.18);
}

/* Phonetic bridge — the "why this sounds like you" line */
.cng-card-phonetic {
	font-size: 0.71rem;
	color: var(--cng-text-light);
	font-style: italic;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	line-height: 1.45;
}

/* ── Below-grid CTA ────────────────────────────────────────────────────────── */
.cng-results-cta {
	padding: 16px 20px;
	background: var(--cng-bg-alt);
	border-radius: var(--cng-radius);
	text-align: center;
	margin-top: 8px;
}

.cng-results-cta p {
	margin: 0;
	font-size: 0.95rem;
	color: var(--cng-text-light);
}

.cng-results-cta a {
	color: var(--cng-primary);
	text-decoration: none;
}

.cng-results-cta a:hover {
	text-decoration: underline;
}

/* ── "你的中文名字" hero label ───────────────────────────────────────────────── */
.cng-detail-hero-label {
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--cng-primary);
	margin: 0 0 8px;
}

/* ── Teacher's Note callout ────────────────────────────────────────────────── */
.cng-teacher-note {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	background: #fff5f6;
	border-left: 4px solid var(--cng-primary);
	border-radius: 0 var(--cng-radius) var(--cng-radius) 0;
	padding: 16px 20px;
	margin-top: 20px;
	text-align: left;
}

.cng-teacher-note-icon {
	font-size: 1.1rem;
	flex-shrink: 0;
	line-height: 1.6;
}

.cng-teacher-note p {
	margin: 0 0 8px;
	font-size: 0.9rem;
	line-height: 1.65;
	color: var(--cng-text);
}

.cng-teacher-note p:last-child {
	margin-bottom: 0;
}

/* Top pick extended explanation (inside teacher note) */
.cng-top-pick-reason {
	font-style: italic;
	color: var(--cng-text-light) !important;
	border-top: 1px solid var(--cng-border);
	padding-top: 8px;
	margin-top: 8px !important;
}

/* ── Detail panel ──────────────────────────────────────────────────────────── */
.cng-detail {
	border-top: 2px solid var(--cng-border);
	padding-top: 36px;
	scroll-margin-top: 24px;
}

/* Hero — large name display */
.cng-detail-hero {
	text-align: center;
	margin-bottom: 48px;
}

.cng-detail-chinese {
	font-size: clamp(3rem, 10vw, 5.5rem);
	font-family: var(--cng-chinese-font);
	color: var(--cng-text);
	letter-spacing: 0.18em;
	margin: 0 0 8px;
	line-height: 1.15;
	font-weight: 700;
}

.cng-detail-pinyin {
	font-size: 1.3rem;
	color: var(--cng-text-light);
	margin: 0 0 10px;
	letter-spacing: 0.04em;
}

.cng-detail-meaning {
	font-size: 1rem;
	color: var(--cng-text-light);
	font-style: italic;
	max-width: 500px;
	margin: 0 auto 16px;
	line-height: 1.6;
}

.cng-audio-fallback {
	font-size: 0.875rem;
	color: var(--cng-text-light);
	font-style: italic;
	margin-top: 8px;
}

/* ── Section headers ───────────────────────────────────────────────────────── */
.cng-detail-section {
	margin-bottom: 44px;
}

.cng-detail-section-title {
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--cng-text);
	margin: 0 0 20px;
	padding-bottom: 10px;
	border-bottom: 1.5px solid var(--cng-border);
}

/* ── Character breakdown ───────────────────────────────────────────────────── */
.cng-chars-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.cng-char-detail {
	display: flex;
	align-items: center;
	gap: 16px;
	background: var(--cng-bg-alt);
	border: 1px solid var(--cng-border);
	border-radius: var(--cng-radius);
	padding: 16px;
	flex: 1 1 200px;
	min-width: 180px;
}

/* hanzi-writer renders an SVG inside this element */
.cng-hanzi-canvas {
	width: 80px;
	height: 80px;
	flex-shrink: 0;
}

/* Fallback glyph (shown while hanzi-writer loads or if unsupported) */
.cng-char-fallback {
	width: 80px;
	height: 80px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 3rem;
	font-family: var(--cng-chinese-font);
	color: var(--cng-primary);
	flex-shrink: 0;
}

.cng-char-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cng-char-glyph {
	font-size: 2.4rem;
	font-family: var(--cng-chinese-font);
	color: var(--cng-text);
	line-height: 1;
}

.cng-char-meaning-text {
	font-size: 0.875rem;
	color: var(--cng-text-light);
	line-height: 1.5;
}

/* ── Surname recommendation ────────────────────────────────────────────────── */
.cng-surname-text {
	font-size: 1rem;
	margin: 0 0 8px;
}

.cng-surname-sub {
	font-size: 0.9rem;
	color: var(--cng-text-light);
	margin: 0;
}

/* ── Share card section ────────────────────────────────────────────────────── */
.cng-share-section {
	text-align: center;
}

/* The element html2canvas will capture */
.cng-share-card {
	display: inline-block;
	background: linear-gradient(140deg, #fff5f6 0%, #ffffff 60%);
	border: 2px solid var(--cng-primary);
	border-radius: var(--cng-radius-lg);
	padding: 32px 28px;
	margin-bottom: 20px;
	max-width: 380px;
	width: 100%;
	box-shadow: var(--cng-shadow);
	text-align: center;
}

.cng-share-label {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	color: var(--cng-primary);
	margin: 0 0 16px;
}

.cng-share-chinese {
	font-size: 3rem;
	font-family: var(--cng-chinese-font);
	color: var(--cng-text);
	letter-spacing: 0.18em;
	margin: 0 0 8px;
	line-height: 1.2;
	font-weight: 700;
}

.cng-share-pinyin {
	font-size: 1rem;
	color: var(--cng-text-light);
	margin: 0 0 12px;
	letter-spacing: 0.04em;
}

.cng-share-meaning {
	font-size: 0.84rem;
	color: var(--cng-text-light);
	font-style: italic;
	margin: 0 0 24px;
	line-height: 1.55;
}

.cng-share-footer {
	border-top: 1px solid var(--cng-border);
	padding-top: 14px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* Logo scaled to 28px tall (preserving 206×77 aspect ratio → ~75px wide) */
.cng-share-logo {
	height: 28px;
	width: auto;
	display: block;
}

.cng-share-url {
	font-size: 0.75rem;
	color: var(--cng-text-light);
}

/* ── Conversion CTA block ──────────────────────────────────────────────────── */
.cng-cta-block {
	background: linear-gradient(140deg, #fff5f6 0%, #fff 60%);
	border: 1px solid var(--cng-border);
	border-left: 4px solid var(--cng-primary);
	border-radius: var(--cng-radius);
	padding: 36px 32px;
	text-align: center;
	margin-top: 48px;
}

.cng-cta-title {
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--cng-text);
	margin: 0 0 12px;
}

.cng-cta-text {
	color: var(--cng-text-light);
	margin: 0 0 24px;
	max-width: 500px;
	margin-left: auto;
	margin-right: auto;
	line-height: 1.6;
}

/* ── Usage counter (social proof + remaining quota) ────────────────────────── */
.cng-counter {
	text-align: center;
	margin: -6px 0 18px;
}

/* Big social-proof line — "2,341 people have found their Chinese name · 11,705 names generated" */
.cng-counter-big {
	display: inline-flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 6px 10px;
	margin: 0 0 10px;
	padding: 10px 18px;
	background: #fff5f6;
	border: 1px solid rgba(241, 90, 101, 0.25);
	border-radius: 50px;
	font-size: 0.92rem;
	color: var(--cng-text);
	line-height: 1.4;
	max-width: 100%;
	box-sizing: border-box;
}

.cng-counter-stat {
	white-space: nowrap;
}

.cng-counter-stat strong {
	color: var(--cng-primary);
	font-weight: 700;
	font-size: 1.05em;
}

.cng-counter-stat--muted {
	color: var(--cng-text-light);
}

.cng-counter-sep {
	color: var(--cng-text-light);
	font-weight: 700;
	opacity: 0.5;
}

.cng-counter-row {
	display: flex;
	justify-content: center;
}

/* ── Soft invite banner (inline, dismissable) ──────────────────────────────── */
.cng-invite-banner {
	position: relative;
	background: linear-gradient(135deg, #fff8e8 0%, #fff0e0 100%);
	border: 1px solid #f5d5a8;
	border-radius: var(--cng-radius-lg);
	padding: 18px 22px;
	margin: 0 0 20px;
	box-shadow: 0 2px 10px rgba(241, 90, 101, 0.06);
}

.cng-invite-banner-close {
	position: absolute;
	top: 8px;
	right: 10px;
	background: transparent;
	border: none;
	font-size: 1.4rem;
	line-height: 1;
	color: var(--cng-text-light);
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 50%;
	transition: background 0.15s;
}

.cng-invite-banner-close:hover {
	background: rgba(0, 0, 0, 0.06);
	color: var(--cng-text);
}

.cng-invite-banner-body {
	display: flex;
	gap: 18px;
	align-items: center;
	flex-wrap: wrap;
}

.cng-invite-banner-copy {
	flex: 1 1 260px;
	min-width: 240px;
}

.cng-invite-banner-title {
	font-size: 1rem;
	font-weight: 700;
	color: var(--cng-text);
	margin: 0 0 4px;
}

.cng-invite-banner-sub {
	font-size: 0.88rem;
	color: var(--cng-text-light);
	margin: 0;
	line-height: 1.5;
}

.cng-invite-banner-form {
	display: flex;
	gap: 8px;
	flex: 1 1 280px;
	min-width: 260px;
}

.cng-invite-banner-form .cng-input {
	flex: 1;
	margin: 0;
}

.cng-invite-banner-form .cng-btn--primary {
	white-space: nowrap;
	flex-shrink: 0;
	padding: 10px 18px;
	font-size: 0.92rem;
}

.cng-invite-banner-consent {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin-top: 10px;
	font-size: 0.76rem;
	color: var(--cng-text-light);
	line-height: 1.5;
	cursor: pointer;
}

.cng-invite-banner-consent input[type="checkbox"] {
	flex-shrink: 0;
	margin-top: 2px;
	width: 14px;
	height: 14px;
	accent-color: var(--cng-primary);
	cursor: pointer;
}

.cng-banner-error {
	color: #b91c1c;
	font-size: 0.82rem;
	background: #fff5f5;
	border: 1px solid #fecaca;
	border-radius: var(--cng-radius);
	padding: 6px 10px;
	margin: 10px 0 0;
}

@media (max-width: 560px) {
	.cng-invite-banner-form {
		flex-direction: column;
	}
	.cng-invite-banner-form .cng-btn--primary {
		width: 100%;
	}
}

/* ── Post-download modal ───────────────────────────────────────────────────── */
.cng-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	animation: cng-modal-fade 0.25s ease;
}

@keyframes cng-modal-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.cng-modal-card {
	position: relative;
	background: #fff;
	border-radius: 16px;
	padding: 30px 28px 24px;
	max-width: 680px;
	width: 100%;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	animation: cng-modal-pop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cng-modal-pop {
	from { opacity: 0; transform: translateY(12px) scale(0.96); }
	to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.cng-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: transparent;
	border: none;
	font-size: 1.6rem;
	line-height: 1;
	color: var(--cng-text-light);
	cursor: pointer;
	padding: 4px 10px;
	border-radius: 50%;
	transition: background 0.15s;
}

.cng-modal-close:hover {
	background: rgba(0, 0, 0, 0.06);
	color: var(--cng-text);
}

.cng-modal-eyebrow {
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--cng-primary);
	margin: 0 0 6px;
	text-align: center;
}

.cng-modal-title {
	font-size: clamp(1.3rem, 3.5vw, 1.55rem);
	font-weight: 700;
	color: var(--cng-text);
	margin: 0 0 6px;
	text-align: center;
	line-height: 1.3;
}

.cng-modal-sub {
	font-size: 0.95rem;
	color: var(--cng-text-light);
	margin: 0 0 22px;
	text-align: center;
}

.cng-modal-cta-grid {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: 16px;
	align-items: stretch;
}

.cng-modal-cta-col {
	background: var(--cng-bg-alt);
	border: 1px solid var(--cng-border);
	border-radius: var(--cng-radius-lg);
	padding: 20px 18px;
	display: flex;
	flex-direction: column;
	text-align: center;
}

.cng-modal-cta-icon {
	font-size: 1.8rem;
	margin-bottom: 6px;
}

.cng-modal-cta-title {
	font-size: 1rem;
	font-weight: 700;
	color: var(--cng-text);
	margin: 0 0 6px;
}

.cng-modal-cta-copy {
	font-size: 0.86rem;
	color: var(--cng-text-light);
	line-height: 1.5;
	margin: 0 0 14px;
	flex: 1;
}

.cng-modal-cta-col .cng-input {
	margin-bottom: 8px;
}

.cng-modal-consent {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	font-size: 0.76rem;
	color: var(--cng-text-light);
	line-height: 1.45;
	margin-bottom: 10px;
	text-align: left;
	cursor: pointer;
}

.cng-modal-consent input[type="checkbox"] {
	flex-shrink: 0;
	margin-top: 2px;
	width: 14px;
	height: 14px;
	accent-color: var(--cng-primary);
	cursor: pointer;
}

.cng-modal-error {
	color: #b91c1c;
	font-size: 0.82rem;
	background: #fff5f5;
	border: 1px solid #fecaca;
	border-radius: var(--cng-radius);
	padding: 6px 10px;
	margin: 0 0 10px;
	text-align: left;
}

.cng-modal-divider {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--cng-text-light);
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	position: relative;
	padding: 0 6px;
}

.cng-modal-divider span {
	background: #fff;
	padding: 4px 8px;
	border-radius: 50%;
	border: 1px solid var(--cng-border);
	z-index: 1;
}

.cng-modal-divider::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 1px;
	background: var(--cng-border);
	transform: translateX(-50%);
}

.cng-modal-footnote {
	font-size: 0.76rem;
	color: var(--cng-text-light);
	margin: 18px 0 0;
	text-align: center;
	font-style: italic;
}

@media (max-width: 640px) {
	.cng-modal-card {
		padding: 28px 20px 20px;
	}
	.cng-modal-cta-grid {
		grid-template-columns: 1fr;
	}
	.cng-modal-divider {
		padding: 4px 0;
	}
	.cng-modal-divider::before {
		top: 50%;
		bottom: auto;
		left: 0;
		right: 0;
		width: auto;
		height: 1px;
		transform: translateY(-50%);
	}
}

/* ── Toast (tiny success confirmation) ─────────────────────────────────────── */
.cng-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(12px);
	background: #0f172a;
	color: #fff;
	font-size: 0.92rem;
	padding: 12px 20px;
	border-radius: 10px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
	z-index: 1000000;
	max-width: calc(100vw - 32px);
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
}

.cng-toast--show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* ── Loading animation: brush-written character ────────────────────────────── */
/* Replaces the old ring spinner. HanziWriter draws a character stroke-by-stroke
 * into #cng-loading-hanzi, cycling through 名 → 字 → 中 → 华 → 东 → 学.
 * The "ink" pad underneath is a soft red wash that gently pulses, reinforcing
 * the calligraphy feel without distracting from the character itself.
 */
.cng-loading-hanzi-wrap {
	position: relative;
	width: 160px;
	height: 160px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cng-loading-hanzi {
	position: relative;
	z-index: 2;
	width: 140px;
	height: 140px;
	/* Fallback font styling — only visible if HanziWriter fails to load */
	font-family: var(--cng-chinese-font);
	font-size: 6rem;
	color: var(--cng-primary);
	line-height: 140px;
	text-align: center;
}

.cng-loading-hanzi svg {
	display: block;
	margin: 0 auto;
}

.cng-loading-ink {
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: 50%;
	background: radial-gradient(
		closest-side,
		rgba(241, 90, 101, 0.14) 0%,
		rgba(241, 90, 101, 0.04) 60%,
		transparent 100%
	);
	animation: cng-ink-pulse 2.6s ease-in-out infinite;
}

@keyframes cng-ink-pulse {
	0%, 100% { transform: scale(0.96); opacity: 0.6; }
	50%      { transform: scale(1.04); opacity: 1;   }
}

/* ── Lite YouTube embed (thumbnail until clicked) ──────────────────────────── */
/* 16:9 responsive container. We never load the YouTube iframe until the user
 * clicks — so there's zero network or JS cost from YouTube on page load.
 */
.cng-video-embed {
	position: relative;
	width: 100%;
	max-width: 560px;
	margin: 0 auto 20px;
	aspect-ratio: 16 / 9;
	border-radius: var(--cng-radius);
	overflow: hidden;
	cursor: pointer;
	background: #000;
	box-shadow: var(--cng-shadow);
	transition: box-shadow var(--cng-transition), transform var(--cng-transition);
}

.cng-video-embed:hover {
	box-shadow: var(--cng-shadow-hover);
	transform: translateY(-2px);
}

.cng-video-thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	/* Subtle darken so the play button stays readable */
	filter: brightness(0.88);
	transition: filter var(--cng-transition);
}

.cng-video-embed:hover .cng-video-thumb {
	filter: brightness(0.75);
}

.cng-video-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 68px;
	height: 68px;
	border-radius: 50%;
	border: none;
	background: var(--cng-primary);
	color: #fff;
	font-size: 1.5rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
	transition: background var(--cng-transition), transform 0.15s ease;
}

.cng-video-embed:hover .cng-video-play {
	background: var(--cng-primary-dark);
	transform: translate(-50%, -50%) scale(1.08);
}

.cng-video-play-icon {
	/* Nudge the triangle right so it looks centered inside the circle */
	margin-left: 4px;
	line-height: 1;
}

.cng-video-embed iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* ── Teacher's Note: link out to the teacher's profile ─────────────────────── */
.cng-teacher-note-link {
	margin-top: 10px !important;
	margin-bottom: 0 !important;
	font-size: 0.85rem !important;
}

.cng-teacher-link {
	color: var(--cng-primary);
	text-decoration: none;
	font-weight: 600;
	border-bottom: 1px solid transparent;
	transition: border-color var(--cng-transition);
}

.cng-teacher-link:hover {
	border-bottom-color: var(--cng-primary);
}

/* ── Skeleton loaders (Phase 2 placeholders) ───────────────────────────────── */
.cng-skeleton {
	background: linear-gradient(
		90deg,
		#eeeeee 0%,
		#f6f6f6 50%,
		#eeeeee 100%
	);
	background-size: 200% 100%;
	animation: cng-shimmer 1.4s ease-in-out infinite;
	border-radius: 4px;
}

@keyframes cng-shimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* Line-shaped skeleton (used for text placeholders) */
.cng-skeleton--line {
	height: 10px;
	margin: 8px 0;
	width: 100%;
}

.cng-skeleton--line-lg {
	height: 16px;
	width: 45%;
}

.cng-skeleton--line-short {
	width: 70%;
}

/* Square/box skeleton (used for hanzi-writer canvas placeholder) */
.cng-skeleton--block {
	width: 80px;
	height: 80px;
	flex-shrink: 0;
	border-radius: var(--cng-radius);
}

/* Skeleton variant of the character detail card */
.cng-char-detail--skeleton .cng-char-info {
	flex: 1;
}

/* Skeleton variant of the Teacher's Note — keeps the red border accent */
.cng-teacher-note--skeleton {
	opacity: 0.85;
}

.cng-teacher-note--skeleton .cng-skeleton--line {
	margin: 6px 0;
}

/* ── Inline details-phase error ────────────────────────────────────────────── */
.cng-details-error {
	background: #fff5f5;
	border: 1px solid #fca5a5;
	border-radius: var(--cng-radius);
	padding: 16px 20px;
	margin-top: 20px;
	text-align: center;
}

.cng-details-error p {
	color: #b91c1c;
	margin: 0 0 12px;
	font-size: 0.9rem;
}

/* ── Responsive overrides ──────────────────────────────────────────────────── */
@media (max-width: 540px) {
	.cng-form-row {
		flex-direction: column;
		gap: 0;
	}

	.cng-form-wrapper {
		padding: 20px 16px;
	}

	.cng-cta-block {
		padding: 28px 20px;
	}

	.cng-cta-title {
		font-size: 1.2rem;
	}

	.cng-char-detail {
		min-width: 150px;
	}
}

@media (max-width: 380px) {
	.cng-results-grid {
		grid-template-columns: 1fr 1fr;
		gap: 8px;
	}
}
