/* ============================================================
 * Puhekieli page — /puhekieli/
 * ============================================================ */
.pk { max-width: 1240px; margin: 0 auto; padding: 16px 22px 48px; color: #0f172a; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }

/* ---------- Header ---------- */
.pk-top { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; margin-bottom: 16px; }
.pk-top-title { display: flex; align-items: center; gap: 12px; }
.pk-top-icon { width: 46px; height: 46px; border-radius: 13px; background: linear-gradient(135deg, #eff6ff, #dbeafe); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.pk-h1 { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.025em; margin: 0; }
.pk-sub { color: #64748b; font-size: 13px; margin: 2px 0 0; }
.pk-search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #e2e8f0; border-radius: 11px; padding: 9px 14px; color: #94a3b8; max-width: 440px; width: 100%; justify-self: center; transition: border-color 120ms, box-shadow 120ms; }
.pk-search:focus-within { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
.pk-search input { border: none; outline: none; background: transparent; font: inherit; font-size: 13.5px; color: #0f172a; width: 100%; }
.pk-top-actions { display: flex; gap: 8px; }
.pk-btn { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #e2e8f0; padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 700; color: #0f172a; text-decoration: none; transition: all 120ms; }
.pk-btn:hover { background: #f8fafc; color: #0f172a; text-decoration: none; }

/* ---------- Tabs ---------- */
.pk-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #f1f5f9; padding: 5px; border-radius: 13px; margin-bottom: 16px; }
.pk-tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border: none; background: transparent; border-radius: 9px; font: inherit; font-size: 14px; font-weight: 700; color: #64748b; cursor: pointer; transition: all 140ms; }
.pk-tab:hover { color: #0f172a; }
.pk-tab-on { background: #2563eb; color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,0.32); }
.pk-tab-on:hover { color: #fff; }

/* ---------- Category pills ---------- */
.pk-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pk-pill { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border: 1px solid #e2e8f0; background: #fff; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 700; color: #475569; cursor: pointer; transition: all 120ms; }
.pk-pill:hover { border-color: #cbd5e1; background: #f8fafc; }
.pk-pill-ic { font-size: 15px; }
.pk-pill-on { border-color: #fca5a5; background: #fef2f2; color: #dc2626; }

/* ---------- Layout ---------- */
.pk-layout { display: grid; grid-template-columns: 1fr 288px; gap: 16px; align-items: start; }

/* ---------- Category card ---------- */
.pk-cat { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 18px; }
.pk-cat[hidden] { display: none !important; }
.pk-cat-head { display: grid; grid-template-columns: 48px 1fr auto; gap: 13px; align-items: center; margin-bottom: 14px; }
.pk-cat-icon { width: 48px; height: 48px; border-radius: 13px; background: linear-gradient(135deg, #fdf2f8, #fce7f3); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.pk-cat-title { font-size: 1.05rem; font-weight: 900; letter-spacing: -0.01em; margin: 0; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.pk-cat-cnt { font-size: 11px; font-weight: 700; color: #2563eb; background: #eff6ff; border: 1px solid #bfdbfe; padding: 2px 9px; border-radius: 999px; }
.pk-cat-desc { color: #64748b; font-size: 12.5px; margin: 3px 0 0; }
.pk-view-toggle { display: flex; gap: 3px; background: #f1f5f9; padding: 3px; border-radius: 9px; }
.pk-view { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border: none; background: transparent; border-radius: 7px; font: inherit; font-size: 12px; font-weight: 700; color: #64748b; cursor: pointer; transition: all 120ms; }
.pk-view-on { background: #fff; color: #2563eb; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* ---------- Table ---------- */
.pk-table-wrap { border: 1px solid #f1f5f9; border-radius: 12px; overflow: hidden; }
.pk-thead, .pk-row { display: grid; grid-template-columns: 1fr 1fr 0.85fr 1.5fr 64px; gap: 12px; align-items: center; }
.pk-thead { background: #fdf2f8; border-bottom: 1px solid #fbe3ee; padding: 11px 16px; font-size: 11px; font-weight: 800; color: #9d6383; text-transform: uppercase; letter-spacing: 0.03em; }
.pk-rows { display: flex; flex-direction: column; }
.pk-row { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; transition: background 100ms; }
.pk-row:last-child { border-bottom: none; }
.pk-row:hover { background: #fafbfc; }
.pk-row[hidden] { display: none; }

.pk-c-kirja { display: flex; align-items: center; gap: 8px; }
.pk-kirja-w { font-size: 14px; font-weight: 700; color: #0f172a; }
.pk-arrow { color: #cbd5e1; flex-shrink: 0; }
.pk-c-puhe { min-width: 0; }
.pk-puhe-w { background: none; border: none; padding: 0; font: inherit; font-size: 14.5px; font-weight: 800; color: #db2777; cursor: pointer; text-align: left; letter-spacing: -0.01em; transition: color 120ms; }
.pk-puhe-w:hover { color: #be185d; text-decoration: underline; }
.pk-c-vi { font-size: 13.5px; color: #334155; font-weight: 500; }
.pk-c-ex { min-width: 0; }
.pk-ex-fi { font-size: 13px; font-weight: 600; color: #0f172a; }
.pk-ex-vi { font-size: 11.5px; color: #94a3b8; font-style: italic; margin-top: 1px; }
.pk-c-acts { display: flex; gap: 4px; justify-content: flex-end; }
.pk-audio { background: #f1f5f9; border: none; border-radius: 8px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; color: #2563eb; cursor: pointer; transition: all 120ms; }
.pk-audio:hover, .pk-audio.pk-playing { background: #2563eb; color: #fff; }
.pk-fav { background: transparent; border: none; width: 28px; height: 28px; border-radius: 8px; color: #cbd5e1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all 120ms; }
.pk-fav:hover { background: #f1f5f9; color: #f59e0b; }
.pk-fav-on { color: #f59e0b; }
.pk-fav-on svg { fill: #f59e0b; }

/* display modes (radio: all / puhe / kirja) */
.pk-main.pk-only-puhe .pk-c-kirja, .pk-main.pk-only-puhe .pk-thead > div:nth-child(1) { visibility: hidden; }
.pk-main.pk-only-kirja .pk-c-puhe, .pk-main.pk-only-kirja .pk-thead > div:nth-child(2) { visibility: hidden; }
/* utilities: example + translation visibility */
.pk-main.pk-no-ex .pk-c-ex, .pk-main.pk-no-ex .pk-thead > div:nth-child(4) { visibility: hidden; }
.pk-main.pk-no-vi .pk-ex-vi { display: none; }

/* collapsed rows (initial paint, before JS takes over) */
.pk-rows.pk-collapsed .pk-row:nth-child(n+9) { display: none; }

.pk-seeall { display: flex; align-items: center; gap: 6px; width: fit-content; margin: 12px auto 0; padding: 8px 16px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 9px; font: inherit; font-size: 12.5px; font-weight: 700; color: #475569; cursor: pointer; transition: all 120ms; }
.pk-seeall:hover { background: #f1f5f9; color: #0f172a; }
.pk-seeall.pk-open svg { transform: rotate(180deg); }
.pk-seeall svg { transition: transform 200ms; }

.pk-empty { text-align: center; padding: 32px 16px; color: #94a3b8; }
.pk-empty p { font-weight: 700; margin: 6px 0 0; }

/* ---------- Card view ---------- */
.pk-table-wrap.pk-cards { border: none; overflow: visible; }
.pk-table-wrap.pk-cards .pk-thead { display: none; }
.pk-table-wrap.pk-cards .pk-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.pk-table-wrap.pk-cards .pk-row { display: flex; flex-direction: column; align-items: stretch; gap: 6px; border: 1px solid #e2e8f0; border-radius: 12px; padding: 13px; position: relative; }
.pk-table-wrap.pk-cards .pk-row:hover { border-color: #fbcfe8; box-shadow: 0 4px 14px rgba(15,23,42,0.06); }
.pk-table-wrap.pk-cards .pk-c-kirja { gap: 6px; }
.pk-table-wrap.pk-cards .pk-kirja-w { font-size: 13px; color: #64748b; font-weight: 600; }
.pk-table-wrap.pk-cards .pk-puhe-w { font-size: 17px; }
.pk-table-wrap.pk-cards .pk-c-vi { font-size: 13px; }
.pk-table-wrap.pk-cards .pk-c-ex { border-top: 1px dashed #f1f5f9; padding-top: 7px; margin-top: 1px; }
.pk-table-wrap.pk-cards .pk-c-acts { position: absolute; top: 10px; right: 10px; }

/* ---------- Filters sidebar ---------- */
.pk-filters { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 16px; position: sticky; top: 16px; }
.admin-bar .pk-filters { top: 46px; }
.pk-filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pk-filters-head span { font-size: 13px; font-weight: 800; letter-spacing: 0.04em; color: #0f172a; }
.pk-reset { background: none; border: none; font: inherit; font-size: 12px; font-weight: 700; color: #2563eb; cursor: pointer; }
.pk-reset:hover { text-decoration: underline; }
.pk-f-group { padding: 12px 0; border-top: 1px solid #f1f5f9; }
.pk-f-label { font-size: 11px; font-weight: 800; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 9px; }
.pk-radio, .pk-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: #334155; padding: 5px 2px; cursor: pointer; }
.pk-radio input, .pk-check input { width: 15px; height: 15px; accent-color: #2563eb; cursor: pointer; }
.pk-lv { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 5px; }
.pk-lv-a1 { background: #dbeafe; color: #1e40af; }
.pk-lv-a2 { background: #d1fae5; color: #065f46; }
.pk-lv-b1 { background: #fef3c7; color: #92400e; }
.pk-lv-b2 { background: #fee2e2; color: #991b1b; }

.pk-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 600; color: #334155; padding: 6px 2px; cursor: pointer; }
.pk-toggle input { display: none; }
.pk-toggle i { position: relative; width: 36px; height: 20px; background: #cbd5e1; border-radius: 999px; transition: background 160ms; flex-shrink: 0; }
.pk-toggle i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform 160ms; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.pk-toggle input:checked + i { background: #2563eb; }
.pk-toggle input:checked + i::after { transform: translateX(16px); }

.pk-tip { display: flex; gap: 10px; margin-top: 12px; padding: 13px; background: linear-gradient(135deg, #fffbeb, #fef3c7); border: 1px solid #fde68a; border-radius: 12px; }
.pk-tip-ic { font-size: 20px; }
.pk-tip strong { font-size: 12.5px; color: #92400e; }
.pk-tip p { font-size: 11.5px; color: #a16207; margin: 3px 0 0; line-height: 1.45; }

/* ---------- Bottom quick cards ---------- */
.pk-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.pk-quick-card { display: grid; grid-template-columns: 44px 1fr auto; gap: 11px; align-items: center; text-align: left; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px; font: inherit; cursor: pointer; transition: all 130ms; }
.pk-quick-card:hover { border-color: #bfdbfe; box-shadow: 0 4px 14px rgba(15,23,42,0.06); transform: translateY(-1px); }
.pk-quick-ic { width: 44px; height: 44px; border-radius: 12px; background: #f8fafc; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.pk-quick-name { display: block; font-size: 12.5px; font-weight: 900; color: #0f172a; }
.pk-quick-cnt { font-size: 10px; font-weight: 700; color: #2563eb; background: #eff6ff; padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.pk-quick-desc { display: block; font-size: 11.5px; color: #64748b; margin-top: 2px; }
.pk-quick-card svg { color: #cbd5e1; }

/* ---------- Coming-soon panel ---------- */
.pk-panel[hidden] { display: none !important; }
.pk-row[hidden] { display: none !important; }
.pk-soon { text-align: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 48px 24px; }
.pk-soon-ic { font-size: 52px; margin-bottom: 12px; }
.pk-soon h2 { font-size: 1.25rem; font-weight: 900; margin: 0 0 8px; }
.pk-soon p { color: #64748b; font-size: 13.5px; line-height: 1.6; max-width: 520px; margin: 0 auto 16px; }
.pk-soon-btn { background: #2563eb; color: #fff; border: none; padding: 10px 18px; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.pk-soon-btn:hover { background: #1d4ed8; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
	.pk-layout { grid-template-columns: 1fr; }
	.pk-filters { position: static; }
	.pk-quick { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
	.pk-top { grid-template-columns: 1fr; gap: 10px; }
	.pk-search { max-width: none; }
	.pk-top-actions { justify-content: flex-start; }
	.pk-thead { display: none; }
	.pk-row { grid-template-columns: 1fr auto; grid-template-areas: "kirja acts" "puhe acts" "vi acts" "ex ex"; gap: 4px 12px; }
	.pk-c-kirja { grid-area: kirja; }
	.pk-c-puhe { grid-area: puhe; }
	.pk-c-vi { grid-area: vi; }
	.pk-c-ex { grid-area: ex; border-top: 1px dashed #f1f5f9; padding-top: 7px; margin-top: 5px; }
	.pk-c-acts { grid-area: acts; align-items: flex-start; }
	.pk-main.pk-only-puhe .pk-c-kirja, .pk-main.pk-only-kirja .pk-c-puhe { display: none; }

	/* Pill chủ đề: 1 hàng cuộn ngang để nội dung nằm cao, khỏi cuộn xa */
	.pk-pills { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; scrollbar-width: none; }
	.pk-pills::-webkit-scrollbar { display: none; }
	.pk-pill { flex: 0 0 auto; white-space: nowrap; }
}
