/* Trình Giải Toán: bảng tin cộng đồng kiểu Threads.
   Dùng màu của theme (--surface, --ink, --line...) và có màu dự phòng khi dùng theme khác. */

.tgf, .tgf-page, .tgf-lightbox, .tgf-about {
	--tgf-bg: var(--surface, #fff);
	--tgf-bg2: var(--surface-2, #f2f4f8);
	--tgf-ink: var(--ink, #1c2333);
	--tgf-muted: var(--muted, #687389);
	--tgf-line: var(--line, #e3e7ef);
	--tgf-accent: var(--primary, #ff7a45);
	--tgf-blue: var(--blue, #3d7bfd);
	--tgf-red: var(--red, #ef4444);
	--tgf-heart: #ff3040;
	--tgf-av: 40px;
	--tgf-gap: 12px;
	/* Nút .tgc-btn và thông báo dùng chung của tgt-community.css */
	--tgc-bg: var(--tgf-bg);
	--tgc-bg2: var(--tgf-bg2);
	--tgc-ink: var(--tgf-ink);
	--tgc-line: var(--tgf-line);
	--tgc-accent: var(--tgf-accent);
	--tgc-accent-dark: var(--primary-dark, #e85d27);
	--tgc-red: var(--tgf-red);
}
.tgf { max-width: 680px; margin: 0 auto; color: var(--tgf-ink); }
.tgf *, .tgf *::before, .tgf *::after { box-sizing: border-box; }
.tgf img.avatar, .tgf-page img.avatar { border-radius: 50% !important; object-fit: cover; margin: 0; box-shadow: none; }
.tgf .tgc-avatar { width: var(--tgf-av); height: var(--tgf-av); }

/* Giới thiệu & nội quy (nội dung cũ của trang) */
.tgf-about { max-width: 680px; margin: 0 auto 16px; border: 1px solid var(--tgf-line); border-radius: 18px; background: var(--tgf-bg); }
.tgf-about summary { cursor: pointer; padding: 12px 18px; font-weight: 800; list-style: none; display: flex; align-items: center; gap: 8px; }
.tgf-about summary::-webkit-details-marker { display: none; }
.tgf-about summary::before { content: "ℹ️"; }
.tgf-about summary::after { content: "▾"; margin-left: auto; color: var(--tgf-muted); transition: transform .2s; }
.tgf-about[open] summary::after { transform: rotate(180deg); }
.tgf-about__body { padding: 0 18px 8px; border-top: 1px solid var(--tgf-line); }

/* Khung bảng tin giống Threads: một cột, viền mảnh, bo góc lớn */
.tgf-list, .tgf-composer, .tgf-gate, .tgf-note {
	background: var(--tgf-bg); border: 1px solid var(--tgf-line);
}
.tgf-composer, .tgf-gate, .tgf-note { border-radius: 22px 22px 0 0; border-bottom: 0; }
.tgf-list { border-radius: 0 0 22px 22px; overflow: hidden; }
.tgf--single .tgf-card { border: 1px solid var(--tgf-line); border-radius: 22px; background: var(--tgf-bg); }

/* Khung viết */
.tgf-composer { display: flex; gap: var(--tgf-gap); padding: 16px 18px; position: relative; }
.tgf-rail { flex: 0 0 var(--tgf-av); }
.tgf-main { flex: 1; min-width: 0; }
.tgf-composer__who { font-weight: 800; line-height: 1.3; display: none; }
.tgf-composer.is-open .tgf-composer__who { display: block; }
.tgf-composer textarea {
	display: block; width: 100%; border: 0; outline: 0; resize: none; background: transparent; padding: 8px 0; height: 40px; min-height: 40px;
	line-height: 1.5; font-size: 1rem; color: var(--tgf-ink); box-shadow: none; font-family: inherit;
}
.tgf-composer.is-open textarea { padding-top: 2px; }
.tgf-composer textarea::placeholder { color: var(--tgf-muted); }
.tgf-bar { display: flex; align-items: center; gap: 4px; }
.tgf-composer:not(.is-open) .tgf-bar { position: absolute; right: 18px; top: 16px; }
.tgf-composer:not(.is-open) .tgf-tool, .tgf-composer:not(.is-open) .tgf-tip, .tgf-composer:not(.is-open) .tgf-hint { display: none; }
.tgf-composer:not(.is-open) .tgf-main { padding-right: 80px; }
.tgf-composer.is-open .tgf-bar { margin-top: 8px; }
.tgf-tool {
	display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--tgf-muted); cursor: pointer;
}
.tgf-tool:hover { background: var(--tgf-bg2); color: var(--tgf-ink); }
.tgf-tip { flex: 1; font-size: .78rem; color: var(--tgf-muted); padding-left: 6px; min-width: 0; }
.tgf-tip code { font-size: .78rem; background: var(--tgf-bg2); padding: 1px 5px; border-radius: 6px; }
.tgf-counter { font-size: .8rem; color: var(--tgf-muted); font-weight: 700; }
.tgf-counter.is-over { color: var(--tgf-red); }
.tgf-submit {
	margin-left: auto; border: 1.5px solid var(--tgf-line); background: var(--tgf-bg); color: var(--tgf-ink); border-radius: 12px; padding: 7px 18px;
	font-weight: 800; font-size: .95rem; cursor: pointer; transition: background .15s, color .15s, opacity .15s;
}
.tgf-composer.has-text .tgf-submit { background: var(--tgf-ink); color: var(--tgf-bg); border-color: var(--tgf-ink); }
.tgf-submit:disabled, .tgf-composer.is-busy .tgf-submit { opacity: .5; cursor: wait; }
.tgf-composer.is-busy { opacity: .8; }
.tgf-hint { margin: 6px 0 0; font-size: .82rem; color: #b46a00; font-weight: 700; }
.tgf-msg { margin: 8px 0 0; font-size: .88rem; font-weight: 700; color: var(--green, #22b07d); }
.tgf-msg.is-error { color: var(--tgf-red); }
.tgf-composer__link input {
	width: 100%; margin: 6px 0 2px; padding: 9px 12px; border: 1.5px solid var(--tgf-line); border-radius: 12px; background: var(--tgf-bg2);
	color: var(--tgf-ink); font-size: .92rem;
}
.tgf-composer__link input:focus { border-color: var(--tgf-blue); outline: 0; }
.tgf-composer__quote { position: relative; margin-top: 8px; }
.tgf-composer__quote .tgf-quote { margin-top: 0; pointer-events: none; }
.tgf-x {
	position: absolute; top: 6px; right: 6px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer;
	background: rgba(0, 0, 0, .65); color: #fff; font-size: 18px; line-height: 1; display: grid; place-items: center;
}
.tgf-thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
.tgf-thumbs:not(:empty) { margin-top: 8px; padding-bottom: 4px; }
.tgf-thumb {
	position: relative; flex: 0 0 auto; width: 120px; height: 150px; border-radius: 12px; overflow: hidden; background: var(--tgf-bg2);
	border: 1px solid var(--tgf-line);
}
.tgf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tgf-thumb__size {
	position: absolute; left: 6px; bottom: 6px; right: 6px; font-size: .68rem; font-weight: 800; color: #fff; background: rgba(0, 0, 0, .55);
	border-radius: 8px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tgf-thumb__size:empty { display: none; }
.tgf-thumb__spin {
	position: absolute; inset: 0; margin: auto; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--tgf-line);
	border-top-color: var(--tgf-accent); animation: tgf-spin .8s linear infinite;
}
.tgf-thumb:not(.is-busy) .tgf-thumb__spin { display: none; }
@keyframes tgf-spin { to { transform: rotate(360deg); } }

.tgf-gate, .tgf-note { padding: 18px; text-align: center; }
.tgf-gate p { margin: 0 0 12px; color: var(--tgf-muted); }
.tgf-gate .tgc-btn { margin: 2px 4px; }
.tgf-note { margin: 0; color: var(--tgf-muted); font-size: .92rem; font-weight: 600; }

/* Một bài */
.tgf-card { position: relative; padding: 14px 18px 8px; border-top: 1px solid var(--tgf-line); background: var(--tgf-bg); transition: background .15s, opacity .3s; }
.tgf-list > .tgf-card:first-child { border-top: 1px solid var(--tgf-line); }
.tgf-list > .tgf-card { cursor: pointer; }
.tgf-list > .tgf-card:hover { background: color-mix(in srgb, var(--tgf-bg2) 35%, var(--tgf-bg)); }
.tgf-card.is-new { animation: tgf-in .45s ease-out; }
.tgf-card.is-removing { opacity: 0; }
.tgf-card.is-pending { background: rgba(255, 159, 28, .06); }
@keyframes tgf-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tgf-row { display: flex; gap: var(--tgf-gap); }
.tgf-pinned { display: flex; align-items: center; gap: 4px; margin: 0 0 6px calc(var(--tgf-av) + var(--tgf-gap)); font-size: .8rem; font-weight: 800; color: var(--tgf-muted); }
.tgf-pinned .tgf-ico { width: 14px; height: 14px; }

.tgf-head { display: flex; align-items: center; gap: 6px; line-height: 1.3; min-height: 22px; }
.tgf-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgf-tick { flex: 0 0 auto; }
.tgf-time { color: var(--tgf-muted); font-size: .9rem; text-decoration: none; white-space: nowrap; }
.tgf-time:hover { text-decoration: underline; color: var(--tgf-muted); }
.tgf-menu { position: relative; margin-left: auto; }
.tgf-menu__btn { height: 30px; min-width: 30px; }
.tgf-menu__list {
	position: absolute; right: 0; top: 100%; z-index: 20; min-width: 210px; padding: 6px; border-radius: 16px; background: var(--tgf-bg);
	border: 1px solid var(--tgf-line); box-shadow: 0 12px 30px rgba(0, 0, 0, .14);
}
.tgf-menu__list[hidden] { display: none; }
.tgf-menu__list > * {
	display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--tgf-ink);
	font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer; text-decoration: none;
}
.tgf-menu__list > *:hover { background: var(--tgf-bg2); color: var(--tgf-ink); }
.tgf-menu__list .is-danger { color: var(--tgf-red); }
.tgf-pending { font-size: .82rem; color: #b46a00; font-weight: 700; margin: 2px 0 0; }

.tgf-text { margin-top: 2px; overflow-wrap: anywhere; line-height: 1.55; }
.tgf-text p { margin: 0 0 .6em; }
.tgf-text p:last-child { margin-bottom: 0; }
.tgf-text a { color: var(--tgf-blue); text-decoration: none; }
.tgf-text a:hover { text-decoration: underline; }
.tgf-text .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.tgf-text.is-clamped { max-height: 15.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.tgf-readmore { border: 0; background: none; padding: 2px 0; color: var(--tgf-muted); font-weight: 800; cursor: pointer; }
.tgf-readmore:hover { color: var(--tgf-ink); }
.tgf-card--single .tgf-text { font-size: 1.05rem; }

/* Ảnh: 1 ảnh hiện theo tỉ lệ gốc, nhiều ảnh thành dải vuốt ngang */
.tgf-media { margin-top: 10px; }
.tgf-media__item { display: block; flex: 0 0 auto; border-radius: 12px; overflow: hidden; border: 1px solid var(--tgf-line); background: var(--tgf-bg2); cursor: zoom-in; }
.tgf-media img { display: block; margin: 0; border-radius: 0; max-width: none; box-shadow: none; }
.tgf-media--one .tgf-media__item { display: inline-block; max-width: 100%; }
.tgf-media--one img { max-width: 100%; height: auto; max-height: 520px; width: auto; }
.tgf-media--row {
	display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-bottom: 2px;
	margin-right: -18px; padding-right: 18px;
}
.tgf-media--row::-webkit-scrollbar { display: none; }
.tgf-media--row .tgf-media__item { scroll-snap-align: start; height: 250px; }
.tgf-media--row img { height: 100%; width: auto; max-width: 420px; object-fit: cover; }

/* Video/liên kết nhúng và bài trích dẫn */
.tgf-embed { margin-top: 10px; border-radius: 12px; overflow: hidden; }
.tgf-embed iframe { display: block; width: 100%; max-width: 100%; border: 0; border-radius: 12px; }
.tgf-embed iframe[src*="youtube"], .tgf-embed iframe[src*="vimeo"] { aspect-ratio: 16 / 9; height: auto; }
.tgf-embed blockquote { margin: 0; }
.tgf-linkcard {
	display: grid; gap: 2px; margin-top: 10px; padding: 12px 14px; border: 1px solid var(--tgf-line); border-radius: 14px; text-decoration: none;
	color: var(--tgf-ink); background: var(--tgf-bg);
}
.tgf-linkcard:hover { background: var(--tgf-bg2); color: var(--tgf-ink); }
.tgf-linkcard__host { font-size: .78rem; color: var(--tgf-muted); font-weight: 700; }
.tgf-linkcard b { overflow-wrap: anywhere; }
.tgf-linkcard__desc { font-size: .88rem; color: var(--tgf-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tgf-quote {
	display: block; margin-top: 10px; padding: 12px 14px; border: 1px solid var(--tgf-line); border-radius: 14px; text-decoration: none; color: var(--tgf-ink);
	background: var(--tgf-bg);
}
a.tgf-quote:hover { background: var(--tgf-bg2); color: var(--tgf-ink); }
.tgf-quote__head { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.tgf-quote__head .tgc-avatar { --tgf-av: 22px; width: 22px; height: 22px; font-size: 10px !important; }
.tgf-quote__head .tgf-tick { width: 14px; height: 14px; }
.tgf-quote__body { display: flex; gap: 10px; margin-top: 4px; }
.tgf-quote__text { flex: 1; font-size: .92rem; overflow-wrap: anywhere; }
.tgf-quote__img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: 0 0 auto; margin: 0; }
.tgf-quote--gone { color: var(--tgf-muted); font-size: .88rem; }

/* Thích, trả lời, đăng lại, chia sẻ */
.tgf-actions { display: flex; align-items: center; gap: 4px; margin: 8px 0 0 -9px; }
.tgf-act {
	display: inline-flex; align-items: center; gap: 5px; height: 36px; min-width: 36px; padding: 0 10px; border: 0; border-radius: 999px;
	background: none; color: var(--tgf-ink); font-size: .88rem; font-weight: 600; cursor: pointer; text-decoration: none;
	transition: background .15s, color .15s;
}
.tgf-act:hover { background: var(--tgf-bg2); color: var(--tgf-ink); }
.tgf-act:disabled { opacity: .4; cursor: default; }
.tgf-act .tgf-ico { width: 20px; height: 20px; }
.tgf-count:empty { display: none; }
.tgf-like.is-liked { color: var(--tgf-heart); }
.tgf-like.is-liked .tgf-ico { fill: currentColor; }
.tgf-like.is-pop .tgf-ico { animation: tgf-pop .35s ease-out; }
@keyframes tgf-pop { 40% { transform: scale(1.35); } }

.tgf-empty { margin: 0; padding: 28px 18px; text-align: center; color: var(--tgf-muted); }
.tgf-more {
	display: block; margin: 16px auto 0; padding: 10px 22px; border-radius: 999px; border: 1px solid var(--tgf-line); background: var(--tgf-bg);
	color: var(--tgf-ink); font-weight: 800; cursor: pointer;
}
.tgf-more:hover { border-color: var(--tgf-ink); }

/* Trang riêng của một bài */
.tgf-page { padding: 24px 16px 48px; }
.tgf-page__wrap { max-width: 680px; margin: 0 auto; }
.tgf-back { display: inline-block; margin-bottom: 12px; font-weight: 800; text-decoration: none; color: var(--tgf-muted); }
.tgf-back:hover { color: var(--tgf-ink); }
.tgf-page .tgc { margin-top: 20px; }

/* Xem ảnh lớn */
.tgf-lightbox {
	position: fixed; inset: 0; z-index: 10000; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center;
	padding: 48px 12px;
}
.tgf-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.tgf-lightbox button {
	position: absolute; border: 0; cursor: pointer; background: rgba(255, 255, 255, .14); color: #fff; width: 44px; height: 44px; border-radius: 50%;
	font-size: 28px; line-height: 1; display: grid; place-items: center;
}
.tgf-lightbox button:hover { background: rgba(255, 255, 255, .26); }
.tgf-lightbox__close { top: 12px; right: 12px; }
.tgf-lightbox__nav.is-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.tgf-lightbox__nav.is-next { right: 12px; top: 50%; transform: translateY(-50%); }
.tgf-lightbox__nav[hidden] { display: none; }
.tgf-lightbox__count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #fff; font-weight: 700; font-size: .9rem; }
.tgf-noscroll, .tgf-noscroll body { overflow: hidden; }

@media (max-width: 600px) {
	.tgf, .tgf-page { --tgf-av: 36px; --tgf-gap: 10px; }
	.tgf-card { padding: 12px 14px 6px; }
	.tgf-composer { padding: 14px; }
	.tgf-composer:not(.is-open) .tgf-bar { right: 14px; top: 14px; }
	.tgf-tip { display: none; }
	.tgf-media--row { margin-right: -14px; padding-right: 14px; }
	.tgf-media--row .tgf-media__item { height: 200px; }
	.tgf-media--row img { max-width: 300px; }
	.tgf-media--one img { max-height: 420px; }
	.tgf-act { padding: 0 8px; }
	.tgf-page { padding: 16px 0 40px; }
	.tgf-back { margin-left: 14px; }
	.tgf--single .tgf-card { border-radius: 0; border-left: 0; border-right: 0; }
	.tgf-page .tgc { padding-left: 14px; padding-right: 14px; }
}

/* ================= Bố cục 3 cột: menu trái, bảng tin, khám phá ================= */
.tgf-layout {
	--tgf-bg: var(--surface, #fff);
	--tgf-bg2: var(--surface-2, #f2f4f8);
	--tgf-ink: var(--ink, #1c2333);
	--tgf-muted: var(--muted, #687389);
	--tgf-line: var(--line, #e3e7ef);
	--tgf-accent: var(--primary, #ff7a45);
	--tgf-blue: var(--blue, #3d7bfd);
	--tgc-bg: var(--tgf-bg); --tgc-bg2: var(--tgf-bg2); --tgc-ink: var(--tgf-ink); --tgc-line: var(--tgf-line);
	--tgc-accent: var(--tgf-accent); --tgc-accent-dark: var(--primary-dark, #e85d27);
	display: grid; grid-template-columns: 220px minmax(0, 640px) 320px; gap: 28px; justify-content: center; align-items: start;
	width: min(1240px, calc(100vw - 56px)); position: relative; left: 50%; transform: translateX(-50%); color: var(--tgf-ink);
}
.tgf-layout *, .tgf-layout *::before, .tgf-layout *::after { box-sizing: border-box; }
.tgf-layout .tgf { max-width: none; margin: 0; min-width: 0; }
.tgf-layout .tgf-about { max-width: none; }
.tgf-layout img.avatar { border-radius: 50% !important; object-fit: cover; margin: 0; box-shadow: none; }

/* Menu trái */
.tgf-nav { position: sticky; top: 92px; }
.tgf-nav__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tgf-nav__item {
	display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; color: var(--tgf-ink); text-decoration: none;
	font-weight: 600; transition: background .15s;
}
.tgf-nav__item:hover { background: var(--tgf-bg2); color: var(--tgf-ink); }
.tgf-nav__item.is-active { background: var(--tgf-bg); font-weight: 800; box-shadow: 0 0 0 1px var(--tgf-line); }
.tgf-nav__item .tgf-ico { width: 22px; height: 22px; flex: 0 0 auto; }
.tgf-nav__item.is-active .tgf-ico { stroke-width: 2.4; }
.tgf-nav__dot {
	margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #ff3040; color: #fff;
	font-size: .72rem; font-weight: 800; display: grid; place-items: center;
}
.tgf-nav__label { margin: 18px 12px 6px; font-size: .8rem; font-weight: 700; color: var(--tgf-muted); }

/* Cột phải */
.tgf-aside { display: grid; gap: 16px; min-width: 0; }
.tgf-search { position: relative; margin: 0; }
.tgf-search .tgf-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--tgf-muted); pointer-events: none; }
.tgf-search input[type="search"] {
	width: 100%; height: 46px; padding: 0 16px 0 42px; border-radius: 16px; border: 1px solid var(--tgf-line); background: var(--tgf-bg);
	color: var(--tgf-ink); font-size: .95rem; font-family: inherit; box-shadow: none;
}
.tgf-search input[type="search"]:focus { outline: 0; border-color: var(--tgf-blue); }
.tgf .tgf-search { margin-bottom: 14px; }
.tgf-box { background: var(--tgf-bg); border: 1px solid var(--tgf-line); border-radius: 20px; padding: 16px 18px; }
.tgf-box__title { margin: 0; font-size: 1.05rem; font-weight: 900; }
.tgf-box__sub { margin: 2px 0 10px; font-size: .8rem; color: var(--tgf-muted); }
.tgf-box__more { border: 0; background: none; padding: 6px 0 0; color: var(--tgf-muted); font-weight: 700; cursor: pointer; font-family: inherit; }
.tgf-box__more:hover { color: var(--tgf-ink); }
.tgf-trend__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tgf-trend__list li.is-extra { display: none; }
.tgf-trend.is-all .tgf-trend__list li.is-extra { display: block; }
.tgf-trend__list a { display: grid; gap: 3px; padding: 8px 10px; margin: 0 -10px; border-radius: 12px; text-decoration: none; color: var(--tgf-ink); }
.tgf-trend__list a:hover { background: var(--tgf-bg2); color: var(--tgf-ink); }
.tgf-trend__list b { font-weight: 800; overflow-wrap: anywhere; }
.tgf-trend__desc { font-size: .84rem; color: var(--tgf-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tgf-pill { justify-self: start; font-size: .74rem; font-weight: 700; color: var(--tgf-muted); background: var(--tgf-bg2); border-radius: 8px; padding: 2px 8px; }
.tgf-box .tgf-people { margin-top: 10px; }

/* Người dùng và nút theo dõi */
.tgf-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.tgf-people--search { margin-bottom: 14px; padding: 14px 18px; background: var(--tgf-bg); border: 1px solid var(--tgf-line); border-radius: 20px; }
.tgf-person { display: flex; gap: 10px; align-items: flex-start; }
.tgf-person__av .tgc-avatar { width: 44px; height: 44px; }
.tgf-person__main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.tgf-person__name { display: flex; align-items: center; gap: 4px; color: var(--tgf-ink); text-decoration: none; min-width: 0; }
.tgf-person__name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgf-person__handle, .tgf-person__meta { font-size: .82rem; color: var(--tgf-muted); }
.tgf-person__bio { font-size: .86rem; margin-top: 3px; overflow-wrap: anywhere; }
.tgf-follow {
	flex: 0 0 auto; border: 1px solid var(--tgf-ink); background: var(--tgf-ink); color: var(--tgf-bg); border-radius: 12px;
	padding: 7px 16px; font-weight: 800; font-size: .88rem; cursor: pointer; font-family: inherit; transition: opacity .15s;
}
.tgf-follow.is-on { background: transparent; color: var(--tgf-muted); border-color: var(--tgf-line); }
.tgf-follow:disabled { opacity: .5; }
.tgf-follow--sm { padding: 5px 12px; font-size: .82rem; }
.tgf-follow--wide, .tgf-profile__btn { display: block; width: 100%; text-align: center; padding: 9px 16px; }

/* Tiêu đề các mục */
.tgf-view-head { margin: 0 0 12px; }
.tgf-view-head h2 { margin: 0; font-size: 1.3rem; font-weight: 900; }
.tgf-view-head p { margin: 2px 0 0; color: var(--tgf-muted); font-size: .9rem; }
.tgf-layout .tgf-list { border-radius: 22px; }
.tgf-layout .tgf-view-head + .tgf-list, .tgf-layout .tgf-search + .tgf-list, .tgf-layout .tgf-people--search + .tgf-list, .tgf-layout .tgf-profile + .tgf-list { border-top-left-radius: 22px; border-top-right-radius: 22px; }
.tgf-layout .tgf-composer + .tgf-list, .tgf-layout .tgf-gate + .tgf-list, .tgf-layout .tgf-note + .tgf-list { border-top-left-radius: 0; border-top-right-radius: 0; }
.tgf-layout .tgf-list > .tgf-card:first-child { border-top: 0; }
.tgf-layout .tgf-view-head + .tgf-gate { border-radius: 22px; border-bottom: 1px solid var(--tgf-line); }
.tgf-layout .tgf > .tgf-empty { background: var(--tgf-bg); border: 1px solid var(--tgf-line); border-radius: 22px; }
.tgf-tag { color: var(--tgf-blue); font-weight: 700; }
.tgf-discover { display: grid; gap: 16px; }

/* Trang cá nhân */
.tgf-profile { background: var(--tgf-bg); border: 1px solid var(--tgf-line); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 20px 18px 0; }
.tgf-profile + .tgf-list { border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; }
.tgf-profile__top { display: flex; align-items: center; gap: 16px; }
.tgf-profile__top .tgc-avatar { width: 84px; height: 84px; font-size: 36px !important; }
.tgf-profile__who { flex: 1; min-width: 0; }
.tgf-profile__who h2 { margin: 0; font-size: 1.5rem; font-weight: 900; display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.tgf-profile__who span { color: var(--tgf-muted); }
.tgf-profile__bio { margin: 12px 0 0; }
.tgf-profile__meta { margin: 10px 0 14px; color: var(--tgf-muted); font-size: .92rem; }
.tgf-profile__meta b { color: var(--tgf-ink); }
.tgf-profile__btn { border: 1px solid var(--tgf-line); border-radius: 12px; color: var(--tgf-ink); font-weight: 800; text-decoration: none; }
.tgf-profile__btn:hover { background: var(--tgf-bg2); color: var(--tgf-ink); }
.tgf-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 14px -18px 0; border-bottom: 1px solid var(--tgf-line); }
.tgf-tabs a { text-align: center; padding: 12px; font-weight: 700; color: var(--tgf-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tgf-tabs a.is-active { color: var(--tgf-ink); border-bottom-color: var(--tgf-ink); }
.tgf-replies { list-style: none; margin: 0; padding: 0; background: var(--tgf-bg); border: 1px solid var(--tgf-line); border-top: 0; border-radius: 0 0 22px 22px; overflow: hidden; }
.tgf-replies li + li { border-top: 1px solid var(--tgf-line); }
.tgf-replies a { display: grid; gap: 4px; padding: 14px 18px; text-decoration: none; color: var(--tgf-ink); }
.tgf-replies a:hover { background: var(--tgf-bg2); color: var(--tgf-ink); }
.tgf-replies__to { font-size: .82rem; color: var(--tgf-muted); font-weight: 700; }
.tgf-profile + .tgf-empty { border-radius: 0 0 22px 22px !important; border-top: 0 !important; }

/* Hoạt động */
.tgf-activity { list-style: none; margin: 0; padding: 0; background: var(--tgf-bg); border: 1px solid var(--tgf-line); border-radius: 22px; overflow: hidden; }
.tgf-activity__item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; }
.tgf-activity__item + .tgf-activity__item { border-top: 1px solid var(--tgf-line); }
.tgf-activity__item.is-new { background: rgba(61, 123, 253, .06); }
.tgf-activity__av { position: relative; flex: 0 0 auto; }
.tgf-activity__av .tgc-avatar { width: 40px; height: 40px; }
.tgf-activity__ico {
	position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
	color: #fff; border: 2px solid var(--tgf-bg); background: #8b5cf6;
}
.tgf-activity__ico .tgf-ico { width: 11px; height: 11px; stroke-width: 3; }
.tgf-activity__ico.is-like { background: #ff3040; }
.tgf-activity__ico.is-reply { background: #1d9bf0; }
.tgf-activity__ico.is-repost { background: #22b07d; }
.tgf-activity__body { flex: 1; min-width: 0; display: grid; gap: 2px; color: var(--tgf-ink); text-decoration: none; }
.tgf-activity__body:hover { color: var(--tgf-ink); }
.tgf-activity__text { color: var(--tgf-muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Thông tin chi tiết */
.tgf-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.tgf-stat { background: var(--tgf-bg); border: 1px solid var(--tgf-line); border-radius: 16px; padding: 14px 16px; display: grid; gap: 4px; }
.tgf-stat span { font-size: .82rem; color: var(--tgf-muted); font-weight: 700; }
.tgf-stat b { font-size: 1.6rem; font-weight: 900; line-height: 1.1; }
.tgf-top { margin: 10px 0 0; padding: 0; list-style: none; background: var(--tgf-bg); border: 1px solid var(--tgf-line); border-radius: 18px; overflow: hidden; counter-reset: top; }
.tgf-top li { display: grid; gap: 3px; padding: 12px 16px 12px 46px; position: relative; counter-increment: top; }
.tgf-top li::before { content: counter(top); position: absolute; left: 16px; top: 12px; font-weight: 900; color: var(--tgf-muted); }
.tgf-top li + li { border-top: 1px solid var(--tgf-line); }
.tgf-top a { font-weight: 700; text-decoration: none; color: var(--tgf-ink); }
.tgf-top span { font-size: .82rem; color: var(--tgf-muted); }

@media (min-width: 1181px) {
	.tgf-discover { display: none; }
}
@media (max-width: 1180px) {
	.tgf-layout { grid-template-columns: 200px minmax(0, 640px); }
	.tgf-aside { display: none; }
}
/* Máy tính bảng, điện thoại: menu thành hàng nút cuộn ngang trên đầu */
@media (max-width: 900px) {
	.tgf-layout { display: block; width: auto; left: auto; transform: none; }
	.tgf-nav {
		position: static; display: flex; gap: 6px; overflow-x: auto; margin: 0 0 14px; padding-bottom: 4px; scrollbar-width: none;
	}
	.tgf-nav::-webkit-scrollbar { display: none; }
	.tgf-nav__label { display: none; }
	.tgf-nav__list { display: flex; gap: 6px; }
	.tgf-nav__item {
		white-space: nowrap; padding: 8px 14px; gap: 6px; border: 1px solid var(--tgf-line); background: var(--tgf-bg); border-radius: 999px; font-size: .9rem;
	}
	.tgf-nav__item .tgf-ico { width: 18px; height: 18px; }
	.tgf-nav__item.is-active { background: var(--tgf-ink); color: var(--tgf-bg); box-shadow: none; border-color: var(--tgf-ink); }
	.tgf-nav__dot { margin-left: 2px; }
	.tgf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Theme TGT giới hạn mọi khối trong nội dung trang ở 760px và đặt lề cho h2/h3: bỏ cho bảng tin. */
.tgf-layout.tgf-layout { max-width: none; margin-left: 0; margin-right: 0; }
.tgf-layout .tgf-box__title, .tgf-layout .tgf-view-head h2, .tgf-layout .tgf-profile__who h2 { margin-top: 0; }
.tgf-layout .tgf-view-head h2, .tgf-layout .tgf-profile__who h2 { font-size: 1.3rem; }
.tgf-layout .tgf-profile__who h2 { font-size: 1.5rem; }
.tgf-layout .tgf-box__title { font-size: 1.05rem; }
.tgf-card a.tgf-name { color: var(--tgf-ink); text-decoration: none; }
.tgf-card a.tgf-name:hover { text-decoration: underline; color: var(--tgf-ink); }
