/* ==========================================================================
   Tìm kiếm kiểu Google — tpl_saigonchess
   Trang kết quả (.sgs), hộp tìm nổi (.sgs-ov) và nút ở header (.sgs-head)
   Chế độ tối: body.dark-active
   ========================================================================== */

.sgs, .sgs-ov {
	--sgs-bg: #fff;
	--sgs-surface: #fff;
	--sgs-surface-2: #f1f3f4;
	--sgs-text: #202124;
	--sgs-text-2: #4d5156;
	--sgs-text-3: #70757a;
	--sgs-line: #dadce0;
	--sgs-line-2: #ebebeb;
	--sgs-link: #1a0dab;
	--sgs-visited: #681da8;
	--sgs-accent: #1f457f;
	--sgs-accent-2: #d8721a;
	--sgs-hover: rgba(60, 64, 67, .08);
	--sgs-shadow: 0 1px 6px rgba(32, 33, 36, .28);
	--sgs-shadow-lg: 0 4px 24px rgba(32, 33, 36, .22);
	--sgs-gold: #e8b923;
	--sgs-silver: #a7afb8;
	--sgs-bronze: #c47a3f;
	--sgs-mark: inherit;
	--sgs-radius: 24px;
	font-family: Roboto, Arial, sans-serif;
	color: var(--sgs-text);
}

body.dark-active .sgs, body.dark-active .sgs-ov {
	--sgs-bg: #202124;
	--sgs-surface: #303134;
	--sgs-surface-2: #3c4043;
	--sgs-text: #e8eaed;
	--sgs-text-2: #bdc1c6;
	--sgs-text-3: #9aa0a6;
	--sgs-line: #5f6368;
	--sgs-line-2: #3c4043;
	--sgs-link: #8ab4f8;
	--sgs-visited: #c58af9;
	--sgs-accent: #8ab4f8;
	--sgs-hover: rgba(232, 234, 237, .08);
	--sgs-shadow: 0 1px 6px rgba(0, 0, 0, .5);
	--sgs-shadow-lg: 0 4px 24px rgba(0, 0, 0, .6);
}

.sgs svg, .sgs-ov svg { width: 1em; height: 1em; flex: none; }

/* ---------- Trang ------------------------------------------------------- */
.sgs { max-width: 1140px; margin: 0 auto; padding: 8px 0 48px; }
.sgs a { text-decoration: none; }

/* ---------- Hộp tìm (dùng chung trang + hộp nổi) ------------------------ */
.sgs-bar { position: relative; max-width: 692px; margin: 0; }
.sgs-box {
	display: flex; align-items: center; gap: 4px;
	height: 48px; padding: 0 6px 0 16px;
	background: var(--sgs-surface);
	border: 1px solid var(--sgs-line);
	border-radius: var(--sgs-radius);
	transition: box-shadow .2s, border-color .2s;
}
.sgs-box:hover, .sgs-box:focus-within { box-shadow: var(--sgs-shadow); border-color: transparent; }
.sgs-box.is-open { border-radius: var(--sgs-radius) var(--sgs-radius) 0 0; box-shadow: var(--sgs-shadow); border-color: transparent; }
.sgs-box__ico { color: var(--sgs-text-3); font-size: 20px; display: flex; }
.sgs .sgs-box__input, .sgs-ov .sgs-box__input {
	flex: 1; min-width: 0; height: 100%;
	border: 0 !important; outline: 0 !important; box-shadow: none !important;
	background: transparent !important; color: var(--sgs-text) !important;
	font-size: 16px; padding: 0 8px; margin: 0;
}
.sgs-box__input::-webkit-search-cancel-button { display: none; }
.sgs-box__input::placeholder { color: var(--sgs-text-3); }
.sgs-box__clear, .sgs-box__go {
	display: flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; border: 0; border-radius: 50%;
	background: transparent; color: var(--sgs-text-3); font-size: 22px; cursor: pointer; padding: 0;
}
.sgs-box__clear { border-right: 1px solid var(--sgs-line); border-radius: 0; width: 44px; height: 28px; }
.sgs-box__clear[hidden] { display: none; }
.sgs-box__go { color: var(--sgs-accent); }
.sgs-box__go:hover, .sgs-box__clear:hover { color: var(--sgs-text); }

