/* ==========================================================================
   Kanji Quest — Complete Redesign (matching reference UI)
   Color: Orange HIKE brand (#F45D22)
   Layout: Bundle list → Map with zigzag nodes
   ========================================================================== */
:root {
	--kq-primary: #F45D22;
	--kq-primary-light: rgba(244, 93, 34, 0.12);
	--kq-primary-ring: rgba(244, 93, 34, 0.25);
	--kq-dark: #111827;
	--kq-muted: #6b7280;
	--kq-border: #e5e7eb;
	--kq-bg: #f4f8f9;
	--kq-white: #ffffff;
	--kq-green: #16a34a;
	--kq-green-light: rgba(22, 163, 74, 0.1);
	--kq-gold: #f59e0b;
	--kq-locked: #94a3b8;
	--kq-radius: 16px;
}

.hkq-app {
	font-family: 'Inter', -apple-system, sans-serif;
	min-height: calc(100vh - 100px);
	background: var(--kq-bg);
	max-width: 680px;
	margin: 0 auto;
	padding: 0 16px 60px;
}

/* ==========================================================================
   VIEW 1: BUNDLE SELECTION — "Choose your adventure"
   ========================================================================== */

.hkq-bundle-list-view {}
.hkq-bundle-list-header {
	padding: 28px 0 20px;
}
.hkq-bundle-list-header h1 {
	font-size: 26px;
	font-weight: 900;
	color: var(--kq-dark);
	margin: 0 0 4px;
}
.hkq-bundle-list-header h1::before {
	content: '🎌 ';
}
.hkq-bundle-list-header p {
	font-size: 14px;
	color: var(--kq-muted);
	margin: 0;
}
.hkq-sub-desc {
	font-size: 15px !important;
	color: var(--kq-muted);
	line-height: 1.6;
	max-width: 680px;
	margin: 12px 0 24px 0 !important;
}
.hkq-choose-title {
	font-size: 14px;
	font-weight: 800;
	color: var(--kq-primary);
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-top: 14px;
	margin-bottom: 8px;
}

