.sm { max-width: 1380px; margin: 0 auto; padding: 18px 22px 48px; color: #0a0a0a; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }

.sm-top { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.sm-title { font-size: 1.55rem; font-weight: 900; letter-spacing: -0.025em; margin: 0; }
.sm-sub { color: #64748b; font-size: 12.5px; margin-top: 2px; }
.sm-sub strong { color: #0a0a0a; font-weight: 700; }

.sm-modes { display: flex; gap: 4px; background: #f1f5f9; padding: 4px; border-radius: 11px; justify-self: center; }
.sm-mode { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; color: #64748b; text-decoration: none; transition: all 120ms; white-space: nowrap; }
.sm-mode:hover { color: #0a0a0a; text-decoration: none; }
.sm-mode.on { background: #2563eb; color: white; box-shadow: 0 1px 3px rgba(37,99,235,0.3); }
.sm-mode.on:hover { color: white; text-decoration: none; }
.sm-mode-num { font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 700; opacity: 0.7; }
.sm-mode.on .sm-mode-num { opacity: 1; }

.sm-top-r { display: flex; gap: 6px; }
.sm-btn-ghost { display: inline-flex; align-items: center; gap: 6px; background: white; border: 1px solid #e2e8f0; padding: 7px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: #0a0a0a; text-decoration: none; transition: all 120ms; }
.sm-btn-ghost:hover { background: #f8fafc; color: #0a0a0a; text-decoration: none; }

.sm-grid { display: grid; grid-template-columns: 220px 260px 1fr; gap: 14px; align-items: start; }
@media (max-width: 1180px) { .sm-grid { grid-template-columns: 200px 240px 1fr; gap: 10px; } }
@media (max-width: 980px)  { .sm-grid { grid-template-columns: 220px 1fr; } .sm-mid { display: none; } }
@media (max-width: 900px)  { .sm-grid { grid-template-columns: 1fr; } .sm-mid { display: none; } }

.sm-col { background: white; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px 12px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.sm-col::-webkit-scrollbar { width: 4px; }
.sm-col::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 999px; }
.sm-col-h { font-size: 15px; font-weight: 800; color: #0a0a0a; padding: 4px 8px 12px; letter-spacing: -0.01em; }

.sm-topic-list { display: flex; flex-direction: column; gap: 3px; }
.sm-topic { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 10px; text-decoration: none; color: #0a0a0a; transition: all 120ms; border: 1px solid transparent; }
.sm-topic:hover { background: #f8fafc; color: #0a0a0a; text-decoration: none; }
.sm-topic.on { background: #eff6ff; border-color: #bfdbfe; }
.sm-topic-icon { width: 30px; height: 30px; border-radius: 8px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.sm-topic.on .sm-topic-icon { background: white; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.sm-topic-text { min-width: 0; }
.sm-topic-vn { display: block; font-size: 13px; font-weight: 700; color: #0a0a0a; line-height: 1.15; }
.sm-topic.on .sm-topic-vn { color: #1d4ed8; }
.sm-topic-fi { display: block; font-size: 10.5px; color: #94a3b8; line-height: 1.2; margin-top: 1px; }
.sm-topic-cnt { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; color: #94a3b8; font-weight: 700; background: #f1f5f9; padding: 2px 7px; border-radius: 999px; flex-shrink: 0; }
.sm-topic.on .sm-topic-cnt { background: white; color: #2563eb; }

.sm-mid { display: flex; flex-direction: column; gap: 12px; background: transparent; border: none; padding: 0; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.sm-widget { background: white; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px 12px; }
.sm-widget-h { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #0a0a0a; padding: 0 4px 10px; }
.sm-widget-help { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 999px; background: #f1f5f9; color: #94a3b8; font-size: 11px; font-weight: 700; margin-left: auto; cursor: help; }

/* Sub-categories list */
.sm-subs { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.sm-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: #0a0a0a; transition: all 120ms; border: 1px solid transparent; }
.sm-sub:hover { background: #f8fafc; color: #0a0a0a; text-decoration: none; }
.sm-sub.on { background: #eff6ff; border-color: #bfdbfe; }
.sm-sub-name { font-size: 12.5px; font-weight: 700; color: #1e293b; }
.sm-sub.on .sm-sub-name { color: #1d4ed8; }
.sm-sub-cnt { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10.5px; color: #94a3b8; font-weight: 700; background: #f1f5f9; padding: 2px 7px; border-radius: 999px; }
.sm-sub.on .sm-sub-cnt { background: white; color: #2563eb; }

.sm-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 0 4px; }
.sm-stat { background: #f8fafc; border-radius: 8px; padding: 8px 6px; text-align: center; }
.sm-stat-n { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 15px; font-weight: 800; color: #0a0a0a; }
.sm-stat-l { font-size: 10px; color: #64748b; font-weight: 600; margin-top: 1px; }
.sm-stat-a1 { background: #dbeafe; }
.sm-stat-a1 .sm-stat-n { color: #1e40af; }
.sm-stat-a2 { background: #d1fae5; }
.sm-stat-a2 .sm-stat-n { color: #065f46; }

.sm-case-base { display: flex; align-items: center; gap: 6px; padding: 0 8px 10px; font-size: 11px; color: #64748b; border-bottom: 1px dashed #f1f5f9; margin-bottom: 8px; }
.sm-case-base-w { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; font-weight: 800; color: #2563eb; text-decoration: none; }
.sm-case-base-w:hover { text-decoration: underline; color: #1d4ed8; }
.sm-case-base-audio { background: #eff6ff; border: none; border-radius: 5px; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; color: #2563eb; cursor: pointer; }
.sm-case-base-audio:hover, .sm-case-base-audio.sm-playing { background: #2563eb; color: white; }

.sm-cases { display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.sm-case { display: flex; gap: 8px; align-items: center; }
.sm-case-dot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.sm-case-text { min-width: 0; flex: 1; }
.sm-case-name { font-size: 12px; font-weight: 700; color: #0a0a0a; }
.sm-case-vn { color: #94a3b8; font-weight: 500; font-size: 11px; }
.sm-case-ex { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px; color: #2563eb; font-weight: 600; margin-top: 1px; }
.sm-case-more { display: inline-flex; align-items: center; gap: 4px; margin: 10px 4px 0; padding: 7px 10px; background: #eff6ff; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: #2563eb; text-decoration: none; }
.sm-case-more:hover { background: #dbeafe; text-decoration: none; }

.sm-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.sm-hero { display: grid; grid-template-columns: 200px 1fr 160px; gap: 16px; padding: 14px; background: white; border: 1px solid #e2e8f0; border-radius: 14px; align-items: center; }
.sm-hero-image { aspect-ratio: 16/10; border-radius: 12px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.sm-hero-emoji { font-size: 56px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
.sm-hero-body { min-width: 0; }
.sm-hero-crumb { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: #94a3b8; font-weight: 500; margin-bottom: 4px; }
.sm-hero-crumb a { color: #94a3b8; text-decoration: none; }
.sm-hero-crumb a:hover { color: #2563eb; text-decoration: none; }
.sm-hero-titlerow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sm-hero-title { font-size: 1.4rem; font-weight: 900; letter-spacing: -0.02em; margin: 0; color: #0a0a0a; }
.sm-hero-fi { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.95rem; font-weight: 700; color: #2563eb; }
.sm-hero-audio { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; color: #2563eb; cursor: pointer; }
.sm-hero-audio:hover, .sm-hero-audio.sm-playing { background: #2563eb; color: white; }
.sm-hero-desc { color: #475569; font-size: 13px; line-height: 1.5; margin: 8px 0; }
.sm-hero-chips { display: flex; gap: 6px; flex-wrap: wrap; }

.sm-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.sm-chip-a1 { background: #dbeafe; color: #1e40af; }
.sm-chip-a2 { background: #d1fae5; color: #065f46; }
.sm-chip-b1 { background: #fef3c7; color: #92400e; }
.sm-chip-b2 { background: #fee2e2; color: #991b1b; }
.sm-chip-blue { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.sm-chip-soft { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }

.sm-hero-progress { text-align: center; }
.sm-hero-prog-l { font-size: 10.5px; color: #64748b; font-weight: 600; margin-bottom: 4px; letter-spacing: 0.02em; text-transform: uppercase; }
.sm-hero-prog-ring { position: relative; width: 78px; height: 78px; margin: 0 auto; }
.sm-hero-prog-ring svg { width: 100%; height: 100%; }
.sm-hero-prog-fg { transition: stroke-dasharray 600ms; }
.sm-hero-prog-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 16px; font-weight: 800; color: #2563eb; }
.sm-hero-prog-frac { font-size: 11px; color: #475569; font-weight: 600; margin-top: 4px; }

.sm-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: white; border: 1px solid #e2e8f0; border-radius: 12px; }
.sm-play-all { display: inline-flex; align-items: center; gap: 6px; background: #2563eb; color: white; border: none; padding: 7px 13px; border-radius: 8px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.sm-play-all:hover { background: #1d4ed8; }
.sm-bar-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sm-bar-l { font-size: 12px; color: #64748b; font-weight: 600; }
.sm-bar-sel { background: white; border: 1px solid #e2e8f0; padding: 4px 8px; border-radius: 6px; font-family: inherit; font-size: 12px; font-weight: 600; color: #0a0a0a; cursor: pointer; }
.sm-bar-r { margin-left: auto; display: flex; gap: 4px; background: #f1f5f9; padding: 3px; border-radius: 7px; }
.sm-view { background: transparent; border: none; width: 26px; height: 26px; border-radius: 5px; color: #64748b; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sm-view-on { background: white; color: #2563eb; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

.sm-table-wrap { background: white; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; }
.sm-thead, .sm-row-main { display: grid; grid-template-columns: 36px 44px 1.4fr 1fr 0.7fr 0.5fr 0.9fr 0.9fr; gap: 10px; align-items: center; padding: 10px 14px; }
.sm-thead { background: #f8fafc; border-bottom: 1px solid #e2e8f0; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10.5px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; }
.sm-rows { display: flex; flex-direction: column; }
.sm-row { border-bottom: 1px solid #f1f5f9; transition: background 100ms; }
.sm-row:hover { background: #fafbfc; }
.sm-row:last-child { border-bottom: none; }

/* ===== GRID VIEW (dạng lưới thẻ) ===== */
.sm-rows-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 12px; }
.sm-rows-grid .sm-row { border: 1px solid #e2e8f0; border-radius: 12px; background: white; }
.sm-rows-grid .sm-row:hover { background: white; border-color: #cbd5e1; box-shadow: 0 4px 14px rgba(15,23,42,0.06); transform: translateY(-1px); }
.sm-rows-grid .sm-row-main { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 14px; }
.sm-rows-grid .sm-row-audio { order: 0; }
.sm-rows-grid .sm-row-thumb { display: none; }
.sm-rows-grid .sm-row-word { order: 1; flex: 1 1 auto; min-width: 0; }
.sm-rows-grid .sm-row-vi { order: 2; flex: 1 1 100%; }
.sm-rows-grid .sm-row-type { display: none; }
.sm-rows-grid .sm-row-main > div:has(> .sm-chip) { order: 3; flex: 0 0 auto; }
.sm-rows-grid .sm-row-prog { order: 4; flex: 1 1 100%; }
.sm-rows-grid .sm-row-acts { order: 5; flex: 1 1 100%; justify-content: flex-start; padding-top: 6px; border-top: 1px solid #f1f5f9; margin-top: 2px; }
.sm-rows-grid .sm-row-detail { display: none !important; }
/* hide table header in grid view */
.sm-table-wrap:has(.sm-rows-grid) .sm-thead { display: none; }

.sm-row-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; }
.sm-row-audio:hover, .sm-row-audio.sm-playing { background: #2563eb; color: white; }
.sm-row-thumb { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.sm-row-word { text-decoration: none; color: inherit; min-width: 0; }
.sm-row-word:hover { color: inherit; text-decoration: none; }
.sm-row-fi { font-size: 14px; font-weight: 800; color: #0a0a0a; letter-spacing: -0.01em; }
.sm-row-word:hover .sm-row-fi { color: #2563eb; }
.sm-row-ipa { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10.5px; color: #94a3b8; margin-top: 1px; }
.sm-row-vi { font-size: 13px; color: #1e293b; font-weight: 500; }
.sm-row-type { font-size: 12px; color: #64748b; }

.sm-row-prog { display: flex; align-items: center; gap: 5px; }
.sm-prog-bar { flex: 1; height: 5px; background: #e2e8f0; border-radius: 999px; overflow: hidden; min-width: 36px; }
.sm-prog-fill { height: 100%; background: linear-gradient(90deg, #10b981, #059669); border-radius: 999px; width: 0%; transition: width 400ms; }
.sm-prog-txt { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10.5px; color: #94a3b8; font-weight: 700; }

.sm-row-acts { display: flex; gap: 4px; }
.sm-act { background: transparent; border: none; width: 26px; height: 26px; border-radius: 6px; color: #94a3b8; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all 100ms; }
.sm-act:hover { background: #f1f5f9; color: #2563eb; }
.sm-fav-on  { color: #f59e0b; }
.sm-fav-on  svg { fill: #f59e0b; }
.sm-save-on { color: #2563eb; }
.sm-save-on svg { fill: #2563eb; }

.sm-row-detail { display: none; padding: 0 18px 16px; background: linear-gradient(180deg, transparent, #fafbfc); border-top: 1px dashed #e2e8f0; margin: 0 -1px; }
.sm-row-open .sm-row-detail { display: block; }
.sm-row-open .sm-row-expand svg { transform: rotate(180deg); }
.sm-row-expand svg { transition: transform 200ms; }
.sm-detail-grid { display: grid; grid-template-columns: 130px 1fr 1fr 1fr; gap: 14px; padding: 14px 0 10px; }
.sm-detail-img { aspect-ratio: 4/3; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 36px; }
.sm-detail-col { min-width: 0; }
.sm-detail-h { font-size: 11px; font-weight: 800; color: #475569; letter-spacing: 0.02em; margin-bottom: 4px; }
.sm-detail-body { font-size: 12.5px; color: #0a0a0a; line-height: 1.45; }
.sm-detail-empty { color: #94a3b8; }
.sm-detail-empty a { color: #2563eb; font-weight: 600; }

/* Ghi nhớ nhanh — structured note rows */
.sm-note-rows { display: flex; flex-direction: column; gap: 5px; }
.sm-note-row { display: grid; grid-template-columns: 60px 1fr; gap: 8px; align-items: center; }
.sm-note-k { font-size: 10.5px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.03em; }
.sm-note-v { font-size: 12.5px; font-weight: 600; }
.sm-note-type { font-family: 'JetBrains Mono', ui-monospace, monospace; color: #7c3aed; background: #f5f3ff; padding: 1px 8px; border-radius: 6px; justify-self: start; }
.sm-note-kpt { font-family: 'JetBrains Mono', ui-monospace, monospace; color: #c2410c; background: #fff7ed; padding: 1px 8px; border-radius: 6px; justify-self: start; }
.sm-note-none { color: #64748b; font-style: italic; font-weight: 500; }
.sm-note-stem { font-family: 'JetBrains Mono', ui-monospace, monospace; color: #2563eb; background: #eff6ff; padding: 1px 8px; border-radius: 6px; justify-self: start; }
.sm-note-empty { color: #94a3b8; }
.sm-note-text { color: #1e293b; }
.sm-detail-ex-fi { font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 600; color: #2563eb; }
.sm-detail-ex-vi { color: #64748b; font-size: 11.5px; margin-top: 2px; font-style: italic; }
.sm-detail-link { display: inline-block; padding: 6px 12px; background: #eff6ff; color: #2563eb; border-radius: 7px; font-size: 12px; font-weight: 600; text-decoration: none; margin-top: 4px; }
.sm-detail-link:hover { background: #dbeafe; text-decoration: none; }

@media (max-width: 1180px) {
	.sm-thead, .sm-row-main { grid-template-columns: 32px 0 1.4fr 1fr 0 0.5fr 0.9fr 0.9fr; }
	.sm-row-thumb, .sm-thead > div:nth-child(2), .sm-row-type, .sm-thead > div:nth-child(5) { display: none; }
	.sm-detail-grid { grid-template-columns: 100px 1fr 1fr; }
	.sm-detail-grid > .sm-detail-col:nth-child(4) { grid-column: 1/-1; }
}
@media (max-width: 720px) {
	.sm-hero { grid-template-columns: 1fr; }
	.sm-hero-image { aspect-ratio: 16/8; }
	.sm-hero-progress { display: flex; align-items: center; gap: 12px; justify-content: center; }
	.sm-hero-prog-l { display: none; }
	.sm-thead { display: none; }
	.sm-row-main {
		grid-template-columns: 32px 1fr auto auto;
		grid-template-areas: "au word lv ac" "au vi vi vi";
		gap: 1px 8px; padding: 11px 14px; align-items: center;
	}
	.sm-row-main > *:nth-child(2), .sm-row-main > *:nth-child(5), .sm-row-main > *:nth-child(7) { display: none; } /* thumb, type, prog */
	.sm-row-main > *:nth-child(1) { grid-area: au; }
	.sm-row-main > *:nth-child(3) { grid-area: word; }
	.sm-row-main > *:nth-child(4) { grid-area: vi; display: block; }
	.sm-row-main > *:nth-child(6) { grid-area: lv; justify-self: end; }
	.sm-row-main > *:nth-child(8) { grid-area: ac; }
	.sm-row-vi { font-size: 12.5px; color: #64748b; font-weight: 600; white-space: normal; line-height: 1.3; }
	.sm-detail-grid { grid-template-columns: 1fr; }
}

.sm-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; background: white; border: 1px solid #e2e8f0; border-radius: 12px; }
.sm-pager-l { font-size: 12.5px; color: #64748b; }
.sm-pager-l strong { color: #0a0a0a; }
.sm-pager-r { display: flex; gap: 4px; }
.sm-pager-r .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 9px; background: white; border: 1px solid #e2e8f0; border-radius: 7px; font-size: 12px; font-weight: 600; color: #64748b; text-decoration: none; }
.sm-pager-r .page-numbers:hover { background: #f8fafc; color: #0a0a0a; }
.sm-pager-r .page-numbers.current { background: #2563eb; color: white; border-color: #2563eb; }
.sm-pager-r .page-numbers.dots { background: transparent; border: none; }

.sm-empty { background: white; padding: 50px 24px; border-radius: 14px; text-align: center; border: 1px solid #e2e8f0; }

/* MODE INTRO (all + type) */
.sm-mode-intro { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; background: linear-gradient(135deg, #eff6ff, #dbeafe); border: 1px solid #bfdbfe; padding: 14px 18px; border-radius: 14px; }
.sm-mode-intro-icon { width: 56px; height: 56px; border-radius: 14px; background: white; display: flex; align-items: center; justify-content: center; font-size: 28px; box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.sm-mode-intro-title { font-size: 1.2rem; font-weight: 900; letter-spacing: -0.02em; margin: 0 0 3px; color: #0a0a0a; }
.sm-mode-intro-desc { color: #475569; font-size: 12.5px; line-height: 1.5; margin: 0; }
.sm-mode-intro-desc strong { color: #1d4ed8; font-weight: 700; }

/* MODE: THEO LOẠI - 4 cards */
.sm-types { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 980px) { .sm-types { grid-template-columns: 1fr; } }
.sm-type-card { background: white; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.sm-type-h { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; }
.sm-type-h-emoji { width: 48px; height: 48px; border-radius: 12px; background: white; display: flex; align-items: center; justify-content: center; font-size: 26px; box-shadow: 0 2px 5px rgba(0,0,0,0.06); }
.sm-type-h-name { font-size: 1.05rem; font-weight: 900; letter-spacing: -0.015em; color: #0a0a0a; }
.sm-type-h-cnt { font-size: 11.5px; color: #475569; font-weight: 600; margin-top: 1px; }
.sm-type-h-play { background: white; border: 1px solid rgba(0,0,0,0.06); border-radius: 8px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; color: #2563eb; cursor: pointer; transition: all 120ms; }
.sm-type-h-play:hover { background: #2563eb; color: white; }
.sm-type-words { display: flex; flex-direction: column; padding: 4px 0; }
.sm-type-word { display: grid; grid-template-columns: 24px 22px 1fr 1.2fr auto; gap: 8px; align-items: center; padding: 8px 14px; border-top: 1px solid #f1f5f9; font-size: 12.5px; }
.sm-type-word:first-child { border-top: none; }
.sm-type-word:hover { background: #f8fafc; }
.sm-type-word-audio { background: #f1f5f9; border: none; border-radius: 6px; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; color: #2563eb; cursor: pointer; }
.sm-type-word-audio:hover, .sm-type-word-audio.sm-playing { background: #2563eb; color: white; }
.sm-type-word-emo { font-size: 14px; text-align: center; }
.sm-type-word-fi { font-weight: 800; color: #0a0a0a; text-decoration: none; letter-spacing: -0.01em; }
.sm-type-word-fi:hover { color: #2563eb; text-decoration: none; }
.sm-type-word-vi { color: #475569; }
.sm-type-word-extra { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10.5px; color: #94a3b8; font-weight: 600; background: #f1f5f9; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
@media (max-width: 600px) {
	.sm-type-word { grid-template-columns: 24px 1fr 1fr; }
	.sm-type-word-emo, .sm-type-word-extra { display: none; }
}

/* "Khác" expand dropdown */
.sm-topic-other { display: grid; grid-template-columns: 30px 1fr auto 12px; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 10px; background: transparent; border: 1px solid transparent; cursor: pointer; width: 100%; font: inherit; text-align: left; color: inherit; }
.sm-topic-other:hover { background: #f8fafc; }
.sm-topic-other[aria-expanded="true"] { background: #f1f5f9; }
.sm-topic-caret { color: #94a3b8; transition: transform 200ms; flex-shrink: 0; }
.sm-topic-other[aria-expanded="true"] .sm-topic-caret { transform: rotate(180deg); }
.sm-topic-sublist { display: flex; flex-direction: column; gap: 1px; padding: 4px 0 4px 14px; margin: 2px 0 0 16px; border-left: 2px solid #e2e8f0; }
.sm-topic-sublist[hidden] { display: none; }
.sm-topic-sub { padding: 6px 8px !important; grid-template-columns: 22px 1fr auto !important; gap: 8px !important; }
.sm-topic-sub .sm-topic-icon { width: 22px !important; height: 22px !important; font-size: 13px !important; background: transparent !important; }
.sm-topic-sub .sm-topic-vn { font-size: 12px !important; font-weight: 600 !important; }
.sm-topic-sub .sm-topic-cnt { font-size: 10px !important; padding: 1px 6px !important; }

/* AJAX swap loading */
.sm.sm-loading { position: relative; }
.sm.sm-loading::after { content: ''; position: fixed; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, #2563eb 50%, transparent); animation: smProg 800ms infinite linear; z-index: 9999; }
@keyframes smProg { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.sm.sm-loading .sm-main { opacity: 0.6; transition: opacity 150ms; }

/* ===== ALPHABET GROUPING (sort=abc) ===== */
.sm-abc-wrap { display: flex; align-items: center; }
.sm-abc-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: #475569; background: #f1f5f9; border: 1px solid transparent; text-decoration: none; transition: all 120ms; }
.sm-abc-toggle:hover { background: #e2e8f0; color: #0a0a0a; text-decoration: none; }
.sm-abc-toggle.on { background: #2563eb; color: #fff; box-shadow: 0 1px 3px rgba(37,99,235,0.3); }
.sm-abc-toggle.on:hover { background: #1d4ed8; color: #fff; }

/* Sticky letter index bar */
.sm-alpha { position: sticky; top: 8px; z-index: 30; display: flex; flex-wrap: wrap; gap: 5px; padding: 9px 11px; background: rgba(255,255,255,0.92); backdrop-filter: blur(8px); border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 2px 10px rgba(15,23,42,0.04); }
.sm-alpha-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 7px; font-size: 12.5px; font-weight: 800; color: #0a0a0a; background: #f8fafc; border: 1px solid #e2e8f0; text-decoration: none; text-transform: uppercase; transition: all 120ms; }
.sm-alpha-chip:hover { background: #2563eb; border-color: #2563eb; color: #fff; text-decoration: none; }
.sm-alpha-chip span { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10px; font-weight: 700; color: #94a3b8; }
.sm-alpha-chip:hover span { color: #dbeafe; }
.admin-bar .sm-alpha { top: 40px; }

/* Letter sections */
.sm-groups { display: flex; flex-direction: column; gap: 10px; }
.sm-galpha { background: white; border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px 14px 14px; scroll-margin-top: 64px; content-visibility: auto; contain-intrinsic-size: 0 280px; }
.sm-galpha-h { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px dashed #e2e8f0; }
.sm-galpha-letter { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 7px; background: #eff6ff; color: #1d4ed8; font-size: 14px; font-weight: 900; text-transform: uppercase; }
.sm-galpha-cnt { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; font-weight: 700; color: #94a3b8; background: #f1f5f9; padding: 2px 8px; border-radius: 999px; }
.sm-galpha-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }

.sm-gcard { position: relative; display: flex; align-items: center; gap: 9px; padding: 10px 11px; border: 1px solid #e2e8f0; border-radius: 11px; background: white; transition: all 120ms; }
.sm-gcard:hover { border-color: #bfdbfe; box-shadow: 0 4px 12px rgba(15,23,42,0.06); transform: translateY(-1px); }
.sm-gcard-audio { flex-shrink: 0; background: #f1f5f9; border: none; border-radius: 8px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; color: #2563eb; cursor: pointer; transition: all 120ms; }
.sm-gcard-audio:hover, .sm-gcard-audio.sm-playing { background: #2563eb; color: #fff; }
.sm-gcard-link { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; text-decoration: none; padding-right: 24px; }
.sm-gcard-link:hover { text-decoration: none; }
.sm-gcard-fi { font-size: 14px; font-weight: 800; color: #0a0a0a; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-gcard-link:hover .sm-gcard-fi { color: #2563eb; }
.sm-gcard-vi { font-size: 12.5px; color: #2563eb; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-gcard-badge { position: absolute; top: 8px; right: 8px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 9.5px; font-weight: 800; padding: 2px 6px; border-radius: 6px; letter-spacing: 0.02em; }
.sm-vt-1 { background: #dbeafe; color: #1e40af; }
.sm-vt-2 { background: #d1fae5; color: #065f46; }
.sm-vt-3 { background: #ffedd5; color: #9a3412; }
.sm-vt-4 { background: #ede9fe; color: #6d28d9; }
.sm-vt-5 { background: #ccfbf1; color: #0f766e; }
.sm-vt-6 { background: #fce7f3; color: #9d174f; }

@media (max-width: 600px) {
	.sm-galpha-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
	.sm-gcard { padding: 9px; gap: 7px; }
	.sm-gcard-audio { width: 26px; height: 26px; }
	.sm-gcard-fi { font-size: 13px; }
	.sm-gcard-vi { font-size: 11.5px; }
}

/* ============================================================
 * Header icon + pill; phần tử thẻ chủ đề chỉ hiện ở mobile
 * ============================================================ */
.sm-top-l:has(.sm-title-ic) { display: flex; align-items: center; gap: 12px; }
.sm-title-ic { width: 46px; height: 46px; border-radius: 13px; background: linear-gradient(135deg,#ede9fe,#ddd6fe); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.sm-title-wrap { min-width: 0; }
.sm-pill { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; background: #f5f3ff; border: 1px solid #ddd6fe; color: #6d28d9; font-size: 12.5px; font-weight: 800; padding: 7px 13px; border-radius: 999px; white-space: nowrap; }
.sm-topic-meta, .sm-topic-prog, .sm-topic-go { display: none; }
.sm-statsbar { display: none; }

/* ============================================================
 * MOBILE (≤900px) — trang Từ vựng theo mockup app
 * ============================================================ */
@media (max-width: 900px) {
	.sm { padding: 12px 14px 76px; }

	.sm-top { grid-template-columns: 1fr; gap: 12px; }
	.sm-title-ic { width: 42px; height: 42px; font-size: 22px; }
	.sm-title { font-size: 1.35rem; }
	.sm-sub { font-size: 12px; }
	.sm-modes { justify-self: stretch; }
	.sm-mode { flex: 1; justify-content: center; padding: 10px 6px; }
	.sm-mode-num { display: none; }
	.sm-top-r { display: none; }

	/* 4 thẻ thống kê */
	.sm-statsbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 14px 8px; margin-bottom: 14px; }
	.sm-statc { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
	.sm-statc-ic { width: 36px; height: 36px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 17px; }
	.sm-statc-n { font-size: 1.1rem; font-weight: 900; color: #0f172a; line-height: 1; }
	.sm-statc-l { font-size: 10px; color: #64748b; font-weight: 600; }

	/* 1 cột — cột chủ đề thành nội dung chính */
	.sm-grid { grid-template-columns: 1fr; gap: 12px; }
	.sm-mid { display: none !important; }
	.sm-col.sm-topics { display: block; position: static; max-height: none; overflow: visible; padding: 0; background: transparent; border: none; }
	.sm-topics .sm-col-h { display: none; }
	.sm-topic-list { gap: 10px; }

	/* TRANG CHỦ ĐỀ (/aihe/...) + TRANG THEO LOẠI (/sanasto/tyypit/):
	   đưa danh sách TỪ VỰNG lên đầu, đẩy danh sách chủ đề/loại từ
	   xuống dưới làm bộ chuyển. (Không đụng /sanasto/ Tổng thể) */
	.tax-chu-de .sm-main,
	.sm-mode-type .sm-main { order: -1; }
	.tax-chu-de .sm-col.sm-topics,
	.sm-mode-type .sm-col.sm-topics { order: 2; margin-top: 20px; padding-top: 18px; border-top: 1px solid #e2e8f0; }
	.tax-chu-de .sm-topics .sm-col-h,
	.sm-mode-type .sm-topics .sm-col-h { display: block; padding: 0 2px 12px; font-size: 13px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; }
	.tax-chu-de .sm-topics .sm-col-h::after,
	.sm-mode-type .sm-topics .sm-col-h::after { content: " khác"; }

	/* mỗi chủ đề = 1 thẻ dọc */
	.sm-topics .sm-topic, .sm-topics .sm-topic-sub {
		display: grid !important; grid-template-columns: 52px 1fr auto auto; grid-template-areas: "ic text prog go"; gap: 12px; align-items: center;
		background: #fff !important; border: 1px solid #e2e8f0 !important; border-radius: 16px; padding: 14px !important; margin: 0 !important;
	}
	.sm-topics .sm-topic:hover { background: #fff !important; border-color: #cbd5e1 !important; }
	.sm-topics .sm-topic-icon { grid-area: ic; width: 52px; height: 52px; border-radius: 14px; font-size: 24px; }
	.sm-topics .sm-topic-text { grid-area: text; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
	.sm-topics .sm-topic-vn { font-size: 15px; }
	.sm-topics .sm-topic-fi { display: block; font-size: 12px; color: #2563eb; font-weight: 600; }
	.sm-topics .sm-topic-meta { display: block; font-size: 11.5px; color: #94a3b8; margin-top: 3px; }
	.sm-topics .sm-topic-meta b { color: #475569; font-weight: 700; }
	.sm-topics .sm-topic-prog { grid-area: prog; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
	.sm-topics .sm-topic-prog-bar { width: 76px; height: 6px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
	.sm-topics .sm-topic-prog-fill { display: block; height: 100%; width: 0%; background: linear-gradient(90deg,#10b981,#059669); border-radius: 999px; transition: width 400ms; }
	.sm-topics .sm-topic-prog-pct { font-size: 11.5px; font-weight: 800; color: #059669; }
	.sm-topics .sm-topic-cnt { display: none; }
	.sm-topics .sm-topic-go { grid-area: go; display: block; color: #cbd5e1; }

	/* "Khác" giữ dạng dropdown dọc */
	.sm-topics .sm-topic-other { display: grid !important; grid-template-columns: 52px 1fr auto !important; grid-template-areas: "ic text go" !important; }
	.sm-topics .sm-topic-other .sm-topic-caret { grid-area: go; display: block; width: 16px; height: 16px; }
	.sm-topics .sm-topic-other .sm-topic-fi { display: block; }
	.sm-topics .sm-topic-sublist { display: flex; flex-direction: column; gap: 10px; padding: 10px 0 0; margin: 0; border: none; }
	.sm-topics .sm-topic-sublist[hidden] { display: none; }
	.sm-topics .sm-topic-sub .sm-topic-icon { background: #f8fafc; }

	/* hero gọn */
	.sm-hero { grid-template-columns: 1fr; gap: 10px; padding: 12px; }
	.sm-hero-image { aspect-ratio: 16/7; }
	.sm-hero-emoji { font-size: 44px; }
	.sm-hero-progress { display: flex; align-items: center; justify-content: center; gap: 12px; }
	.sm-hero-prog-l { display: none; }
}

/* ============================================================
 * THEO LOẠI — widget tabs + A-Z index + thẻ 2 cột (wt-*)
 * ============================================================ */
.wt { display: flex; flex-direction: column; gap: 14px; }
.wt-head { display: flex; align-items: center; gap: 12px; }
.wt-head-ic { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; }
.wt-title { font-size: 1.5rem; font-weight: 900; margin: 0; letter-spacing: -0.02em; color: #0a0a0a; }
.wt-sub { margin: 2px 0 0; font-size: 12.5px; color: #64748b; }

/* Tabs */
.wt-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.wt-tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border: 1px solid #e2e8f0; background: #fff; border-radius: 12px; font: inherit; font-size: 13.5px; font-weight: 700; color: #334155; cursor: pointer; transition: all 130ms; }
.wt-tab span { font-size: 11px; font-weight: 800; background: #f1f5f9; color: #64748b; padding: 1px 7px; border-radius: 999px; }
.wt-tab:hover { border-color: #cbd5e1; }
.wt-tab.on { background: #2563eb; border-color: #2563eb; color: #fff; box-shadow: 0 2px 10px rgba(37,99,235,0.25); }
.wt-tab.on span { background: rgba(255,255,255,0.25); color: #fff; }

/* Controls: sort + lang */
.wt-ctrl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wt-sorts, .wt-langs { display: inline-flex; gap: 4px; background: #f1f5f9; padding: 4px; border-radius: 11px; }
.wt-langs { margin-left: auto; }
.wt-sort, .wt-lang { border: none; background: none; font: inherit; font-size: 12.5px; font-weight: 700; color: #64748b; padding: 7px 13px; border-radius: 8px; cursor: pointer; transition: all 120ms; white-space: nowrap; }
.wt-sort.on, .wt-lang.on { background: #fff; color: #2563eb; box-shadow: 0 1px 3px rgba(15,23,42,0.1); }

/* Info box (TYYPPI / Hay dùng) */
.wt-info { background: #fffbeb; border: 1px solid #fde68a; border-radius: 14px; padding: 13px 16px; }
.wt-info-h { font-size: 14px; font-weight: 900; color: #92400e; }
.wt-info-b { font-size: 12.5px; color: #a16207; line-height: 1.5; margin-top: 3px; }
.wt-info-b b { color: #92400e; }

/* A-Z / topic index */
.wt-index { display: flex; flex-wrap: wrap; gap: 7px; }
.wt-ix { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; background: #fff; border: 1px solid #e2e8f0; border-radius: 9px; font-size: 12.5px; font-weight: 800; color: #1e293b; text-decoration: none; transition: all 120ms; }
.wt-ix:hover { border-color: #2563eb; color: #2563eb; }
.wt-ix i { font-style: normal; font-size: 10.5px; font-weight: 700; color: #94a3b8; }
.wt-ix-topic { font-weight: 700; }

/* Groups + cards */
.wt-body { display: flex; flex-direction: column; gap: 18px; }
.wt-grp { scroll-margin-top: 16px; }
.wt-grp-h { font-size: 14px; font-weight: 900; color: #0f172a; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 2px solid #f1f5f9; }
.wt-grp-h span { font-size: 11px; font-weight: 800; color: #2563eb; background: #eff6ff; padding: 2px 9px; border-radius: 999px; }
.wt-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.wt-card { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #e8edf3; border-left: 3px solid #cbd5e1; border-radius: 12px; padding: 11px 13px; text-decoration: none; transition: all 130ms; min-width: 0; }
.wt-card:hover { border-color: #c7d2fe; border-left-color: #2563eb; box-shadow: 0 3px 12px rgba(15,23,42,0.07); transform: translateY(-1px); }
.wt-card-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.wt-card-fi { font-size: 14.5px; font-weight: 800; color: #0f172a; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wt-card-vi { font-size: 12px; color: #64748b; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wt-badge { flex-shrink: 0; font-size: 10px; font-weight: 900; padding: 2px 7px; border-radius: 7px; letter-spacing: 0.02em; }
.wt-t1 { background: #dbeafe; color: #1d4ed8; } .wt-t2 { background: #dcfce7; color: #15803d; }
.wt-t3 { background: #fef3c7; color: #b45309; } .wt-t4 { background: #fae8ff; color: #a21caf; }
.wt-t5 { background: #ffe4e6; color: #be123c; } .wt-t6 { background: #cffafe; color: #0e7490; }

/* Ẩn cột giữa (sub-groups cũ) khi ở mode Theo loại — widget đã có tab riêng */
.sm-mode-type .sm-mid { display: none; }
@media (min-width: 901px) { .sm-mode-type .sm-grid { grid-template-columns: 220px 1fr; } }

@media (max-width: 900px) {
	.wt-title { font-size: 1.3rem; }
	.wt-tabs { gap: 7px; }
	.wt-tab { padding: 9px 13px; font-size: 13px; }
	.wt-langs { margin-left: 0; }
	.wt-ctrl { gap: 8px; }
	.wt-index { gap: 6px; }
	.wt-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
	.wt-card { padding: 10px 11px; }
	.wt-card-fi { font-size: 13.5px; }
}
@media (max-width: 380px) {
	.wt-cards { grid-template-columns: 1fr; }
}

/* ============================================================
 * Letter divider (group A-Z) + control bar gọn trên mobile
 * ============================================================ */
.sm-letter { font-size: 13px; font-weight: 900; color: #2563eb; background: #f8fafc; padding: 7px 14px; border-bottom: 1px solid #e2e8f0; letter-spacing: 0.02em; position: sticky; top: 0; z-index: 2; }
.sm-rows-grid .sm-letter { grid-column: 1 / -1; background: transparent; border: none; padding: 10px 2px 2px; position: static; }

@media (max-width: 640px) {
	.sm-bar { gap: 8px 10px; padding: 10px 12px; }
	.sm-play-all { order: 1; }
	.sm-bar-r { order: 2; margin-left: auto; }
	.sm-bar-form { order: 5; flex: 1 1 100%; gap: 6px 10px; }
	.sm-bar-form .sm-bar-sel { flex: 1 1 0; min-width: 0; }
	.sm-bar-l { font-size: 11.5px; }
}

/* Bộ lọc theo SÁCH (nguồn) */
.sm-books { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sm-books-l { font-size: 12.5px; font-weight: 800; color: #64748b; }
.sm-book { padding: 6px 14px; border: 1px solid #e2e8f0; background: #fff; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: #475569; text-decoration: none; transition: all 130ms; }
.sm-book:hover { border-color: #cbd5e1; color: #0f172a; text-decoration: none; }
.sm-book.on { background: #2563eb; border-color: #2563eb; color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,0.25); }