/* Danh sách gợi ý */
.sgs-sug {
	position: absolute; left: 0; right: 0; top: 100%; z-index: 100001;
	background: var(--sgs-surface); border-radius: 0 0 var(--sgs-radius) var(--sgs-radius);
	box-shadow: var(--sgs-shadow); padding: 0 0 10px; margin: 0; list-style: none;
	clip-path: inset(0 -10px -10px -10px);
}
.sgs-sug::before { content: ""; display: block; height: 1px; background: var(--sgs-line-2); margin: 0 16px 6px; }
.sgs-sug li { margin: 0; }
.sgs-sug a {
	display: flex; align-items: center; gap: 14px; padding: 6px 16px;
	color: var(--sgs-text); line-height: 1.3;
}
.sgs-sug a:hover, .sgs-sug li.is-active a { background: var(--sgs-hover); }
.sgs-sug__ico {
	width: 32px; height: 32px; border-radius: 8px; flex: none;
	display: flex; align-items: center; justify-content: center;
	background: var(--sgs-surface-2); color: var(--sgs-text-3); font-size: 18px;
}
.sgs-sug__ico--q { background: none; }
.sgs-sug__t { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sgs-sug__t b { font-weight: 700; }
.sgs-sug__m { display: block; font-size: 12px; color: var(--sgs-text-3); }
.sgs-sug__body { min-width: 0; }

/* ---------- Trang chủ tìm kiếm (chưa gõ) -------------------------------- */
.sgs--home { padding-top: 7vh; }
.sgs-hero { display: flex; flex-direction: column; align-items: center; text-align: center; }
.sgs-hero .sgs-bar { width: 100%; }
.sgs-logo { font-size: clamp(44px, 9vw, 84px); font-weight: 500; letter-spacing: -2px; margin: 0 0 6px; line-height: 1.1; }
.sgs-logo span:nth-child(4n+1) { color: #1f457f; }
.sgs-logo span:nth-child(4n+2) { color: #d8721a; }
.sgs-logo span:nth-child(4n+3) { color: #2e8b57; }
.sgs-logo span:nth-child(4n)   { color: #c0392b; }
body.dark-active .sgs-logo span:nth-child(4n+1) { color: #8ab4f8; }
.sgs-hero__sub { color: var(--sgs-text-3); margin: 0 0 24px; font-size: 15px; }
.sgs-try { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; font-size: 14px; color: var(--sgs-text-3); align-items: center; }
.sgs-try a {
	padding: 6px 14px; border-radius: 16px; background: var(--sgs-surface-2); color: var(--sgs-text-2);
	transition: background .15s;
}
.sgs-try a:hover { background: var(--sgs-line-2); color: var(--sgs-text); box-shadow: inset 0 0 0 1px var(--sgs-line); }

/* ---------- Tab + công cụ ------------------------------------------------ */
.sgs-tabs {
	display: flex; gap: 4px; margin: 14px 0 0; border-bottom: 1px solid var(--sgs-line-2);
	overflow-x: auto; scrollbar-width: none;
}
.sgs-tabs::-webkit-scrollbar { display: none; }
.sgs-tab {
	position: relative; padding: 10px 12px 11px; white-space: nowrap;
	color: var(--sgs-text-2) !important; font-size: 14px; background: none; border: 0; cursor: pointer;
}
.sgs-tab small { color: var(--sgs-text-3); font-size: 12px; }
.sgs-tab:hover { color: var(--sgs-text) !important; }
.sgs-tab.is-active { color: var(--sgs-accent) !important; font-weight: 500; }
.sgs-tab.is-active::after {
	content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px;
	border-radius: 3px 3px 0 0; background: var(--sgs-accent);
}
.sgs-tab--tools { margin-left: auto; }
.sgs-tab--tools[aria-expanded="true"] { color: var(--sgs-text) !important; background: var(--sgs-surface-2); border-radius: 8px 8px 0 0; }

.sgs-tools {
	display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 10px 0; font-size: 14px;
	border-bottom: 1px solid var(--sgs-line-2);
}
.sgs-tools[hidden] { display: none; }
.sgs-tools__grp { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.sgs-tools__grp span { color: var(--sgs-text-3); margin-right: 4px; }
.sgs-tools__grp a { padding: 4px 10px; border-radius: 14px; color: var(--sgs-text-2); }
.sgs-tools__grp a:hover { background: var(--sgs-hover); }
.sgs-tools__grp a.is-on { background: var(--sgs-surface-2); color: var(--sgs-text); font-weight: 500; }

.sgs-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.sgs-chip {
	display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 12px;
	border: 1px solid var(--sgs-line); border-radius: 16px; font-size: 13px; color: var(--sgs-text-2);
	font-family: ui-monospace, Consolas, monospace;
}
.sgs-chip:hover { background: var(--sgs-hover); color: var(--sgs-text); }

.sgs-stats { color: var(--sgs-text-3); font-size: 14px; margin: 14px 0 8px; min-height: 1em; }

/* ---------- Bố cục kết quả + bảng tri thức ------------------------------ */
/* Không có bảng tri thức → kết quả chiếm hết bề ngang; có thì chia cột phải 372px */
.sgs-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 48px; }
.sgs-layout.has-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 372px); }

/* ---------- Một kết quả -------------------------------------------------- */
.sgs-item { margin: 0 0 30px; }
.sgs-src { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; min-width: 0; }
.sgs-fav {
	width: 28px; height: 28px; flex: none; border-radius: 50%;
	display: flex; align-items: center; justify-content: center; font-size: 16px;
	background: var(--sgs-surface-2); border: 1px solid var(--sgs-line-2); color: var(--sgs-accent);
}
.sgs-fav--tournament { color: #b8860b; }
.sgs-fav--player { color: #2e8b57; }
.sgs-srctext { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.sgs-sitename { font-size: 14px; color: var(--sgs-text); }
.sgs-srctext cite {
	font-style: normal; font-size: 12px; color: var(--sgs-text-2);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sgs-srctext cite span { color: var(--sgs-text-3); }

.sgs-main { display: flex; gap: 16px; align-items: flex-start; }
.sgs-text { flex: 1; min-width: 0; }
.sgs .sgs-title { font-size: 20px; line-height: 1.3; font-weight: 400; margin: 0 0 3px; padding-top: 2px; }
.sgs .sgs-title a { color: var(--sgs-link); }
.sgs .sgs-title a:visited { color: var(--sgs-visited); }
.sgs .sgs-title a:hover { text-decoration: underline; }

.sgs-snip { margin: 0; font-size: 14px; line-height: 1.58; color: var(--sgs-text-2); overflow-wrap: anywhere; }
.sgs-snip b, .sgs-hits b { color: var(--sgs-text); font-weight: 700; }
.sgs-date { color: var(--sgs-text-3); }
.sgs-url-hit { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: #188038; word-break: break-all; }
body.dark-active .sgs-url-hit { color: #81c995; }

.sgs-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--sgs-text-2); margin: 2px 0 4px; }
.sgs-meta__i { display: inline-flex; align-items: center; gap: 4px; }
.sgs-meta__i svg { color: var(--sgs-text-3); }

.sgs-medals { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; }
.sgs-m { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.sgs-m::before { content: ""; width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.sgs-m--g::before { background: var(--sgs-gold); }
.sgs-m--s::before { background: var(--sgs-silver); }
.sgs-m--b::before { background: var(--sgs-bronze); }

.sgs-hits { list-style: none; margin: 8px 0 0; padding: 4px 0 4px 14px; border-left: 2px solid var(--sgs-line-2); font-size: 14px; }
.sgs-hits li { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0; line-height: 1.45; }
.sgs-hits__b { min-width: 0; }
.sgs-hits a { color: var(--sgs-link); }
.sgs-hits a b { color: inherit; }
.sgs-hits__d::before { content: " "; }
.sgs-hits a:hover { text-decoration: underline; }
.sgs-hits__d { color: var(--sgs-text-3); font-size: 13px; }
.sgs-hits__more a { font-size: 13px; }

.sgs-rk {
	display: inline-flex; align-items: center; justify-content: center; flex: none;
	min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; font-size: 11px; font-weight: 700;
	background: var(--sgs-surface-2); color: var(--sgs-text-2); font-variant-numeric: tabular-nums;
}
.sgs-rk--1 { background: var(--sgs-gold); color: #3d2e00; }
.sgs-rk--2 { background: var(--sgs-silver); color: #1f2328; }
.sgs-rk--3 { background: var(--sgs-bronze); color: #fff; }

.sgs-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sgs-links a {
	font-size: 13px; padding: 4px 12px; border-radius: 16px;
	border: 1px solid var(--sgs-line); color: var(--sgs-text-2);
}
.sgs-links a:hover { background: var(--sgs-hover); color: var(--sgs-text); }

.sgs-thumb { flex: none; width: 92px; height: 92px; border-radius: 8px; overflow: hidden; margin-top: 4px; background: var(--sgs-surface-2); }
.sgs-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sgs-thumb--round { border-radius: 50%; width: 72px; height: 72px; }

/* ---------- Dải kỳ thủ --------------------------------------------------- */
.sgs-people { margin: 0 0 30px; padding: 16px 0; border-top: 1px solid var(--sgs-line-2); border-bottom: 1px solid var(--sgs-line-2); }
.sgs .sgs-people h2 { font-size: 20px; font-weight: 400; margin: 0 0 12px; color: var(--sgs-text); }
.sgs-people__row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.sgs-person {
	display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
	padding: 14px 8px 12px; border: 1px solid var(--sgs-line-2); border-radius: 12px; color: var(--sgs-text);
	transition: box-shadow .15s;
}
.sgs-person:hover { box-shadow: var(--sgs-shadow); }
.sgs-person__av {
	width: 56px; height: 56px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center;
	background: var(--sgs-accent); color: #fff; font-size: 22px; font-weight: 500;
}
body.dark-active .sgs-person__av { color: #202124; }
.sgs-person__av img { width: 100%; height: 100%; object-fit: cover; }
.sgs-person__name { font-size: 14px; line-height: 1.3; }
.sgs-person__id { font-size: 12px; color: var(--sgs-text-3); }
.sgs-people__all { display: inline-block; margin-top: 10px; font-size: 14px; color: var(--sgs-link); }

/* ---------- Bảng tri thức ------------------------------------------------ */
.sgs-panel {
	align-self: start; position: sticky; top: 16px;
	border: 1px solid var(--sgs-line-2); border-radius: 12px; padding: 18px 20px 20px; font-size: 14px;
}
.sgs-panel__head { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.sgs-panel__img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex: none; }
.sgs .sgs-panel h2 { font-size: 26px; font-weight: 400; margin: 0; line-height: 1.2; color: var(--sgs-text); }
.sgs-panel__head p { margin: 2px 0 0; color: var(--sgs-text-3); }
.sgs-panel__facts { margin: 0; border-top: 1px solid var(--sgs-line-2); padding-top: 10px; }
.sgs-panel__facts > div { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; padding: 5px 0; align-items: baseline; }
.sgs-panel__facts dt { font-weight: 500; margin: 0; color: var(--sgs-text-3); font-size: 13px; }
.sgs-panel__facts dd { margin: 0; color: var(--sgs-text-2); }
.sgs-panel__facts a { color: var(--sgs-link); }
.sgs .sgs-panel h3 { font-size: 16px; font-weight: 500; margin: 16px 0 8px; color: var(--sgs-text); }
.sgs-panel__list { list-style: none; margin: 0; padding: 0; }
.sgs-panel__list li { display: flex; gap: 10px; margin: 0 0 10px; line-height: 1.35; }
.sgs-panel__list .sgs-rk { align-self: flex-start; margin-top: 1px; }
.sgs-panel__list a { color: var(--sgs-link); }
.sgs-panel__list small { display: block; color: var(--sgs-text-3); font-size: 12px; }
.sgs-panel__btn {
	display: block; text-align: center; margin-top: 14px; padding: 9px; border-radius: 20px;
	background: var(--sgs-surface-2); color: var(--sgs-link) !important; font-weight: 500;
}
.sgs-panel__btn:hover { background: var(--sgs-line-2); }

/* ---------- Không có kết quả + phân trang ------------------------------- */
.sgs-empty { font-size: 15px; color: var(--sgs-text-2); margin: 10px 0 30px; }
.sgs-empty ul { margin: 6px 0 0 18px; padding: 0; }
.sgs-empty a { color: var(--sgs-link); }

.sgs-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 10px 0 24px; }
.sgs-pager a, .sgs-pager span {
	min-width: 38px; height: 38px; padding: 0 10px; border-radius: 19px;
	display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
	color: var(--sgs-link);
}
.sgs-pager a:hover { background: var(--sgs-hover); }
.sgs-pager span.is-on { background: var(--sgs-accent); color: #fff; font-weight: 500; }
body.dark-active .sgs-pager span.is-on { color: #202124; }

/* ---------- Mẹo tìm ------------------------------------------------------ */
.sgs-help { max-width: 692px; margin: 8px 0 0; font-size: 14px; color: var(--sgs-text-2); }
.sgs--home .sgs-help { margin: 48px auto 0; }
.sgs-help summary { cursor: pointer; color: var(--sgs-text-3); padding: 6px 0; }
.sgs-help table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.sgs-help td { padding: 6px 8px; border-bottom: 1px solid var(--sgs-line-2); vertical-align: top; }
.sgs-help td:first-child { white-space: nowrap; width: 1%; }
.sgs-help code { background: var(--sgs-surface-2); color: var(--sgs-text); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.sgs-help kbd { border: 1px solid var(--sgs-line); border-radius: 4px; padding: 0 5px; font-size: 12px; }

/* ---------- Nút ở header ------------------------------------------------- */
.sgs-head { display: inline-flex; }
.sgs-head__form { margin: 0; display: flex; align-items: center; }
.sgs-head__fallback { display: none !important; }
.head-search .sgs-head__btn,
.sgs-head__btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
	background: transparent; color: inherit; transition: background .15s;
}
.sgs-head__btn:hover, .sgs-head__btn:focus-visible { background: rgba(255, 255, 255, .16); outline: 0; }
.head-search:has(.sgs-head) { width: auto !important; }

/* ---------- Hộp tìm nổi -------------------------------------------------- */
.sgs-ov {
	position: fixed; inset: 0; z-index: 100000;
	display: flex; justify-content: center; align-items: flex-start;
	padding: 12vh 16px 16px; background: rgba(32, 33, 36, .45);
	backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
	opacity: 0; transition: opacity .15s;
}
.sgs-ov.is-in { opacity: 1; }
.sgs-ov[hidden] { display: none; }
.sgs-ov__card {
	width: 100%; max-width: 692px; transform: translateY(-8px); transition: transform .15s;
}
.sgs-ov.is-in .sgs-ov__card { transform: none; }
.sgs-ov .sgs-box { box-shadow: var(--sgs-shadow-lg); border-color: transparent; height: 54px; }
.sgs-ov .sgs-box.is-open { box-shadow: var(--sgs-shadow-lg); }
.sgs-ov .sgs-sug { box-shadow: var(--sgs-shadow-lg); }
.sgs-ov__hint { text-align: center; color: rgba(255, 255, 255, .85); font-size: 13px; margin-top: 14px; }
.sgs-ov__hint kbd { border: 1px solid rgba(255,255,255,.5); border-radius: 4px; padding: 0 5px; font-size: 12px; }
.sgs-ov__hint a { color: #fff; text-decoration: underline; }
body.sgs-lock { overflow: hidden; }

/* ---------- Màn hình hẹp ------------------------------------------------- */
@media (max-width: 991.98px) {
	.sgs-layout.has-panel { grid-template-columns: minmax(0, 1fr); }
	.sgs-panel { position: static; order: -1; margin-bottom: 24px; }
}
@media (max-width: 575.98px) {
	.sgs { padding-left: 0; padding-right: 0; }
	.sgs .sgs-title { font-size: 18px; }
	.sgs-thumb { width: 72px; height: 72px; }
	.sgs-ov { padding: 0; background: var(--sgs-bg); backdrop-filter: none; }
	.sgs-ov__card { max-width: none; padding: 10px; }
	.sgs-ov .sgs-box { box-shadow: none; border-color: var(--sgs-line); }
	.sgs-ov .sgs-sug { position: static; box-shadow: none; border-radius: 0; clip-path: none; }
	.sgs-ov .sgs-box.is-open { border-radius: var(--sgs-radius); }
	.sgs-ov__hint { display: none; }
	.sgs-tab--tools { margin-left: 0; }
}

/* ---------- Khối giải đấu (chèn giữa kết quả) --------------------------- */
.sgs-evs { margin: 0 0 30px; padding: 16px 0; border-top: 1px solid var(--sgs-line-2); border-bottom: 1px solid var(--sgs-line-2); }
.sgs .sgs-evs h2 { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 400; margin: 0 0 12px; color: var(--sgs-text); }
.sgs-evs h2 svg { color: #b8860b; }
.sgs-evs__row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.sgs-ev { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--sgs-line-2); border-radius: 12px; font-size: 13px; min-width: 0; }
.sgs-ev:hover { box-shadow: var(--sgs-shadow); }
.sgs-ev__t { color: var(--sgs-link); font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sgs-ev__t:hover { text-decoration: underline; }
.sgs-ev__m { color: var(--sgs-text-3); font-size: 12px; }
.sgs-ev ul { list-style: none; margin: 2px 0 0; padding: 0; }
.sgs-ev li { display: flex; gap: 6px; align-items: flex-start; margin: 0 0 4px; line-height: 1.35; color: var(--sgs-text-2); }
.sgs-ev li b { color: var(--sgs-text); }
.sgs-ev li small { display: block; color: var(--sgs-text-3); font-size: 12px; }
.sgs-ev__more { margin-top: auto; color: var(--sgs-text-3); font-size: 12px; }

/* ---------- Tab Hình ảnh ------------------------------------------------- */
.sgs-imgs { display: flex; flex-wrap: wrap; gap: 16px 12px; margin: 4px 0 28px; }
.sgs-imgs::after { content: ""; flex-grow: 999; }
/* Ban đầu 220px; JS đổi flex theo tỉ lệ thật của ảnh → mỗi hàng căn đều như Google Images */
.sgs-img { flex: 1 1 220px; display: flex; flex-direction: column; min-width: 100px; max-width: 560px; color: var(--sgs-text); }
.sgs-img__box { display: block; height: 180px; border-radius: 12px; overflow: hidden; background: var(--sgs-surface-2); }
.sgs-img__box img { height: 100%; width: 100%; min-width: 120px; object-fit: cover; display: block; transition: transform .2s; }
.sgs-img:hover .sgs-img__box img { transform: scale(1.03); }
.sgs-img:focus-visible { outline: 2px solid var(--sgs-accent); outline-offset: 3px; border-radius: 12px; }
.sgs-img__src { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12px; color: var(--sgs-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sgs-img__src svg { color: var(--sgs-text-3); }
.sgs-img__t { font-size: 13px; line-height: 1.35; color: var(--sgs-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sgs-img:hover .sgs-img__t { text-decoration: underline; }

/* Xem ảnh lớn */
.sgs-lb {
	position: fixed; inset: 0; z-index: 100002; display: flex; align-items: center; justify-content: center;
	background: rgba(0, 0, 0, .88); padding: 56px 72px 24px;
}
.sgs-lb[hidden] { display: none; }
.sgs-lb__fig { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sgs-lb__fig img { max-width: 100%; max-height: calc(100vh - 170px); object-fit: contain; border-radius: 6px; background: #222; }
.sgs-lb__cap { text-align: center; color: #e8eaed; font-size: 14px; max-width: 760px; }
.sgs-lb__cap small { display: block; color: #9aa0a6; margin-bottom: 4px; }
.sgs-lb__cap a { display: inline-block; margin-top: 10px; padding: 8px 18px; border-radius: 20px; background: #8ab4f8; color: #202124 !important; font-weight: 500; }
.sgs-lb__btn {
	position: absolute; width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer;
	background: rgba(255, 255, 255, .12); color: #fff; font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.sgs-lb__btn:hover { background: rgba(255, 255, 255, .24); }
.sgs-lb__x { top: 12px; right: 12px; }
.sgs-lb__prev { left: 14px; top: 50%; margin-top: -22px; }
.sgs-lb__next { right: 14px; top: 50%; margin-top: -22px; }
.sgs-lb__n { position: absolute; top: 22px; left: 20px; color: #9aa0a6; font-size: 13px; }
@media (max-width: 575.98px) {
	.sgs-img__box { height: 130px; }
	.sgs-imgs { gap: 12px 8px; }
	.sgs-lb { padding: 56px 8px 16px; }
	.sgs-lb__prev, .sgs-lb__next { top: auto; bottom: 16px; margin: 0; }
}

/* Logo ảnh cho trang tìm (nếu có images/stories/logo/vnc-search-logo.*) */
.sgs-logo--img { letter-spacing: 0; line-height: 0; margin-bottom: 14px; }
.sgs-logo--img img { max-width: min(420px, 80vw); max-height: 120px; width: auto; height: auto; }
.sgs-logo__dark { display: none; }
body.dark-active .sgs-logo--img:has(.sgs-logo__dark) .sgs-logo__light { display: none; }
body.dark-active .sgs-logo__dark { display: inline; }

/* Bảng thông tin người: mục không có huy hiệu hạng, nút phụ, thông báo sửa chính tả */
.sgs-panel__dot { flex: none; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }
.sgs-panel__dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sgs-text-3); }
.sgs-panel__facts dd { overflow-wrap: anywhere; }
.sgs-panel__btn--2 { background: transparent; border: 1px solid var(--sgs-line); margin-top: 8px; }

.sgs-spell { margin: 12px 0 0; font-size: 18px; color: var(--sgs-text-2); }
.sgs-spell p { margin: 0 0 2px; }
.sgs-spell a { color: var(--sgs-link); }
.sgs-spell a:hover { text-decoration: underline; }
.sgs-spell__sub { font-size: 14px; color: var(--sgs-text-3); }
.sgs-alt { margin: 0 0 14px; }
.sgs-alt ul { list-style: none; margin: 4px 0 0; padding: 0; }
.sgs-alt li { margin: 4px 0; }
.sgs-alt a { font-size: 17px; }
.sgs-alt small { color: var(--sgs-text-3); margin-left: 8px; }