/* Bundle Cards */
.hkq-bundle-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.hkq-bcard {
	background: var(--kq-white);
	border: 2px solid var(--kq-border);
	border-radius: var(--kq-radius);
	padding: 22px 24px;
	position: relative;
	cursor: pointer;
	transition: all 0.2s ease;
}
.hkq-bcard:hover {
	border-color: var(--kq-primary);
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(244,93,34,0.08);
}
.hkq-bcard.unlocked {
	border-color: var(--kq-green);
	background: linear-gradient(135deg, #f0fdf4 0%, #fff 50%);
}
.hkq-bcard-badge {
	position: absolute;
	top: 16px;
	right: 16px;
	font-size: 11px;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 20px;
	letter-spacing: 0.3px;
}
.hkq-bcard-badge.premium {
	background: #f3f4f6;
	color: var(--kq-locked);
	border: 1px solid #e5e7eb;
}
.hkq-bcard-badge.premium::before { content: '🔒 '; }
.hkq-bcard-badge.unlocked {
	background: var(--kq-green-light);
	color: var(--kq-green);
	border: 1px solid rgba(22,163,74,0.2);
}
.hkq-bcard-badge.unlocked::before { content: '🔓 '; }
.hkq-bcard-badge.free {
	background: var(--kq-primary-light);
	color: var(--kq-primary);
	border: 1px solid rgba(244,93,34,0.2);
}
.hkq-bcard-badge.free::before { content: '✨ '; }
.hkq-bcard-icon {
	font-size: 28px;
	margin-bottom: 10px;
	display: block;
}
.hkq-bcard-title {
	font-size: 18px;
	font-weight: 800;
	color: var(--kq-dark);
	margin: 0 0 8px;
}
.hkq-bcard-link {
	font-size: 13px;
	font-weight: 600;
	color: var(--kq-muted);
	text-decoration: none;
}
.hkq-bcard.unlocked .hkq-bcard-link { color: var(--kq-primary); }

/* ==========================================================================
   VIEW 2: INSIDE A BUNDLE — Quest Map
   ========================================================================== */

.hkq-map-view { display: none; }
.hkq-map-view.active { display: block; }
.hkq-bundle-list-view.hidden { display: none; }

/* Top Navigation Bar */
.hkq-map-topbar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 20px 0 16px;
}
.hkq-map-home-btn, .hkq-map-back-btn {
	width: 38px; height: 38px;
	border-radius: 10px;
	border: 1.5px solid var(--kq-border);
	background: var(--kq-white);
	display: flex; align-items: center; justify-content: center;
	font-size: 16px;
	cursor: pointer;
	transition: border-color 0.2s;
}
.hkq-map-home-btn:hover, .hkq-map-back-btn:hover { border-color: var(--kq-primary); }
.hkq-map-topbar-title {
	flex: 1;
	font-size: 17px;
	font-weight: 800;
	color: var(--kq-dark);
	text-align: center;
}
.hkq-map-stars {
	display: flex;
	align-items: center;
	gap: 5px;
	background: linear-gradient(135deg, #fef3c7, #fde68a);
	border: 1.5px solid var(--kq-gold);
	border-radius: 20px;
	padding: 5px 14px;
	font-size: 14px;
	font-weight: 800;
	color: #92400e;
}

/* Tab toggle: Map / Leaderboard */
.hkq-map-tabs {
	display: flex;
	gap: 0;
	background: #f3f4f6;
	border-radius: 12px;
	padding: 4px;
	margin-bottom: 16px;
}
.hkq-map-tab {
	flex: 1;
	padding: 12px 16px;
	border: none;
	background: none;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 700;
	color: var(--kq-muted);
	cursor: pointer;
	transition: all 0.2s;
	text-align: center;
}
.hkq-map-tab.active {
	background: var(--kq-primary);
	color: #fff;
	box-shadow: 0 4px 12px rgba(244,93,34,0.25);
}

/* Week Accordion */
.hkq-week-acc {
	background: var(--kq-white);
	border: 2px solid var(--kq-primary);
	border-radius: 14px;
	padding: 14px 18px;
	margin-bottom: 16px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 12px;
	transition: all 0.2s;
}
.hkq-week-acc:hover { box-shadow: 0 4px 16px rgba(244,93,34,0.1); }
.hkq-week-acc-icon { font-size: 20px; }
.hkq-week-acc-title { flex: 1; font-size: 15px; font-weight: 700; color: var(--kq-dark); }
.hkq-week-acc-count {
	font-size: 12px;
	font-weight: 600;
	color: var(--kq-muted);
	background: #f3f4f6;
	padding: 4px 10px;
	border-radius: 20px;
}
.hkq-week-acc-arrow {
	font-size: 12px;
	color: var(--kq-primary);
	transition: transform 0.2s;
}
.hkq-week-acc.open .hkq-week-acc-arrow { transform: rotate(180deg); }

/* Zigzag Node Path */
.hkq-zigzag-path {
	position: relative;
	padding: 20px 0 40px;
	display: none;
}
.hkq-zigzag-path.open { display: block; }

/* Center dashed line */
.hkq-zigzag-path::before {
	content: '';
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: 3px;
	background: repeating-linear-gradient(
		to bottom,
		var(--kq-border) 0px,
		var(--kq-border) 10px,
		transparent 10px,
		transparent 20px
	);
	transform: translateX(-50%);
}

/* Node container */
.hkq-node-wrap {
	position: relative;
	display: flex;
	align-items: center;
	margin-bottom: 24px;
	min-height: 90px;
}
.hkq-node-wrap:nth-child(odd) { justify-content: center; padding-right: 30%; }
.hkq-node-wrap:nth-child(even) { justify-content: center; padding-left: 30%; }

/* Node circle */
.hkq-node2 {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	position: relative;
	z-index: 2;
	transition: transform 0.2s;
	background: var(--kq-primary);
	color: #fff;
	border: 4px solid var(--kq-primary-ring);
	box-shadow: 0 6px 20px rgba(244,93,34,0.2);
}
.hkq-node2:hover { transform: scale(1.1); }
.hkq-node2-day {
	font-size: 13px;
	font-weight: 800;
	line-height: 1.2;
}
.hkq-node2-count {
	font-size: 11px;
	font-weight: 600;
	opacity: 0.85;
}

/* Locked node */
.hkq-node2.locked {
	background: #d1d5db;
	border-color: #e5e7eb;
	box-shadow: none;
	cursor: not-allowed;
	opacity: 0.5;
}
.hkq-node2.locked:hover { transform: none; }

/* Completed node */
.hkq-node2.completed {
	background: var(--kq-green);
	border-color: rgba(22,163,74,0.25);
	box-shadow: 0 6px 20px rgba(22,163,74,0.2);
}

/* Available (current) — pulsing ring */
.hkq-node2.available {
	animation: kq-pulse 2s infinite;
}
@keyframes kq-pulse {
	0%, 100% { box-shadow: 0 0 0 6px rgba(244,93,34,0.15), 0 6px 20px rgba(244,93,34,0.2); }
	50% { box-shadow: 0 0 0 12px rgba(244,93,34,0.08), 0 6px 20px rgba(244,93,34,0.2); }
}

/* Stars below node */
.hkq-node2-stars {
	position: absolute;
	bottom: -8px;
	display: flex;
	gap: 2px;
	font-size: 12px;
}

/* ==========================================================================
   LEADERBOARD
   ========================================================================== */

.hkq-lb-view { display: none; padding: 16px 0; }
.hkq-lb-view.active { display: block; }
.hkq-lb-filters { display: flex; gap: 6px; margin-bottom: 20px; justify-content: center; }
.hkq-lb-filter {
	padding: 8px 16px;
	border: 1.5px solid var(--kq-border);
	border-radius: 20px;
	background: var(--kq-white);
	font-size: 12px; font-weight: 600;
	color: var(--kq-muted);
	cursor: pointer; transition: all 0.2s;
}
.hkq-lb-filter.active { background: var(--kq-primary); border-color: var(--kq-primary); color: #fff; }
.hkq-lb-my-rank {
	background: linear-gradient(135deg, #fef3c7, #fde68a);
	border: 1.5px solid var(--kq-gold);
	border-radius: 12px; padding: 12px 16px;
	margin-bottom: 16px; display: flex;
	align-items: center; justify-content: space-between;
	font-size: 13px; font-weight: 700; color: #92400e;
}
.hkq-lb-list { display: flex; flex-direction: column; gap: 6px; }
.hkq-lb-item {
	display: flex; align-items: center; gap: 12px;
	padding: 12px 14px;
	background: var(--kq-white);
	border: 1.5px solid var(--kq-border);
	border-radius: 10px;
	animation: kq-fadeIn 0.3s ease forwards;
	opacity: 0;
}
@keyframes kq-fadeIn { to { opacity: 1; } }
.hkq-lb-item.is-me { background: #fff8f5; border-color: var(--kq-primary); }
.hkq-lb-rank { width: 28px; text-align: center; font-size: 14px; font-weight: 900; color: var(--kq-muted); }
.hkq-lb-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.hkq-lb-name { flex: 1; font-size: 13px; font-weight: 600; color: var(--kq-dark); }
.hkq-lb-stars { font-size: 13px; font-weight: 800; color: var(--kq-gold); }
.hkq-lb-empty { text-align: center; padding: 60px 20px; color: var(--kq-muted); }
.hkq-lb-empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ==========================================================================
   MODAL
   ========================================================================== */

.hkq-modal-overlay {
	position: fixed; inset: 0;
	background: rgba(0,0,0,0.65);
	z-index: 999999 !important;
	display: flex; align-items: center; justify-content: center;
	padding: 16px;
	backdrop-filter: blur(6px);
}
.hkq-modal {
	background: var(--kq-white);
	border-radius: var(--kq-radius);
	width: 100%; max-width: 500px;
	max-height: 85vh; overflow-y: auto;
	box-shadow: 0 24px 60px rgba(0,0,0,0.2);
}
/* Wide modal for new Learn/Write/Recall/Review layout */
.hkq-modal-wide .hkq-modal {
	max-width: 880px;
}
.hkq-modal-header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 16px 20px; border-bottom: 1px solid var(--kq-border);
	position: sticky; top: 0; background: var(--kq-white); z-index: 10;
}
.hkq-modal-title { font-size: 15px; font-weight: 800; color: var(--kq-dark); flex: 1; padding-right: 12px; }
.hkq-modal-close {
	width: 30px; height: 30px; border-radius: 50%;
	border: none; background: #f3f4f6; color: var(--kq-muted);
	font-size: 14px; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	flex-shrink: 0;
}
.hkq-modal-close:hover { background: #fee2e2; color: #dc2626; }
.hkq-modal-body { padding: 20px; }

/* Loading spinner */
.hkq-loading { text-align: center; padding: 40px; color: var(--kq-muted); }
.hkq-spinner {
	width: 28px; height: 28px;
	border: 3px solid var(--kq-border);
	border-top-color: var(--kq-primary);
	border-radius: 50%;
	animation: kq-spin 0.7s linear infinite;
	margin: 0 auto 10px;
}
@keyframes kq-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   STUDY MODAL STYLES (Read/Write/Test)
   ========================================================================== */

.hkq-study-modes { display: flex; gap: 4px; background: #f3f4f6; padding: 4px; border-radius: 10px; margin-bottom: 14px; }
.hkq-mode-btn { flex: 1; padding: 8px; border: none; background: none; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--kq-muted); cursor: pointer; transition: all 0.2s; }
.hkq-mode-btn.active { background: var(--kq-white); color: var(--kq-dark); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.hkq-char-selector { display: flex; gap: 5px; overflow-x: auto; padding: 4px 0 12px; margin-bottom: 14px; border-bottom: 1px solid var(--kq-border); }
.hkq-char-pill { min-width: 40px; height: 40px; border-radius: 8px; border: 2px solid var(--kq-border); background: var(--kq-white); font-size: 18px; font-family: 'UD Digi Kyokasho NP', serif; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.15s; }
.hkq-char-pill:hover { border-color: var(--kq-primary); }
.hkq-char-pill.active { background: var(--kq-primary); border-color: var(--kq-primary); color: #fff; }
.hkq-read-char-big { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 16px; }
.hkq-big-kanji { font-size: 64px; font-family: 'UD Digi Kyokasho NP', serif; font-weight: 700; color: var(--kq-dark); }
.hkq-tts-btn { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--kq-border); background: var(--kq-white); font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.hkq-tts-btn:hover { background: #eff6ff; border-color: #3b82f6; }
.hkq-read-info { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 16px; }
.hkq-read-row { background: #f9fafb; border-radius: 8px; padding: 8px 12px; }
.hkq-read-row label { display: block; font-size: 9px; font-weight: 700; color: var(--kq-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 2px; }
.hkq-read-row span { font-size: 14px; font-weight: 600; color: var(--kq-dark); font-family: 'UD Digi Kyokasho NP', serif; }
.hkq-vocab-section h4 { font-size: 12px; font-weight: 700; color: var(--kq-muted); text-transform: uppercase; margin: 0 0 8px; }
.hkq-vocab-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.hkq-vocab-table th { text-align: left; padding: 6px 8px; background: #f9fafb; color: var(--kq-muted); font-size: 10px; text-transform: uppercase; }
.hkq-vocab-table td { padding: 8px; border-bottom: 1px solid #f3f4f6; }
.hkq-vocab-word { font-family: 'UD Digi Kyokasho NP', serif; font-size: 15px; font-weight: 700; }
.hkq-canvas-container { position: relative; width: 300px; height: 300px; margin: 0 auto 14px; border: 2px solid var(--kq-border); border-radius: 16px; background: #f8fafc; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.hkq-canvas-guide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 200px; font-family: 'UD Digi Kyokasho NP', serif; color: #d1d5db; opacity: 0.12; pointer-events: none; user-select: none; }
#hkq-canvas { position: relative; z-index: 2; display: block; touch-action: none; cursor: crosshair; width: 100%; height: 100%; }
.hkq-write-info-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hkq-write-char-label { font-size: 13px; color: var(--kq-muted); font-weight: 500; }
.hkq-write-char-label strong { font-size: 22px; font-family: 'UD Digi Kyokasho NP', serif; margin-left: 4px; }
.hkq-mistakes-badge { font-size: 12px; color: #dc2626; background: #fef2f2; padding: 3px 10px; border-radius: 20px; font-weight: 700; }
.hkq-write-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.hkq-write-btn { padding: 8px 16px; border: 1.5px solid var(--kq-border); border-radius: 10px; background: var(--kq-white); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.hkq-write-btn:hover { border-color: var(--kq-primary); color: var(--kq-primary); background: rgba(244,93,34,0.04); }
.hkq-write-btn-next { background: var(--kq-primary); color: #fff !important; border-color: var(--kq-primary); }
.hkq-write-btn-next:hover { background: #d34a17; }
.hkq-study-footer { margin-top: 20px; text-align: center; padding-top: 14px; border-top: 1px solid var(--kq-border); }
.hkq-study-footer.completed { color: var(--kq-green); font-weight: 700; font-size: 14px; }
.hkq-complete-day-btn { background: var(--kq-primary); color: #fff; border: none; padding: 11px 28px; border-radius: 50px; font-size: 13px; font-weight: 700; cursor: pointer; }
.hkq-complete-day-btn:hover { background: #d34a17; }

/* Readings tag (below canvas) */
.hkq-write-readings-tag {
	text-align: center;
	margin: 0 auto 12px;
	padding: 4px 16px;
	font-size: 13px;
	font-weight: 600;
	color: #4f46e5;
	background: #eef2ff;
	border: 1px solid #c7d2fe;
	border-radius: 20px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}
.hkq-write-actions + .hkq-stroke-counter { margin-top: 0; }

/* Stroke counter badge */
.hkq-stroke-counter {
	text-align: center;
	margin: 12px auto 0;
	padding: 6px 20px;
	font-size: 14px;
	font-weight: 700;
	color: var(--kq-primary);
	background: var(--kq-primary-light);
	border: 1.5px solid var(--kq-primary-ring);
	border-radius: 24px;
	display: inline-block;
	transition: all 0.2s ease;
}

/* SVG stroke overlay */
#hkq-stroke-svg-overlay {
	pointer-events: none;
}
.hkq-svg-ghost-stroke {
	opacity: 0.7;
}
.hkq-svg-active-stroke {
	filter: drop-shadow(0 0 3px rgba(229, 62, 62, 0.4));
}

/* Circular stroke number labels at the starting point of each stroke */
circle.hkq-svg-stroke-num {
	stroke: #ffffff;
	stroke-width: 1px;
	filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}
text.hkq-svg-stroke-num {
	pointer-events: none;
	user-select: none;
}


/* Center the readings tag & counter */
.hkq-canvas-container + .hkq-write-readings-tag,
.hkq-write-actions + .hkq-stroke-counter {
	display: block;
	width: fit-content;
	margin-left: auto;
	margin-right: auto;
}

/* Responsive */
@media (max-width: 400px) {
	.hkq-node2 { width: 68px; height: 68px; }
	.hkq-node2-day { font-size: 12px; }
	.hkq-canvas-container { width: 240px; height: 240px; }
	.hkq-canvas-guide { font-size: 160px; }
}

/* ==========================================================================
   Stroke Breakdown Panel (Write mode)
   ========================================================================== */

.hkq-stroke-breakdown {
	margin-top: 16px;
	border: 1.5px solid var(--kq-border);
	border-radius: 12px;
	overflow: hidden;
	background: #fafafa;
}
.hkq-stroke-breakdown-header {
	padding: 10px 16px;
	font-size: 13px;
	font-weight: 700;
	color: var(--kq-dark);
	background: #f3f4f6;
	border-bottom: 1px solid var(--kq-border);
}
.hkq-stroke-breakdown-body {
	padding: 14px 16px;
}
.hkq-stroke-info {
	font-size: 13px;
	color: var(--kq-dark);
	margin-bottom: 10px;
	padding-bottom: 10px;
	border-bottom: 1px dashed var(--kq-border);
}
.hkq-stroke-notes {
	font-size: 13px;
	line-height: 1.8;
	color: #374151;
}

/* ==========================================================================
   Day Page — Kanji Cards Grid
   ========================================================================== */

.hkq-day-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 18px;
	margin-bottom: 24px;
}

.hkq-kanji-card {
	background: #ffffff;
	border: 1.5px solid #e2e8f0;
	border-radius: 18px;
	padding: 20px 16px 16px;
	text-align: center;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
	display: flex;
	flex-direction: column;
	align-items: center;
}

.hkq-kanji-card:hover {
	border-color: #c7d2fe;
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(79, 70, 229, 0.1);
}

.hkq-kc-num {
	font-size: 11.5px;
	font-weight: 700;
	color: #64748b;
	background: #f1f5f9;
	padding: 2px 10px;
	border-radius: 50px;
	display: inline-block;
	margin-bottom: 8px;
	letter-spacing: 0.02em;
}

.hkq-kc-char {
	font-size: 56px;
	font-family: 'UD Digi Kyokasho NP', 'Noto Serif JP', serif;
	font-weight: 800;
	color: #0f172a;
	line-height: 1.15;
	margin-bottom: 16px;
	transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	user-select: none;
}

.hkq-kanji-card:hover .hkq-kc-char {
	transform: scale(1.05);
}

.hkq-kc-actions {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: auto;
}

.hkq-kc-start-btn {
	width: 100%;
	height: 38px;
	background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
	color: #ffffff;
	border: none;
	border-radius: 10px;
	font-size: 12.5px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	cursor: pointer;
	box-shadow: 0 3px 10px rgba(79, 70, 229, 0.25);
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hkq-kc-start-btn:hover {
	background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
	transform: translateY(-1px);
	box-shadow: 0 5px 14px rgba(79, 70, 229, 0.35);
}

.hkq-kc-download-btn {
	width: 100%;
	height: 34px;
	background: #f8fafc;
	border: 1.5px solid #e2e8f0;
	border-radius: 10px;
	color: #475569;
	font-size: 11.5px;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	text-decoration: none !important;
	box-sizing: border-box;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hkq-kc-download-btn:hover {
	background: #f1f5f9;
	border-color: #cbd5e1;
	color: #1e293b;
	transform: translateY(-1px);
}

/* PDF button */
.hkq-pdf-btn {
	background: var(--kq-green);
	color: #fff;
	border: none;
	padding: 8px 18px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s;
}
.hkq-pdf-btn:hover { background: #15803d; }

/* Complete button */
.hkq-complete-btn {
	background: var(--kq-primary);
	color: #fff;
	border: none;
	padding: 12px 28px;
	border-radius: 50px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}
.hkq-complete-btn:hover { background: #d34a17; }

@media (max-width: 400px) {
	.hkq-day-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.hkq-kc-char { font-size: 38px; }
}


/* Guest CTA Box */
.hkq-guest-cta-box {
	background: var(--kq-white);
	border: 2px dashed var(--kq-border);
	border-radius: var(--kq-radius);
	padding: 24px 30px;
	margin-top: 24px;
	text-align: center;
}
.hkq-guest-cta-box h3 {
	font-size: 18px;
	font-weight: 800;
	color: var(--kq-dark);
	margin: 0 0 8px 0;
}
.hkq-guest-cta-box p {
	font-size: 14px;
	color: var(--kq-muted);
	line-height: 1.5;
	max-width: 600px;
	margin: 0 auto 16px auto;
}
.hkq-guest-cta-buttons {
	display: flex;
	gap: 12px;
	justify-content: center;
	align-items: center;
}
.hkq-cta-btn {
	display: inline-block;
	font-size: 14px;
	font-weight: 700;
	padding: 10px 22px;
	border-radius: 30px;
	text-decoration: none !important;
	transition: all 0.2s ease;
	cursor: pointer;
}
.hkq-cta-btn.filled {
	background: var(--kq-primary);
	color: #fff !important;
	border: 2px solid var(--kq-primary);
}
.hkq-cta-btn.filled:hover {
	background: #d64713;
	border-color: #d64713;
}
.hkq-cta-btn.outline {
	background: transparent;
	color: var(--kq-dark) !important;
	border: 2px solid var(--kq-border);
}
.hkq-cta-btn.outline:hover {
	border-color: var(--kq-dark);
	background: #fdfdfd;
}

/* ==========================================================================
   TEST MODE — Kanji Quiz UI
   ========================================================================== */

/* Progress header */
.hkq-test-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
}
.hkq-test-progress-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--kq-muted);
	white-space: nowrap;
}
.hkq-test-progress-bar {
	flex: 1;
	height: 6px;
	background: var(--kq-border);
	border-radius: 99px;
	overflow: hidden;
}
.hkq-test-progress-fill {
	height: 100%;
	background: var(--kq-primary);
	border-radius: 99px;
	transition: width 0.4s ease;
}

/* Clue card */
.hkq-test-clue-card {
	background: linear-gradient(135deg, #fff7f4 0%, #fff 100%);
	border: 2px solid #fbd5c5;
	border-radius: 14px;
	padding: 14px 16px;
	margin-bottom: 14px;
}
.hkq-test-clue-title {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--kq-primary);
	margin-bottom: 10px;
}
.hkq-test-clue-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.hkq-test-clue-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.hkq-test-clue-lbl {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--kq-muted);
}
.hkq-test-clue-val {
	font-size: 16px;
	font-weight: 700;
	color: var(--kq-dark);
	font-family: 'UD Digi Kyokasho NP', 'Noto Serif JP', serif;
}

/* Reveal overlay on canvas */
.hkq-test-reveal-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 180px;
	font-family: 'UD Digi Kyokasho NP', 'Noto Serif JP', serif;
	font-weight: 700;
	color: var(--kq-primary);
	opacity: 0.82;
	pointer-events: none;
	user-select: none;
	z-index: 10;
	animation: hkq-reveal-pop 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes hkq-reveal-pop {
	from { transform: scale(0.6); opacity: 0; }
	to   { transform: scale(1);   opacity: 0.82; }
}

/* Mistakes row */
.hkq-test-mistakes-row {
	font-size: 13px;
	color: var(--kq-muted);
	text-align: center;
	margin: 6px 0 2px;
}
.hkq-test-mistakes-row strong {
	color: #dc2626;
}

/* Self-assessment row */
.hkq-test-assess-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 14px;
	padding: 12px 14px;
	background: #f8fafc;
	border: 1.5px solid var(--kq-border);
	border-radius: 12px;
	animation: hkq-fadein 0.25s ease both;
}
@keyframes hkq-fadein {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}
.hkq-test-assess-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--kq-muted);
}
.hkq-test-assess-btn {
	padding: 8px 18px;
	border: 2px solid;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.18s ease;
}
.hkq-test-pass {
	background: #f0fdf4;
	color: #16a34a;
	border-color: #86efac;
}
.hkq-test-pass:hover {
	background: #16a34a;
	color: #fff;
	border-color: #16a34a;
}
.hkq-test-fail {
	background: #fef2f2;
	color: #dc2626;
	border-color: #fca5a5;
}
.hkq-test-fail:hover {
	background: #dc2626;
	color: #fff;
	border-color: #dc2626;
}

/* Test Summary Screen */
.hkq-test-summary {
	padding: 8px 0;
	text-align: center;
}
.hkq-test-summary-title {
	font-size: 22px;
	font-weight: 800;
	color: var(--kq-dark);
	margin-bottom: 6px;
}
.hkq-test-summary-score {
	font-size: 28px;
	font-weight: 800;
	color: var(--kq-primary);
	margin-bottom: 18px;
}
.hkq-test-summary-chars {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 8px;
	margin-bottom: 8px;
	text-align: left;
}
.hkq-test-summary-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 10px;
	border: 1.5px solid;
}
.hkq-tsi-pass {
	background: #f0fdf4;
	border-color: #86efac;
}
.hkq-tsi-fail {
	background: #fef2f2;
	border-color: #fca5a5;
}
.hkq-test-summary-char {
	font-size: 26px;
	font-family: 'UD Digi Kyokasho NP', serif;
	font-weight: 700;
	line-height: 1;
	flex-shrink: 0;
}
.hkq-test-summary-reading {
	font-size: 11px;
	color: var(--kq-muted);
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.hkq-test-summary-result {
	font-size: 16px;
	flex-shrink: 0;
}

/* Responsive adjustments for test mode */
@media (max-width: 400px) {
	.hkq-test-clue-grid { grid-template-columns: 1fr; }
	.hkq-test-summary-chars { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
	.hkq-test-reveal-overlay { font-size: 140px; }
}

/* ==========================================================================
   NEW MODAL — 4-Step Stepper & Wide Learn Card (Pixel-perfect Template)
   ========================================================================== */

/* --- Modal Container & Stepper --- */
.hkq-modal-wide .hkq-modal {
	max-width: 860px;
	width: 95vw;
	max-height: 92vh;
	border-radius: 20px;
	box-shadow: 0 20px 60px -10px rgba(15, 23, 42, 0.3);
	overflow-y: auto;
	background: #ffffff;
}

.hkq-modal-wide .hkq-modal-header {
	display: none; /* Hide default header since we use the modern integrated stepper */
}

.hkq-modal-wide .hkq-modal-body {
	padding: 0;
}

/* --- Integrated Stepper Navigation --- */
.hkq-stepper {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 24px;
	background: #ffffff;
	border-bottom: 1px solid #f1f5f9;
	gap: 6px;
}

.hkq-step {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	user-select: none;
}

.hkq-step:hover {
	background: #f8fafc;
}

.hkq-step-active {
	background: #f5f3ff !important;
}

.hkq-step-icon {
	width: 32px;
	height: 32px;
	border-radius: 10px;
	background: #f1f5f9;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	transition: all 0.2s ease;
	color: #64748b;
}

.hkq-step-active .hkq-step-icon {
	background: #4f46e5;
	color: #ffffff;
	box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.hkq-step-done .hkq-step-icon {
	background: #10b981;
	color: #ffffff;
}

.hkq-step-labels {
	display: flex;
	flex-direction: column;
	text-align: left;
}

.hkq-step-label {
	font-size: 13px;
	font-weight: 700;
	color: #1e293b;
	line-height: 1.2;
}

.hkq-step-active .hkq-step-label {
	color: #4338ca;
}

.hkq-step-sub {
	font-size: 10.5px;
	color: #94a3b8;
	font-weight: 500;
	margin-top: 1px;
}

.hkq-step-connector {
	flex: 1;
	height: 1.5px;
	border-top: 2px dashed #cbd5e1;
	margin: 0 4px;
}

.hkq-step-connector-done {
	border-top-style: solid;
	border-top-color: #10b981;
}

.hkq-stepper-close-btn {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #f1f5f9;
	border: none;
	color: #64748b;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-left: 6px;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.hkq-stepper-close-btn:hover {
	background: #fee2e2;
	color: #dc2626;
}

/* --- Learn Tab Wrapper --- */
.hkq-learn-wrapper {
	padding: 16px 24px 20px;
}

.hkq-learn-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.hkq-learn-counter-nav {
	display: flex;
	align-items: center;
	gap: 8px;
}

.hkq-nav-arrow-btn {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #f1f5f9;
	border: 1px solid #cbd5e1;
	color: #475569;
	font-size: 15px;
	font-weight: 800;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	line-height: 1;
	transition: all 0.2s ease;
	padding: 0;
}

.hkq-nav-arrow-btn:hover {
	background: #4f46e5;
	color: #ffffff;
	border-color: #4f46e5;
	transform: scale(1.08);
}

.hkq-learn-counter {
	font-size: 15px;
	font-weight: 700;
	color: #1e293b;
	letter-spacing: -0.01em;
	display: flex;
	align-items: center;
	gap: 8px;
}

.hkq-tts-inline {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	width: 26px;
	height: 26px;
	background: #f5f3ff;
	border: 1.5px solid #c7d2fe;
	border-radius: 8px;
	width: 30px;
	height: 30px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	color: #4f46e5;
	box-shadow: 0 1px 3px rgba(79, 70, 229, 0.12);
}

.hkq-tts-inline:hover {
	border-color: #4338ca;
	background: #4f46e5;
	color: #ffffff;
	transform: scale(1.06);
	box-shadow: 0 3px 8px rgba(79, 70, 229, 0.25);
}

.hkq-tts-inline svg {
	display: block;
}

.hkq-learn-bookmark-btn {
	background: #ffffff;
	border: 1.5px solid #e2e8f0;
	border-radius: 8px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #475569;
	transition: all 0.2s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.hkq-learn-bookmark-btn:hover {
	border-color: #4f46e5;
	color: #4f46e5;
	background: #f5f3ff;
	transform: scale(1.06);
}

.hkq-learn-bookmark-btn.is-active {
	background: #fffbeb;
	border-color: #fcd34d;
	color: #d97706;
}

/* --- 2-Column Main Grid --- */
.hkq-learn-grid {
	display: grid;
	grid-template-columns: 1fr 1.35fr;
	gap: 20px;
	margin-bottom: 14px;
	min-width: 0;
	width: 100%;
	box-sizing: border-box;
}

/* LEFT COLUMN */
.hkq-learn-col-left {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.hkq-learn-kanji-box {
	position: relative;
	background: #ffffff;
	border: 1.5px solid #e2e8f0;
	border-radius: 16px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02);
	padding: 16px 14px 14px;
	display: flex;
	flex-direction: column;
	align-items: center;
	overflow: hidden;
}

/* Japanese writing crosshairs */
.hkq-kanji-crosshair-h {
	position: absolute;
	top: 36%;
	left: 0;
	right: 0;
	height: 1px;
	border-top: 1px dashed #e2e8f0;
	pointer-events: none;
}

.hkq-kanji-crosshair-v {
	position: absolute;
	top: 0;
	bottom: 38%;
	left: 50%;
	width: 1px;
	border-left: 1px dashed #e2e8f0;
	pointer-events: none;
}

.hkq-learn-main-char {
	font-size: 105px;
	font-family: 'UD Digi Kyokasho NP', 'Noto Serif JP', 'Hiragino Mincho ProN', serif;
	font-weight: 800;
	color: #0f172a;
	line-height: 1;
	margin: 2px 0 14px;
	z-index: 1;
	user-select: none;
}

.hkq-learn-readings-box {
	width: 100%;
	background: #f5f3ff;
	border-radius: 12px;
	padding: 10px 12px;
	text-align: center;
	z-index: 1;
}

.hkq-learn-primary-reading,
.hkq-learn-kunyomi {
	font-size: 17px;
	font-family: 'UD Digi Kyokasho NP', 'Hiragino Sans', sans-serif;
	font-weight: 700;
	color: #4338ca;
	margin-bottom: 2px;
	letter-spacing: 0.04em;
}

.hkq-learn-meaning {
	font-size: 13.5px;
	font-weight: 600;
	color: #475569;
	margin-bottom: 8px;
}

.hkq-learn-pill-tags {
	display: flex;
	justify-content: center;
	gap: 6px;
	flex-wrap: wrap;
}

.hkq-learn-tag-pill {
	background: #ffffff;
	border: 1.5px solid #e0e7ff;
	border-radius: 6px;
	padding: 3px 9px;
	font-size: 11.5px;
	font-weight: 700;
	color: #4338ca;
	box-shadow: 0 1px 2px rgba(79, 70, 229, 0.06);
	display: inline-flex;
	align-items: center;
	gap: 3px;
}

.hkq-learn-tag-pill.on-pill {
	border-color: #c7d2fe;
	color: #3730a3;
	background: #eef2ff;
}

.hkq-learn-tag-pill.kun-pill {
	border-color: #bbf7d0;
	color: #166534;
	background: #f0fdf4;
}

.hkq-learn-tag-pill.mean-pill {
	border-color: #fed7aa;
	color: #9a3412;
	background: #fff7ed;
}

.hkq-learn-tag-pill.nep-pill {
	border-color: #fbcfe8;
	color: #9d174d;
	background: #fdf2f8;
}

.hkq-pill-label {
	font-weight: 800;
	opacity: 0.85;
}

/* RIGHT COLUMN */
.hkq-learn-col-right {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
	max-width: 100%;
	overflow: hidden;
}

.hkq-learn-card-section {
	display: flex;
	flex-direction: column;
	min-width: 0;
	max-width: 100%;
}

.hkq-learn-section-heading {
	font-size: 13px;
	font-weight: 700;
	color: #1e293b;
	margin-bottom: 6px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.hkq-heading-badge {
	font-size: 12px;
	font-weight: 500;
	color: #64748b;
}

/* Stroke Order Strip */
.hkq-stroke-order-container {
	background: #ffffff;
	border: 1.5px solid #e2e8f0;
	border-radius: 14px;
	padding: 8px 10px 6px;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.02);
	min-width: 0;
	max-width: 100%;
	box-sizing: border-box;
	overflow: hidden;
}

.hkq-stroke-strip {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	overflow-y: hidden;
	padding-bottom: 6px;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: #cbd5e1 #f1f5f9;
	width: 100%;
	box-sizing: border-box;
}

/* Custom Horizontal Scrollbar for inside stroke order container */
.hkq-stroke-strip::-webkit-scrollbar {
	height: 6px;
}

.hkq-stroke-strip::-webkit-scrollbar-track {
	background: #f1f5f9;
	border-radius: 999px;
	margin: 0 4px;
}

.hkq-stroke-strip::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 999px;
	border: 1px solid #f1f5f9;
	transition: background 0.2s ease;
}

.hkq-stroke-strip::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}

.hkq-mini-stroke-card {
	position: relative;
	width: 66px;
	height: 66px;
	background: #f8fafc;
	border: 1.5px solid #e2e8f0;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: all 0.2s ease;
	box-sizing: border-box;
}

.hkq-mini-stroke-card:hover {
	border-color: #4f46e5;
	background: #ffffff;
}

.hkq-stroke-step-num {
	position: absolute;
	top: 3px;
	left: 5px;
	font-size: 10.5px;
	font-weight: 800;
	color: #64748b;
	line-height: 1;
}

.hkq-mini-stroke-svg {
	width: 78%;
	height: 78%;
}

.hkq-stroke-loading {
	font-size: 12px;
	color: #94a3b8;
	padding: 8px;
	text-align: center;
}

.hkq-stroke-fallback {
	font-size: 28px;
	font-family: 'UD Digi Kyokasho NP', serif;
	text-align: center;
	color: #4338ca;
}

/* Examples Grid & Cards (3-4 Examples) */
.hkq-examples-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

@media (max-width: 640px) {
	.hkq-examples-grid {
		grid-template-columns: 1fr;
	}
}

.hkq-example-card {
	background: #ffffff;
	border: 1.5px solid #e0e7ff;
	border-radius: 10px;
	padding: 8px 10px;
	display: flex;
	flex-direction: column;
	gap: 3px;
	transition: all 0.15s ease;
	position: relative;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.hkq-example-card:hover {
	border-color: #c7d2fe;
	background: #f8faff;
	box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

.hkq-ex-card-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
}

.hkq-ex-word-wrap {
	display: flex;
	align-items: baseline;
	gap: 3px;
	flex-wrap: wrap;
}

.hkq-ex-kanji-word {
	font-size: 16px;
	font-family: 'UD Digi Kyokasho NP', 'Hiragino Sans', serif;
	font-weight: 700;
	color: #4338ca;
	line-height: 1.2;
}

.hkq-ex-furigana-reading {
	font-size: 12px;
	font-weight: 600;
	color: #64748b;
}

.hkq-ex-tts-btn {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 50%;
	width: 22px;
	height: 22px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #6366f1;
	cursor: pointer;
	transition: all 0.15s ease;
	flex-shrink: 0;
}

.hkq-ex-tts-btn:hover {
	background: #eef2ff;
	color: #4338ca;
	border-color: #c7d2fe;
	transform: scale(1.08);
}

.hkq-ex-card-meaning {
	font-size: 12px;
	line-height: 1.35;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	align-items: baseline;
}

.hkq-ex-meaning-en {
	font-weight: 700;
	color: #1e293b;
}

.hkq-ex-meaning-nep {
	color: #059669;
	font-weight: 600;
	font-size: 11.5px;
}

.hkq-ex-card-sentence {
	font-size: 11px;
	color: #6366f1;
	font-style: italic;
	margin-top: 2px;
	line-height: 1.3;
	border-top: 1px dashed #e2e8f0;
	padding-top: 3px;
}

/* Example Banner (used in Write mode) */
.hkq-learn-example-banner {
	background: #f5f3ff;
	border: 1.5px solid #e0e7ff;
	border-radius: 14px;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.hkq-example-details {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.hkq-example-word {
	font-size: 20px;
	font-family: 'UD Digi Kyokasho NP', serif;
	font-weight: 700;
	color: #1e293b;
	line-height: 1.2;
}

.hkq-ex-kanji {
	color: #4338ca;
}

.hkq-ex-furigana {
	font-size: 14px;
	font-weight: 500;
	color: #475569;
	margin-left: 2px;
}

.hkq-example-trans {
	font-size: 13px;
	font-weight: 500;
	color: #64748b;
}

.hkq-example-illustration {
	flex-shrink: 0;
}

.hkq-calendar-badge {
	width: 46px;
	height: 46px;
	background: #ffffff;
	border: 1.5px solid #e2e8f0;
	border-radius: 10px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.hkq-cal-header {
	width: 100%;
	height: 10px;
	background: #ef4444;
}

.hkq-cal-body {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 800;
	font-family: 'UD Digi Kyokasho NP', serif;
	color: #1e293b;
}

/* Tip Card */
.hkq-learn-tip-card {
	background: #f0fdf4;
	border: 1.5px solid #bbf7d0;
	border-radius: 14px;
	padding: 10px 14px;
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.hkq-tip-icon-wrap {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #dcfce7;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	flex-shrink: 0;
	margin-top: 1px;
}

.hkq-tip-content {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.hkq-tip-title {
	font-size: 12px;
	font-weight: 800;
	color: #166534;
}

.hkq-tip-desc {
	font-size: 12px;
	color: #15803d;
	line-height: 1.4;
}

/* ==========================================================================
   WRITE MODE CUSTOM STYLING (MATCHING REFERENCE UI)
   ========================================================================== */
.hkq-write-practice-card {
	background: #ffffff;
	border: 1.5px solid #e2e8f0;
	border-radius: 16px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02);
	padding: 16px 14px 14px;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
}

.hkq-write-card-header {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-bottom: 12px;
	width: 100%;
}

.hkq-write-title-text {
	font-size: 15px;
	font-weight: 700;
	color: #1e293b;
	letter-spacing: -0.01em;
}

.hkq-write-canvas-box {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	max-width: 270px;
	max-height: 270px;
	background: #ffffff;
	border: 1.5px solid #e2e8f0;
	border-radius: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	margin-bottom: 12px;
	touch-action: none;
}

.hkq-write-canvas-box canvas {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 5;
	cursor: crosshair;
}

.hkq-write-canvas-box .hkq-canvas-guide {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 155px;
	font-family: 'UD Digi Kyokasho NP', 'Noto Serif JP', serif;
	color: #cbd5e1;
	font-weight: 800;
	line-height: 1;
	z-index: 2;
	pointer-events: none;
	opacity: 0.55;
	user-select: none;
}

.hkq-write-canvas-footer {
	width: 100%;
	max-width: 270px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 2px 2px;
	gap: 8px;
}

.hkq-write-btn-group {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.hkq-write-clear-btn {
	height: 30px;
	background: #f8fafc;
	border: 1.5px solid #e2e8f0;
	border-radius: 8px;
	padding: 0 10px;
	font-size: 11.5px;
	font-weight: 700;
	color: #475569;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	white-space: nowrap;
	cursor: pointer;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hkq-write-clear-btn:hover {
	border-color: #4f46e5;
	color: #4f46e5;
	background: #f5f3ff;
	transform: translateY(-1px);
}

.hkq-write-showme-btn {
	height: 30px;
	background: #f5f3ff;
	border: 1.5px solid #c7d2fe;
	border-radius: 8px;
	padding: 0 10px;
	font-size: 11.5px;
	font-weight: 700;
	color: #4f46e5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	white-space: nowrap;
	cursor: pointer;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 1px 3px rgba(79, 70, 229, 0.08);
}

.hkq-write-showme-btn:hover {
	border-color: #4338ca;
	color: #ffffff;
	background: #4f46e5;
	transform: translateY(-1px);
	box-shadow: 0 3px 8px rgba(79, 70, 229, 0.25);
}

.hkq-write-showme-btn.is-playing {
	background: #ede9fe;
	border-color: #818cf8;
	color: #4338ca;
}

.hkq-write-mistakes-label {
	font-size: 12px;
	font-weight: 600;
	color: #64748b;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.hkq-write-mistakes-label strong {
	color: #10b981;
	font-size: 13.5px;
	font-weight: 800;
}

.hkq-write-tip-box {
	background: #f5f3ff;
	border: 1.5px solid #e0e7ff;
}

.hkq-write-tip-box .hkq-tip-icon-wrap {
	background: #ede9fe;
	color: #6366f1;
}

.hkq-write-tip-box .hkq-tip-title {
	color: #4338ca;
}

.hkq-write-tip-box .hkq-tip-desc {
	color: #3730a3;
}

.hkq-write-example-banner {
	background: #f0fdf4;
	border: 1.5px solid #bbf7d0;
}

.hkq-example-badge-label {
	font-size: 11px;
	font-weight: 800;
	color: #16a34a;
	margin-bottom: 2px;
}

/* ==========================================================================
   RECALL MODE CUSTOM STYLING (MATCHING REFERENCE UI)
   ========================================================================== */
.hkq-recall-question-card {
	background: #ffffff;
	border: 1.5px solid #e2e8f0;
	border-radius: 16px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02);
	padding: 16px 14px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
}

.hkq-recall-q-header {
	text-align: center;
}

.hkq-recall-q-title {
	font-size: 15.5px;
	font-weight: 800;
	color: #1e293b;
	letter-spacing: -0.01em;
}

.hkq-recall-q-sub {
	font-size: 12.5px;
	font-weight: 500;
	color: #64748b;
	margin-top: 2px;
}

.hkq-recall-kanji-box {
	position: relative;
	background: linear-gradient(180deg, #f8faff 0%, #f1f5f9 100%);
	border: 1.5px solid #e0e7ff;
	border-radius: 16px;
	padding: 22px 14px 14px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.hkq-recall-tts-btn {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #ede9fe;
	color: #4338ca;
	border: 1.5px solid #c7d2fe;
}

.hkq-recall-tts-btn:hover {
	background: #4f46e5;
	color: #ffffff;
	border-color: #4f46e5;
}

.hkq-recall-char-display {
	font-size: 88px;
	font-family: 'UD Digi Kyokasho NP', 'Noto Serif JP', serif;
	font-weight: 800;
	color: #1e293b;
	line-height: 1;
	margin-bottom: 12px;
}

.hkq-recall-pills-row {
	display: flex;
	gap: 8px;
	justify-content: center;
	flex-wrap: wrap;
}

.hkq-recall-pill {
	padding: 3px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 700;
}

.hkq-pill-kun {
	background: #eff6ff;
	color: #2563eb;
	border: 1px solid #bfdbfe;
}

.hkq-pill-on {
	background: #f5f3ff;
	color: #6366f1;
	border: 1px solid #ddd6fe;
}

.hkq-recall-hint-card {
	background: #f0fdf4;
	border: 1.5px solid #bbf7d0;
	border-radius: 14px;
	padding: 10px 12px;
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.hkq-hint-icon-wrap {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #dcfce7;
	color: #16a34a;
	font-size: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	margin-top: 1px;
}

.hkq-hint-content {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.hkq-hint-title {
	font-size: 12px;
	font-weight: 800;
	color: #166534;
}

.hkq-hint-desc {
	font-size: 12px;
	color: #15803d;
	line-height: 1.4;
}

.hkq-recall-remember-card {
	background: #f0f9ff;
	border: 1.5px solid #bae6fd;
	border-radius: 14px;
	padding: 10px 12px;
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.hkq-remember-icon-wrap {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #e0f2fe;
	color: #0284c7;
	font-size: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	margin-top: 1px;
}

.hkq-remember-content {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.hkq-remember-title {
	font-size: 12px;
	font-weight: 800;
	color: #0369a1;
}

.hkq-remember-desc {
	font-size: 12px;
	color: #0284c7;
	line-height: 1.4;
}

/* Right Column: Multiple Choice Options */
.hkq-recall-options-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
}

.hkq-recall-option-card {
	position: relative;
	width: 100%;
	padding: 14px 18px;
	background: #ffffff;
	border: 1.5px solid #e2e8f0;
	border-radius: 16px;
	display: flex;
	align-items: center;
	gap: 14px;
	cursor: pointer;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
	user-select: none;
}

.hkq-recall-option-card:hover {
	border-color: #6366f1;
	background: #faf5ff;
	transform: translateY(-1px);
}

.hkq-opt-letter-badge {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #ede9fe;
	color: #4338ca;
	font-size: 14.5px;
	font-weight: 800;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: all 0.2s ease;
}

.hkq-opt-text-wrap {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.hkq-opt-main-meaning {
	font-size: 16px;
	font-weight: 700;
	color: #1e293b;
	line-height: 1.2;
}

.hkq-opt-subtext {
	font-size: 13px;
	font-weight: 500;
	color: #64748b;
}

/* Selected state */
.hkq-recall-option-card.is-selected {
	border-color: #4f46e5;
	background: #f5f3ff;
	box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* Correct state */
.hkq-recall-option-card.is-correct {
	border-color: #16a34a !important;
	background: #f0fdf4 !important;
	box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2) !important;
}

.hkq-recall-option-card.is-correct .hkq-opt-letter-badge {
	background: #dcfce7 !important;
	color: #15803d !important;
}

.hkq-recall-option-card.is-correct .hkq-opt-main-meaning {
	color: #166534 !important;
}

/* Wrong state */
.hkq-recall-option-card.is-wrong {
	border-color: #dc2626 !important;
	background: #fef2f2 !important;
	box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2) !important;
}

.hkq-recall-option-card.is-wrong .hkq-opt-letter-badge {
	background: #fee2e2 !important;
	color: #b91c1c !important;
}

.hkq-recall-option-card.is-wrong .hkq-opt-main-meaning {
	color: #991b1b !important;
}

/* Status icon badge */
.hkq-option-status-icon {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 900;
	margin-left: auto;
	flex-shrink: 0;
}

.hkq-option-status-icon.is-correct-icon {
	background: #dcfce7;
	color: #16a34a;
}

.hkq-option-status-icon.is-wrong-icon {
	background: #fee2e2;
	color: #dc2626;
}

/* Disabled button state */
.hkq-start-practice-btn.hkq-btn-disabled,
.hkq-start-practice-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	pointer-events: none;
	filter: grayscale(0.25);
}

/* Bottom Full-Width CTA */
.hkq-learn-footer {
	margin-top: 6px;
	padding-bottom: 4px;
}

.hkq-learn-footer-row {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 100%;
}

.hkq-jump-practice-link {
	background: none;
	border: none;
	color: #6366f1;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	padding: 4px 8px;
	text-decoration: underline;
	transition: color 0.2s ease;
}

.hkq-jump-practice-link:hover {
	color: #4338ca;
}

.hkq-start-practice-btn {
	width: 100%;
	padding: 14px 24px;
	background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
	color: #ffffff;
	font-size: 15px;
	font-weight: 700;
	border: none;
	border-radius: 14px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-shadow: 0 6px 18px -3px rgba(79, 70, 229, 0.35);
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	letter-spacing: 0.01em;
}

.hkq-start-practice-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 24px -3px rgba(79, 70, 229, 0.45);
	background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
}

.hkq-start-practice-btn .hkq-arrow {
	font-size: 17px;
	transition: transform 0.2s ease;
}

.hkq-start-practice-btn:hover .hkq-arrow {
	transform: translateX(4px);
}

/* --- Review Tab Styling --- */
.hkq-review-modal-wrap {
	padding: 24px 28px 28px;
	text-align: center;
}

.hkq-review-hero {
	margin-bottom: 20px;
}

.hkq-review-stars-banner {
	font-size: 32px;
	margin-bottom: 6px;
	letter-spacing: 3px;
}

.hkq-review-score-headline {
	font-size: 22px;
	font-weight: 800;
	color: #0f172a;
	margin-bottom: 4px;
}

.hkq-review-score-sub {
	font-size: 13.5px;
	font-weight: 600;
	color: #64748b;
}

.hkq-review-grid-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
	gap: 10px;
	margin-bottom: 24px;
	text-align: left;
}

.hkq-review-char-card {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 12px;
	border: 1.5px solid;
	transition: all 0.2s ease;
}

.hkq-review-char-card.is-passed {
	background: #f0fdf4;
	border-color: #bbf7d0;
}

.hkq-review-char-card.is-failed {
	background: #fef2f2;
	border-color: #fecaca;
}

.hkq-rev-char {
	font-size: 26px;
	font-family: 'UD Digi Kyokasho NP', serif;
	font-weight: 700;
	line-height: 1;
}

.hkq-rev-info {
	flex: 1;
	overflow: hidden;
}

.hkq-rev-meaning {
	font-size: 11.5px;
	font-weight: 700;
	color: #1e293b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.hkq-rev-reading {
	font-size: 10.5px;
	color: #64748b;
}

.hkq-rev-badge {
	font-size: 15px;
}

.hkq-review-footer-buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: 380px;
	margin: 0 auto;
}

.hkq-quest-already-done {
	padding: 12px;
	background: #f0fdf4;
	color: #16a34a;
	font-weight: 700;
	font-size: 14px;
	border-radius: 12px;
	border: 1.5px solid #bbf7d0;
}

.hkq-review-secondary-row {
	display: flex;
	gap: 10px;
}

.hkq-review-sec-btn {
	flex: 1;
	padding: 10px;
	background: #ffffff;
	border: 1.5px solid #e2e8f0;
	border-radius: 10px;
	font-size: 12.5px;
	font-weight: 700;
	color: #475569;
	cursor: pointer;
	transition: all 0.2s ease;
}

.hkq-review-sec-btn:hover {
	border-color: #4f46e5;
	color: #4338ca;
	background: #f8fafc;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
	.hkq-learn-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}
	.hkq-learn-wrapper {
		padding: 14px 16px 18px;
	}
	.hkq-stepper {
		padding: 10px 14px;
		overflow-x: auto;
	}
	.hkq-step-labels {
		display: none;
	}
	.hkq-learn-main-char {
		font-size: 90px;
	}
}
