/* ============================================================
 * Luyện câu hỏi — /kysymykset/ (typing practice)
 * ============================================================ */
.kq { max-width: 1080px; margin: 0 auto; padding: 16px 22px 48px; color: #0f172a; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }

/* ---------- Header ---------- */
.kq-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.kq-title-row { display: flex; align-items: center; gap: 12px; }
.kq-back { width: 34px; height: 34px; border-radius: 9px; background: #fff; border: 1px solid #e2e8f0; display: inline-flex; align-items: center; justify-content: center; color: #475569; text-decoration: none; transition: all 120ms; }
.kq-back:hover { background: #f8fafc; color: #0f172a; }
.kq-h1 { font-size: 1.4rem; font-weight: 900; letter-spacing: -0.025em; margin: 0; }
.kq-saved-btn { display: inline-flex; align-items: center; gap: 7px; background: #fff; border: 1px solid #e2e8f0; padding: 8px 14px; border-radius: 10px; font: inherit; font-size: 12.5px; font-weight: 700; color: #475569; cursor: pointer; transition: all 120ms; }
.kq-saved-btn:hover { background: #f8fafc; }
.kq-saved-btn.on { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }

/* ---------- Controls ---------- */
.kq-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.kq-modes { display: flex; gap: 8px; flex-wrap: wrap; }
.kq-mode { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border: 1px solid #e2e8f0; background: #fff; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 700; color: #475569; cursor: pointer; transition: all 120ms; }
.kq-mode:hover { background: #f8fafc; }
.kq-mode-on { background: #2563eb; border-color: #2563eb; color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,0.28); }
.kq-mode-on:hover { background: #1d4ed8; }
.kq-vi-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border: 1px solid #e2e8f0; background: #fff; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 700; color: #475569; cursor: pointer; transition: all 120ms; }
.kq-vi-toggle:hover { background: #f8fafc; }
.kq-vi-toggle.on { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.kq-vi-toggle b { font-weight: 800; }
.kq-today { font-size: 12.5px; color: #64748b; font-weight: 600; }
.kq-today b { color: #2563eb; font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ---------- Category chips ---------- */
.kq-cats { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.kq-cat { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid #e2e8f0; background: #fff; border-radius: 9px; font: inherit; font-size: 12.5px; font-weight: 700; color: #475569; cursor: pointer; transition: all 120ms; }
.kq-cat:hover { border-color: #cbd5e1; background: #f8fafc; }
.kq-cat-n { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10.5px; font-weight: 700; color: #94a3b8; background: #f1f5f9; padding: 1px 7px; border-radius: 999px; }
.kq-cat-on { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.kq-cat-on .kq-cat-n { background: #fff; color: #2563eb; }

/* ---------- LIST (Danh sách: đọc & học) ---------- */
.kq-listview[hidden] { display: none; }
.kq-listview { background: #fff; border: 1px solid #e2e8f0; border-radius: 18px; padding: 8px 20px 16px; }
.kq-list-head { display: flex; align-items: center; gap: 13px; padding: 16px 4px; border-bottom: 1px solid #f1f5f9; margin-bottom: 4px; }
.kq-lh-ic { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg, #eff6ff, #dbeafe); display: flex; align-items: center; justify-content: center; font-size: 23px; }
.kq-lh-name { font-size: 1.1rem; font-weight: 900; letter-spacing: -0.015em; }
.kq-lh-sub { font-size: 12px; color: #94a3b8; font-weight: 600; margin-top: 1px; }
.kq-list-items { display: flex; flex-direction: column; }
.kq-li { padding: 16px 4px; border-bottom: 1px solid #f1f5f9; }
.kq-li:last-child { border-bottom: none; }
.kq-li-q { display: flex; align-items: flex-start; gap: 12px; }
.kq-li-audio { flex-shrink: 0; background: #eff6ff; border: none; border-radius: 9px; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; color: #2563eb; cursor: pointer; transition: all 120ms; }
.kq-li-audio:hover, .kq-li-audio.kq-playing { background: #2563eb; color: #fff; }
.kq-li-audio-sm { width: 26px; height: 26px; background: #f1f5f9; }
.kq-li-qtext { min-width: 0; }
.kq-li-fi { font-size: 16px; font-weight: 800; color: #0f172a; letter-spacing: -0.01em; }
.kq-li-vi { font-size: 13px; color: #64748b; margin-top: 1px; }
.kq-li-a { display: flex; align-items: flex-start; gap: 9px; margin-top: 9px; padding: 9px 12px; background: #f8fafc; border-radius: 10px; }
.kq-li-a > div { font-size: 13.5px; line-height: 1.45; }
.kq-li-alabel { font-size: 10.5px; font-weight: 800; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.03em; }
.kq-li-afi { font-weight: 700; color: #059669; }
.kq-li-avi { color: #94a3b8; font-style: italic; }
.kq-list-empty { text-align: center; color: #94a3b8; padding: 30px; font-weight: 600; }

/* ---------- Stage ---------- */
.kq-stage { display: flex; flex-direction: column; gap: 14px; }
.kq-card { position: relative; background: #fff; border: 1px solid #e2e8f0; border-radius: 18px; padding: 36px 28px; text-align: center; overflow: hidden; }
.kq-card::after { content: ''; position: absolute; inset: 0; background:
	radial-gradient(circle at 12% 100%, rgba(37,99,235,0.05) 0 18px, transparent 19px),
	linear-gradient(180deg, transparent 60%, rgba(37,99,235,0.04) 100%); pointer-events: none; }
.kq-bookmark { position: absolute; top: 14px; right: 14px; z-index: 2; width: 34px; height: 34px; border-radius: 9px; background: #f8fafc; border: 1px solid #e2e8f0; display: inline-flex; align-items: center; justify-content: center; color: #94a3b8; cursor: pointer; transition: all 120ms; }
.kq-bookmark:hover { color: #2563eb; border-color: #bfdbfe; }
.kq-bookmark.on { color: #f59e0b; border-color: #fde68a; background: #fffbeb; }
.kq-bookmark.on svg { fill: #f59e0b; }
.kq-num { position: relative; display: inline-block; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; font-weight: 800; color: #2563eb; background: #eff6ff; padding: 4px 14px; border-radius: 999px; margin-bottom: 16px; letter-spacing: 0.02em; }
.kq-q { position: relative; font-size: 2rem; font-weight: 800; color: #0f172a; line-height: 1.3; letter-spacing: -0.02em; }
.kq-qvi { position: relative; font-size: 1.05rem; color: #64748b; font-weight: 600; margin-top: 10px; }
.kq-qvi[hidden] { display: none; }
.kq-reveal { position: relative; display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; background: #f8fafc; border: 1px solid #e2e8f0; padding: 8px 16px; border-radius: 9px; font: inherit; font-size: 12.5px; font-weight: 700; color: #475569; cursor: pointer; transition: all 120ms; }
.kq-reveal:hover { background: #f1f5f9; color: #2563eb; }

/* ---------- Type area ---------- */
.kq-type-area[hidden] { display: none; }
.kq-input-wrap { position: relative; }
.kq-input { width: 100%; box-sizing: border-box; border: 1.5px solid #cbd5e1; border-radius: 14px; padding: 16px 18px 26px; font: inherit; font-size: 16px; line-height: 1.5; color: #0f172a; resize: vertical; min-height: 90px; outline: none; transition: border-color 120ms, box-shadow 120ms; }
.kq-input:focus { border-color: #93c5fd; box-shadow: 0 0 0 4px rgba(59,130,246,0.12); }
.kq-input.is-correct { border-color: #10b981; background: #f0fdf4; }
.kq-input.is-ref { border-color: #93c5fd; }
.kq-charcount { position: absolute; right: 14px; bottom: 10px; font-size: 11px; color: #94a3b8; font-family: 'JetBrains Mono', ui-monospace, monospace; }

.kq-feedback { border-radius: 12px; padding: 14px 16px; font-size: 14px; }
.kq-feedback[hidden] { display: none; }
.kq-feedback.ok { background: #ecfdf5; border: 1px solid #a7f3d0; }
.kq-feedback.ref { background: #eff6ff; border: 1px solid #bfdbfe; }
.kq-fb-head { font-weight: 800; font-size: 12.5px; margin-bottom: 6px; }
.kq-feedback.ok .kq-fb-head { color: #059669; }
.kq-feedback.ref .kq-fb-head { color: #2563eb; }
.kq-fb-a { font-weight: 700; color: #0f172a; }
.kq-fb-avi { font-size: 12.5px; color: #64748b; font-style: italic; margin-top: 2px; }

.kq-actions { display: flex; gap: 10px; justify-content: center; }
.kq-skip { display: inline-flex; align-items: center; gap: 6px; padding: 12px 24px; border: 1px solid #e2e8f0; background: #fff; border-radius: 11px; font: inherit; font-size: 14px; font-weight: 700; color: #475569; cursor: pointer; transition: all 120ms; }
.kq-skip:hover { background: #f8fafc; }
.kq-check { display: inline-flex; align-items: center; gap: 6px; padding: 12px 28px; border: none; background: #2563eb; border-radius: 11px; font: inherit; font-size: 14px; font-weight: 800; color: #fff; cursor: pointer; transition: background 120ms; }
.kq-check:hover { background: #1d4ed8; }

/* ---------- Read area ---------- */
.kq-read-area { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 14px; padding: 18px 20px; text-align: center; }
.kq-read-area[hidden] { display: none; }
.kq-read-label { font-size: 11px; font-weight: 800; color: #059669; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.kq-read-a { font-size: 1.25rem; font-weight: 800; color: #065f46; line-height: 1.4; }
.kq-read-avi { font-size: 13px; color: #16a34a; font-style: italic; margin-top: 6px; }

/* ---------- Nav ---------- */
.kq-nav { display: flex; justify-content: center; gap: 10px; }
.kq-prev, .kq-shuffle, .kq-next { display: inline-flex; align-items: center; gap: 6px; padding: 11px 22px; border-radius: 11px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: all 120ms; border: 1px solid #e2e8f0; background: #fff; color: #475569; }
.kq-prev:hover, .kq-shuffle:hover { background: #f8fafc; }
.kq-prev[disabled] { opacity: 0.4; cursor: default; }
.kq-next { background: #2563eb; border-color: #2563eb; color: #fff; }
.kq-next:hover { background: #1d4ed8; }

/* ---------- Hint ---------- */
.kq-hint { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 18px; background: #eff6ff; border: 1px solid #dbeafe; border-radius: 14px; padding: 14px 18px; }
.kq-hint-l { display: flex; gap: 12px; align-items: center; }
.kq-hint-ic { width: 38px; height: 38px; border-radius: 999px; background: #dbeafe; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.kq-hint-h { font-size: 13px; font-weight: 800; color: #1e40af; }
.kq-hint-t { font-size: 12px; color: #475569; line-height: 1.5; margin-top: 2px; max-width: 480px; }
.kq-keys { font-size: 11.5px; color: #64748b; font-weight: 600; }
.kq-key-label { font-weight: 800; color: #0f172a; margin-right: 8px; }
.kq-keys kbd { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10.5px; background: #fff; border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: #334155; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
	.kq-q { font-size: 1.5rem; }
	.kq-controls { flex-direction: column; align-items: stretch; }
	.kq-today { text-align: center; }
	.kq-hint { flex-direction: column; align-items: flex-start; }
	.kq-card { padding: 28px 18px; }

	/* 16 mục lọc: 1 hàng cuộn ngang để danh sách nằm cao, khỏi cuộn xa */
	.kq-cats { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; margin-bottom: 12px; scrollbar-width: none; }
	.kq-cats::-webkit-scrollbar { display: none; }
	.kq-cat { flex: 0 0 auto; white-space: nowrap; }
}
