/* feed.css — bài viết, composer, feed, chi tiết, kiểm duyệt. Mobile-first.
   Dùng token ngữ nghĩa từ tokens.css; xanh/đỏ chỉ cho tăng/giảm & trạng thái. */

/* Thuộc tính [hidden] PHẢI thắng display:flex/grid của component (poll, hẹn giờ…). */
[hidden] { display: none !important; }

/* ---- Feed layout (mobile 1 cột; lg đã có .shell 3 cột ở home.css) ---- */
.feed-main { min-width: 0; }
/* An toàn notch: bottom-nav chừa safe-area đáy; nội dung không bị che. */
.bottom-nav { padding-bottom: env(safe-area-inset-bottom, 0); box-sizing: content-box; }
.feed-empty { color: var(--muted); padding: 24px 4px; text-align: center; }

.feed-tabs {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 4px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  margin: 0 0 8px;
}
.feed-tab {
  flex: 1; text-align: center; padding: 14px 8px;
  color: var(--muted); font-weight: 600; text-decoration: none;
  border-bottom: 2px solid transparent;
  min-height: 44px;
}
.feed-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.feed-tab:hover { color: var(--text); }

.feed-list { display: flex; flex-direction: column; }
.feed-more {
  display: block; text-align: center; padding: 14px; margin: 8px 0 80px;
  color: var(--accent); font-weight: 600; text-decoration: none;
  border: 1px solid var(--border); border-radius: var(--r-md);
}
.feed-more:hover { background: var(--surface-2); }

/* ---- Composer ---- */
.composer {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 12px; margin-bottom: 12px;
}
.composer-row { display: flex; gap: 10px; align-items: flex-start; }
.composer-input {
  flex: 1; min-width: 0; border: 0; background: transparent; resize: vertical;
  font: inherit; color: var(--text); padding: 8px 4px; min-height: 48px;
  line-height: 1.5;
}
.composer-input:focus { outline: none; }
/* Mobile-first: xếp DỌC để không tràn ngang ở 320/375 (margin-left:auto +
   note dài từng gây overflow). ≥480px mới xếp ngang. */
.composer-foot {
  display: flex; flex-direction: column; align-items: stretch;
  gap: 10px; margin-top: 8px; min-width: 0;
  border-top: 1px solid var(--border); padding-top: 10px;
}
.composer-hold { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9em; min-width: 0; }
.composer-hold input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.composer-actions { display: flex; align-items: center; gap: 10px; justify-content: space-between; min-width: 0; }
.composer-note { color: var(--faint); font-size: .82em; min-width: 0; }
@media (min-width: 480px) {
  .composer-foot { flex-direction: row; align-items: center; }
  .composer-actions { margin-left: auto; justify-content: flex-end; }
}

/* ---- Post card ---- */
.post-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px; margin-bottom: 12px;
}
.pc-head { display: flex; align-items: center; gap: 10px; }
.pc-avatar { flex: none; width: 40px; height: 40px; border-radius: var(--r-pill); overflow: hidden; }
.pc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pc-avatar-fb {
  display: grid; place-items: center; width: 100%; height: 100%;
  background: var(--surface-2); color: var(--muted);
}
.pc-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pc-name { font-weight: 700; color: var(--text); text-decoration: none; }
.pc-name:hover { text-decoration: underline; }
.pc-meta { color: var(--muted); font-size: .85em; }
.pc-badge {
  margin-left: auto; flex: none; font-size: .72em; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
  padding: 3px 8px; border-radius: var(--r-pill);
}
.pc-body { margin: 10px 0 0; line-height: 1.6; overflow-wrap: anywhere; }
.pc-body .cashtag { color: var(--accent); font-weight: 600; text-decoration: none; }
.pc-body .hashtag { color: var(--accent); text-decoration: none; }
.pc-body .post-disclaimer {
  margin-top: 10px; font-size: .8em; color: var(--muted);
  background: var(--surface-2); border-left: 3px solid var(--border-strong);
  padding: 6px 10px; border-radius: var(--r-sm);
}

/* Gallery — lưới mobile-first, ảnh giữ tỉ lệ, lazy. */
.pc-gallery { display: grid; gap: 4px; margin-top: 10px; border-radius: var(--r-md); overflow: hidden; }
.pc-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 16/10; }
.pc-gallery.g1 { grid-template-columns: 1fr; }
.pc-gallery.g2 { grid-template-columns: 1fr 1fr; }
.pc-gallery.g3 { grid-template-columns: 1fr 1fr; }
.pc-gallery.g3 img:first-child { grid-column: 1 / -1; }
.pc-gallery.g4 { grid-template-columns: 1fr 1fr; }

.pc-link {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--muted); text-decoration: none; font-size: .88em;
  overflow: hidden;
}
.pc-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-link:hover { background: var(--surface-2); }

/* Action bar — tap target lớn cho mobile (≥44px). */
.pc-actions { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.pc-actform { margin: 0; }
.pc-share { margin-left: auto; }
.pc-act {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 8px 12px; border: 0; background: none;
  color: var(--muted); cursor: pointer; border-radius: var(--r-pill);
  font: inherit; text-decoration: none; transition: background .15s, color .15s, transform .1s;
}
/* Nền hover CHỈ trên thiết bị có chuột thật — tránh hover "dính" trên mobile làm
   nút like/bookmark đọng nền pill sau khi chạm. Trạng thái đã-thích/lưu chỉ ĐỔI MÀU. */
@media (hover: hover) {
  .pc-act:hover { background: var(--surface-2); color: var(--text); }
}
.pc-act:active { transform: scale(.94); }
.pc-act:focus { outline: none; }
.pc-act:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.pc-act .fa-icon { width: 1.15em; height: 1.15em; }
.pc-act.liked { color: var(--danger); }
.pc-act.saved { color: var(--accent); }

/* ---- Trang chi tiết ---- */
.detail-wrap { max-width: 680px; margin: 0 auto; padding-bottom: 88px; }
.detail-bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; margin-bottom: 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
}
.detail-title { font-weight: 700; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--r-pill); color: var(--text); text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); }

/* ---- Bình luận ---- */
.comments { margin-top: 8px; }
.comments-h { font-size: 1.05em; margin: 4px 0 12px; }
.comments-empty { padding: 8px 0 16px; }
.cm { margin-bottom: 14px; }
.cm-item { display: flex; gap: 10px; align-items: flex-start; }
.cm-avatar { flex: none; width: 32px; height: 32px; border-radius: var(--r-pill); overflow: hidden; }
.cm-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cm-avatar-fb { display: grid; place-items: center; width: 100%; height: 100%; background: var(--surface-2); color: var(--muted); }
.cm-bubble { flex: 1; min-width: 0; background: var(--surface-2); border-radius: var(--r-md); padding: 8px 12px; }
.cm-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cm-name { font-weight: 600; }
.cm-meta { color: var(--muted); font-size: .82em; }
.cm-body { margin-top: 2px; line-height: 1.55; overflow-wrap: anywhere; }
.cm-body .cashtag, .cm-body .hashtag { color: var(--accent); text-decoration: none; }
.cm-replybox { margin: 4px 0 0 42px; }
.cm-replybox summary { color: var(--muted); cursor: pointer; font-size: .85em; padding: 6px 0; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.cm-replies { margin: 8px 0 0 42px; display: flex; flex-direction: column; gap: 10px; }

.cm-form { display: flex; gap: 8px; align-items: flex-end; margin: 8px 0; }
.cm-input {
  flex: 1; min-width: 0; resize: vertical; min-height: 44px; font: inherit; line-height: 1.5;
  color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 10px 12px;
}
.cm-input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* ---- Sidebar mở rộng (rail) cho feed ---- */
.rail-right { /* ẩn ở mobile qua .rail trong home.css */ }
.rail-title { font-weight: 700; margin: 0 0 6px; }
.me-id { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.me-name { font-weight: 700; }
.me-user { color: var(--muted); font-size: .86em; }
.navmenu { display: flex; flex-direction: column; gap: 2px; margin: 10px 0; }
.navmenu .navlink { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.navlink-admin { position: relative; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-grid; place-items: center; font-size: .72em; font-weight: 700;
  color: var(--on-accent); background: var(--danger); border-radius: var(--r-pill);
}

/* ---- Kiểm duyệt (admin) ---- */
.mod-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 88px; }
.mod-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; }
.mod-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.mod-author { font-weight: 600; }
.mod-time { color: var(--muted); font-size: .82em; flex: none; }
.mod-flag { color: var(--danger); font-size: .85em; display: flex; align-items: center; gap: 6px; margin: 8px 0 0; }
.mod-body { margin: 8px 0; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.mod-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mod-reject { display: flex; gap: 6px; flex: 1; min-width: 200px; }
.mod-reason {
  flex: 1; min-width: 0; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 8px 10px; min-height: 40px;
}

/* ---- Nút nhỏ (dùng chung) ---- */
.btn-sm { width: auto; padding: 10px 16px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }

@media (prefers-reduced-motion: reduce) {
  .pc-act { transition: none; }
}

/* ---- Modal chi tiết bài (soft navigation từ feed; dán link → trang đầy đủ) ---- */
.post-modal {
  position: relative;
  width: min(680px, 96vw); max-width: 96vw; max-height: 92vh;
  border: 0; border-radius: var(--r-lg); padding: 0;
  background: var(--bg); color: var(--text); overflow: hidden;
}
.post-modal::backdrop { background: rgba(0, 0, 0, .5); }
.modal-body { max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-body .detail-wrap { padding: 0 12px 24px; max-width: 100%; }

/* Bài DÀI trong feed cắt gọn (~14 dòng); click mở modal/chi tiết để xem đủ.
   Trong trang chi tiết & modal (ngoài .feed-list) hiển thị đầy đủ. */
.feed-list .pc-body {
  display: -webkit-box; -webkit-line-clamp: 14; line-clamp: 14;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* "Tải thêm" khi JS tiếp quản (infinite scroll) — thành chỉ báo đang tải. */
.feed-more.js-auto { color: var(--muted); }

/* ---- Like/Save optimistic: CHỈ hiện 1 icon (off mặc định, on khi .liked/.saved) ----
   THỨ TỰ QUAN TRỌNG: rule căn lề chỉ set align-items (KHÔNG set display) để không
   ghi đè; mặc định off hiện / on ẩn; trạng thái active đảo lại. */
.pc-toggle .fa-off, .pc-toggle .fa-on { align-items: center; }
.pc-toggle .fa-off { display: inline-flex; }
.pc-toggle .fa-on { display: none; }
.pc-toggle.liked .fa-off, .pc-toggle.saved .fa-off { display: none; }
.pc-toggle.liked .fa-on, .pc-toggle.saved .fa-on { display: inline-flex; }
.pc-toggle .cnt:empty { display: none; }
/* "pop" nhẹ khi bật (chỉ transform — compositor-friendly) */
.pc-toggle.liked .fa-on, .pc-toggle.saved .fa-on { animation: pop .18s ease-out; }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .pc-toggle .fa-on { animation: none; } }

/* ---- Tiêu đề (composer + card) ---- */
.composer-title {
  width: 100%; border: 0; background: transparent; color: var(--text);
  font: 600 1.05rem/1.4 inherit; padding: 2px 4px 8px;
}
.composer-title:focus { outline: none; }
.composer-title::placeholder { color: var(--muted); font-weight: 600; }
.pc-title { margin: 8px 0 4px; font-size: 1.06rem; font-weight: 700; line-height: 1.35; color: var(--text); }

/* ---- Trang đọc bài (article) ---- */
.article-wrap { max-width: 720px; }
.article {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px 18px 8px;
}
.article-title {
  font-size: clamp(1.4rem, 1.1rem + 2.2vw, 2rem); line-height: 1.25;
  font-weight: 700; letter-spacing: -0.01em; margin: 0 0 16px;
}
.article-byline {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 18px;
}
.pc-avatar.lg { width: 48px; height: 48px; }
.byline-id { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.byline-name { font-weight: 700; color: var(--text); text-decoration: none; }
.byline-name:hover { text-decoration: underline; }
.byline-meta { color: var(--muted); font-size: .86em; }
.article-byline .pc-badge { margin-left: auto; }
.article-body {
  font-size: 1.0625rem; line-height: 1.75; color: var(--text); overflow-wrap: anywhere;
}
.article-body .cashtag { color: var(--accent); font-weight: 600; text-decoration: none; }
.article-body .hashtag { color: var(--accent); text-decoration: none; }
.article-body a { color: var(--accent); }
.article-body .post-disclaimer { margin-top: 16px; }
.article .pc-gallery, .article .pc-link { margin-top: 16px; }
.article .pc-actions { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.comments-h { display: flex; align-items: center; gap: 8px; }
.comments-login { padding: 10px 0; }

/* ---- Chia sẻ: bottom-sheet (trượt từ dưới lên, ghim đáy) ---- */
.share-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; top: auto; margin: 0 auto;
  width: 100%; max-width: 600px; border: 0; border-radius: 20px 20px 0 0;
  padding: 8px 18px calc(20px + env(safe-area-inset-bottom, 0));
  background: var(--bg); color: var(--text);
}
.share-sheet::backdrop { background: rgba(0, 0, 0, .45); }
.share-sheet[open] { animation: sheet-up .25s cubic-bezier(.16, 1, .3, 1); }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 6px auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.sheet-title { font-size: 1.2em; font-weight: 800; margin: 0; }
.sheet-close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.sheet-close .fa-icon { width: 1em; height: 1em; }
.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 8px; }
.share-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text); background: none; border: 0; cursor: pointer;
  font: inherit; font-size: .85em;
}
.share-ic { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.share-ic .fa-icon { width: 1.5em; height: 1.5em; }
.ic-facebook { background: #1877f2; }
.ic-x { background: #000; }
.ic-messenger { background: linear-gradient(135deg, #00b2ff, #006aff); }
.ic-telegram { background: #29a9eb; }
.ic-email { background: #6b7280; }
.ic-copy { background: var(--surface); color: var(--accent); border: 1.5px solid var(--accent); }
.share-url {
  display: flex; align-items: center; gap: 10px; margin-top: 22px;
  background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px;
}
.share-url-ic { color: var(--muted); display: inline-flex; }
.share-url-ic .fa-icon { width: 1em; height: 1em; }
.share-url-text { flex: 1; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-copy { border: 0; background: none; color: var(--accent); font-weight: 700; cursor: pointer; font: inherit; white-space: nowrap; }

/* ---- Bài dài: chỉ báo "Xem thêm" + fade CHỈ khi body bị cắt (JS thêm .is-clamped) ---- */
.pc-titlelink { display: block; color: inherit; text-decoration: none; }
.pc-titlelink:hover .pc-title { color: var(--accent); }
.pc-more {
  display: none; color: var(--accent); font-weight: 600; font-size: .9em;
  margin-top: 6px; text-decoration: none;
}
.pc-more:hover { text-decoration: underline; }
.pc-body.is-clamped { position: relative; }
.pc-body.is-clamped::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3.2em;
  background: linear-gradient(transparent, var(--surface)); pointer-events: none;
}
.pc-body.is-clamped + .pc-more { display: inline-block; }

/* ---- Scroll-lock khi mở modal: khóa nền, giữ vị trí feed (khôi phục khi đóng) ---- */
body.modal-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }

/* ---- Video post (self-host, CSP self) ---- */

/* ---- Poll (bình chọn) ---- */
.poll { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.poll-form { margin: 0; }
.poll-opt {
  width: 100%; text-align: left; padding: 12px 14px; min-height: 44px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.poll-opt:hover { background: var(--surface-2); border-color: var(--accent); }
.poll-result {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
}
.poll-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-soft); z-index: 0; }
.poll-result.voted { border-color: var(--accent); }
.poll-result.voted .poll-bar { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.poll-label { position: relative; z-index: 1; font-weight: 600; }
.poll-pct { position: relative; z-index: 1; margin-left: auto; color: var(--muted); font-weight: 700; }
.poll-total { color: var(--muted); font-size: .85em; margin: 4px 0 0; }

/* ---- Kiểm duyệt: link tới bài / xem chi tiết ---- */
.mod-onpost {
  display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 10px;
  color: var(--accent); font-size: .88em; font-weight: 600; text-decoration: none;
}
.mod-onpost:hover { text-decoration: underline; }
.mod-onpost strong { font-weight: 700; }

/* Ảnh gallery click để phóng to (lightbox Spotlight) */
.pc-gallery img { cursor: zoom-in; }

/* Tiêu đề bài trong hàng đợi kiểm duyệt */
.mod-title { font-weight: 700; font-size: 1.02em; line-height: 1.35; margin: 4px 0 6px; }

/* ---- Kiểm duyệt bình luận: gom theo bài ---- */
.mod-group { margin-bottom: 18px; }
.mod-grouphead {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--text); text-decoration: none; font-size: .92em; margin-bottom: 8px;
}
.mod-grouphead:hover { border-color: var(--accent); }
.mod-grouphead strong { font-weight: 700; }
.mod-groupcount { margin-left: auto; color: var(--muted); font-size: .9em; flex: none; }
.mod-subcard { margin-left: 12px; }

/* Spotlight được chuyển vào <dialog> (top-layer) để không bị modal che. Nhưng
   #spotlight chỉ đặt top/bottom, left/right = auto → trong dialog nó lệch theo vị
   trí tĩnh. Ép phủ trọn viewport theo chiều ngang. */
.post-modal #spotlight { left: 0; right: 0; width: 100vw; }

/* ---- Gallery nhiều ảnh: LƯỚI kiểu X/Facebook (đúng thứ tự HÀNG, crop đều) ----
   Bố cục theo số ảnh; ảnh fill ô bằng object-fit:cover. Click → lightbox xem đủ. */
.pc-grid { display: grid; gap: 3px; margin-top: 10px; border-radius: var(--r-md); overflow: hidden; }
.pc-grid > * { min-width: 0; min-height: 0; overflow: hidden; }
.pc-grid img, .pc-grid video, .pc-grid .pc-video {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; max-height: none;
}
.pc-grid img { cursor: zoom-in; }
.pc-grid.g2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1; }
.pc-grid.g3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 10; }
.pc-grid.g3 > :first-child { grid-row: 1 / 3; }
.pc-grid.g4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 1 / 1; }
/* 5 ảnh: 2 trên + 3 dưới (mẹo 6 cột). */
.pc-grid.g5 { grid-template-columns: repeat(6, 1fr); grid-template-rows: 1fr 1fr; aspect-ratio: 3 / 2; }
.pc-grid.g5 > :nth-child(1), .pc-grid.g5 > :nth-child(2) { grid-column: span 3; }
.pc-grid.g5 > :nth-child(3), .pc-grid.g5 > :nth-child(4), .pc-grid.g5 > :nth-child(5) { grid-column: span 2; }
/* ≥6 ảnh: lưới 3 cột ô vuông. */
.pc-grid.g6 { grid-template-columns: 1fr 1fr 1fr; }
.pc-grid.g6 > * { aspect-ratio: 1 / 1; }

/* ---- Poll: nút xem kết quả + đánh dấu lựa chọn của mình ---- */
.poll-see {
  align-self: flex-start; background: none; border: 0; padding: 4px 2px;
  color: var(--accent); font: inherit; font-weight: 600; cursor: pointer;
}
.poll-see:hover { text-decoration: underline; }
.poll-you { color: var(--accent); width: .9em; height: .9em; margin-left: 4px; }
.poll-pct { white-space: nowrap; }

/* ---- Gửi bình luận (HTMX): thông báo chờ duyệt ---- */
.cm-wrap { margin-bottom: 12px; }
.cm-sent {
  display: flex; align-items: center; gap: 6px; margin: 0 0 8px;
  padding: 8px 12px; border-radius: var(--r-md); font-size: .9em;
  background: var(--surface-2); color: var(--accent);
}
.cm-err { color: var(--danger); background: var(--surface-2); }

/* Mũi tên lightbox (Spotlight): luôn hiện + to gấp đôi so với mặc định (50/35px).
   !important để ghi đè display:none inline + media-query thu nhỏ của thư viện.
   Loại trừ .spl-single (chỉ 1 ảnh) → KHÔNG hiện next/prev. */
#spotlight:not(.spl-single) .spl-prev, #spotlight:not(.spl-single) .spl-next {
  display: block !important;
  width: 72px !important; height: 72px !important; margin-top: -36px !important;
  background-size: 42px !important; opacity: .85 !important;
}
/* 1 ảnh: ẩn hẳn mũi tên + bộ đếm (vô nghĩa khi không có ảnh kế). */
#spotlight.spl-single .spl-prev, #spotlight.spl-single .spl-next, #spotlight.spl-single .spl-progress { display: none !important; }
@media (min-width: 768px) {
  #spotlight .spl-prev, #spotlight .spl-next {
    width: 96px !important; height: 96px !important; margin-top: -48px !important;
    background-size: 56px !important;
  }
}

/* Nút sửa bài trong thanh chi tiết (chỉ tác giả thấy) */
.detail-edit {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-weight: 600; font-size: .9em; text-decoration: none;
  padding: 6px 10px; border-radius: var(--r-pill); min-height: 36px;
}
.detail-edit:hover { background: var(--surface-2); }

/* ---- Thẻ OG preview của link đính kèm ---- */
.pc-card {
  display: flex; flex-direction: column; margin-top: 10px; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--r-md);
  text-decoration: none; color: inherit; background: var(--surface);
}
.pc-card:hover { background: var(--surface-2); }
.pc-card-img { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; display: block; background: var(--surface-2); }
.pc-card-meta { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; min-width: 0; }
.pc-card-host { color: var(--muted); font-size: .76em; text-transform: uppercase; letter-spacing: .03em; }
.pc-card-title { font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-card-desc { color: var(--muted); font-size: .88em; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Trang thông báo ---- */
.notif-list { display: flex; flex-direction: column; }
.notif {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 8px;
  border-bottom: 1px solid var(--border); color: inherit; text-decoration: none;
}
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--accent-soft); }
.notif-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); }
.notif-ic.ic-post_approved { color: var(--accent); }
.notif-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.notif-text { line-height: 1.4; }
.notif-sub { color: var(--muted); font-size: .88em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { color: var(--faint); font-size: .8em; }
.notif-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 8px; }
.notif-empty { padding: 24px 4px; text-align: center; }
.bn-bell { position: relative; }
.bn-dot { position: absolute; top: 8px; right: calc(50% - 12px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

/* ---- Widget thịnh hành (rail phải) ---- */
.trending .rail-title { display: flex; align-items: center; gap: 6px; }
.trend-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.trend-tag { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 7px 4px; text-decoration: none; color: inherit; border-radius: var(--r-sm); }
.trend-tag:hover { background: var(--surface-2); }
.trend-name { font-weight: 700; color: var(--accent); }
.trend-count { color: var(--muted); font-size: .8em; flex: none; }


/* ---- Rich editor (composer/sửa bài) ---- */
.rte { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.rte-btn {
  display: inline-grid; place-items: center; min-width: 36px; min-height: 36px;
  padding: 4px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text); cursor: pointer;
}
.rte-btn:hover { background: var(--border); }
.rte-btn .fa-icon { width: 1.05em; height: 1.05em; }
.rte-h3 .fa-icon { width: .82em; height: .82em; }
.rte-ed { min-height: 120px; padding: 10px 12px; outline: none; line-height: 1.6; overflow-wrap: anywhere; }
.rte-ed:empty::before { content: attr(aria-label); color: var(--faint); }
.rte-ed img, .rte-ed video { max-width: 100%; border-radius: var(--r-sm); margin: 6px 0; }
.rte-ed video { max-height: 60vh; width: auto; height: auto; display: block; margin-inline: auto; background: #000; }

/* ---- Nội dung rich đã render (card + chi tiết) ---- */
.pc-body h2, .article-body h2 { font-size: 1.3em; font-weight: 700; margin: 14px 0 6px; line-height: 1.3; }
.pc-body h3, .article-body h3 { font-size: 1.12em; font-weight: 700; margin: 12px 0 6px; }
.pc-body h4, .article-body h4 { font-size: 1.02em; font-weight: 700; margin: 10px 0 4px; }
.pc-body ul, .pc-body ol, .article-body ul, .article-body ol { margin: 8px 0; padding-left: 22px; }
.pc-body li, .article-body li { margin: 3px 0; }
.pc-body blockquote, .article-body blockquote {
  margin: 10px 0; padding: 6px 14px; border-left: 3px solid var(--accent); color: var(--muted); background: var(--surface-2);
}
.pc-body img, .article-body img, .pc-body video, .article-body video { max-width: 100%; border-radius: var(--r-md); margin: 10px 0; display: block; }
/* Video trong nội dung: giới hạn chiều cao để video DỌC (9:16) không chiếm hết
   màn; giữ tỉ lệ gốc, căn giữa trên nền tối. */
.pc-body video, .article-body video { max-height: min(72vh, 640px); width: auto; height: auto; margin-inline: auto; background: #000; }
.pc-body pre, .article-body pre { background: var(--surface-2); padding: 10px; border-radius: var(--r-sm); overflow-x: auto; }

/* ---- Flash báo sau hành động (đăng bài…) ---- */
.flash {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  padding: 12px 14px; border-radius: var(--r-md); font-weight: 500;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.flash .fa-icon { flex: none; width: 1.2em; height: 1.2em; }
.flash-err { background: var(--surface-2); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }

/* ===== Composer thu gọn trên feed ===== */
.cmp-bar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px; margin-bottom: 12px; }
.cmp-bar-top { display: flex; align-items: center; gap: 12px; }
.cmp-fake {
  flex: 1; min-width: 0; text-align: left; border: 0; background: none; cursor: text;
  color: var(--muted); font: inherit; font-size: 1.05em; padding: 8px 0;
}
.cmp-bar-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; padding-left: 56px; }
.cmp-tools { display: flex; align-items: center; gap: 2px; position: relative; }
/* Bảng chọn cảm xúc (emoji) — nổi phía trên thanh công cụ đáy. */
.cmp-emoji-pop { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 20;
  width: min(330px, 86vw); max-height: 230px; overflow-y: auto;
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.28); }
.cmp-emoji { background: none; border: 0; cursor: pointer; font-size: 1.3em; line-height: 1; padding: 5px; border-radius: 8px; }
.cmp-emoji:hover { background: var(--surface-2); }
.cmp-tool {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--r-pill);
  background: none; color: var(--accent); cursor: pointer;
}
.cmp-tool:hover { background: var(--accent-soft); }
.cmp-tool:disabled { color: var(--faint); cursor: default; }
.cmp-tool .fa-icon { width: 1.25em; height: 1.25em; }
.cmp-go { padding: 8px 22px; border-radius: var(--r-pill); }

/* ===== Modal soạn bài ===== */
.compose-modal {
  width: min(600px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
  border: 0; padding: 0; background: var(--bg); color: var(--text);
}
.compose-modal::backdrop { background: rgba(0, 0, 0, .5); }
@media (min-width: 600px) {
  .compose-modal { height: auto; max-height: 90vh; border-radius: var(--r-lg); overflow: hidden; }
}
.cmp-form { display: flex; flex-direction: column; height: 100%; max-height: 100dvh; }
@media (min-width: 600px) { .cmp-form { max-height: 90vh; } }
.cmp-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 2;
}
.cmp-head-title { flex: 1; text-align: center; font-weight: 700; }
.cmp-cancel { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; }
.cmp-cancel .fa-icon { width: 1em; height: 1em; }
.cmp-scroll { flex: 1; overflow-y: auto; padding: 14px; -webkit-overflow-scrolling: touch; }
.cmp-titlerow { display: flex; align-items: center; gap: 12px; }
.cmp-title { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-family: inherit; font-size: 1.25em; font-weight: 700; line-height: 1.3; color: var(--text); padding: 6px 0; resize: none; overflow: hidden; word-break: break-word; }
.cmp-title:focus, .cmp-title::placeholder { outline: none; }
.cmp-title::placeholder { color: var(--faint); font-weight: 600; }
.cmp-rte { border: 0; margin: 6px 0 2px 56px; }
.cmp-rte .rte-bar { border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 6px; }
.cmp-rte .rte-ed, .cmp-rte .composer-input { border: 0; padding: 4px 0; min-height: 80px; font-size: 1.05em; }
.cmp-rte .rte-ed:empty::before { content: attr(aria-label); color: var(--faint); }
/* Lưới ảnh */
.cmp-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0 56px; }
.cmp-tile { position: relative; width: 96px; height: 96px; border-radius: var(--r-md); overflow: hidden; }
.cmp-tile img { width: 100%; height: 100%; object-fit: cover; }
.cmp-tile-rm {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.cmp-tile-rm .fa-icon { width: .8em; height: .8em; }
.cmp-addimg {
  display: grid; place-items: center; gap: 4px; width: 96px; height: 96px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-md);
  background: none; color: var(--muted); cursor: pointer;
}
.cmp-addimg:hover { border-color: var(--accent); color: var(--accent); }
.cmp-addimg .fa-icon { width: 1.4em; height: 1.4em; }
.cmp-addimg-count { font-size: .78em; }
.cmp-grid-hint { color: var(--faint); font-size: .8em; margin: 6px 0 0 56px; }
.cmp-hold { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9em; margin: 14px 0 0 56px; }
.cmp-hold input { width: 18px; height: 18px; accent-color: var(--accent); }
/* Footer toolbar + đếm */
.cmp-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--bg); }
.cmp-counter { display: flex; align-items: center; gap: 8px; }
.cmp-count { color: var(--muted); font-size: .9em; font-variant-numeric: tabular-nums; }
.cmp-count.over { color: var(--danger); font-weight: 700; }
.cmp-ring { transform: rotate(-90deg); }
.cmp-ring-bg { fill: none; stroke: var(--border); stroke-width: 2.5; }
.cmp-ring-fg { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; transition: stroke-dashoffset .15s; }

/* Báo lỗi trong modal soạn bài */
.cmp-error {
  margin: 0; padding: 10px 14px; background: var(--surface-2); color: var(--danger);
  font-weight: 600; font-size: .92em; border-bottom: 1px solid var(--border);
}

/* Ảnh đại diện click để phóng to */
.pc-avatar img, .cm-avatar img { cursor: zoom-in; }

/* Editor: hiển thị đoạn/quote/list khi soạn */
.rte-ed p { margin: 0 0 8px; }
.rte-ed blockquote { margin: 8px 0; padding: 4px 12px; border-left: 3px solid var(--accent); color: var(--muted); }
.rte-ed ul, .rte-ed ol { margin: 6px 0; padding-left: 22px; }
.rte-ed h2, .rte-ed h3, .rte-ed h4 { font-weight: 700; margin: 10px 0 4px; }
/* Tile ảnh kéo-thả sắp xếp */
.cmp-tile { cursor: grab; touch-action: none; }
.cmp-tile.cmp-dragging { opacity: .5; cursor: grabbing; transform: scale(.96); }

/* Kiểm duyệt: thẻ bản sửa bài đã duyệt */
.mod-revision { border-left: 3px solid var(--accent); }
.mod-revtag { margin-left: auto; font-size: .72em; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: var(--r-pill); }

/* ===== Trang hồ sơ thành viên (@username) ===== */
.pf-bar-name { display: flex; flex-direction: column; line-height: 1.2; font-weight: 700; }
.pf-bar-sub { font-size: .78em; font-weight: 400; color: var(--muted); }
.pf-head { padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.pf-cover {
  height: 220px; margin: 0 -14px; /* tràn mép trong .feed-main padding */
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #7c3aed));
}
.pf-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: -44px; padding: 0 2px; }
.pf-avatar {
  width: 88px; height: 88px; border-radius: var(--r-pill); object-fit: cover;
  border: 4px solid var(--bg); background: var(--surface-2);
}
.pf-avatar-fb { display: grid; place-items: center; color: var(--muted); }
.pf-avatar-fb .fa-icon { width: 2.2em; height: 2.2em; }
.pf-action { align-self: flex-end; border-radius: var(--r-pill); padding: 8px 18px; }
.pf-followform { margin: 0; align-self: flex-end; }
.pf-following .fa-icon, .pf-action .fa-icon { width: 1em; height: 1em; }
.pf-id { margin-top: 10px; }
.pf-name { display: flex; align-items: center; gap: 6px; font-size: 1.4em; font-weight: 800; margin: 0; }
.pf-verified { color: var(--accent); display: inline-flex; }
.pf-verified .fa-icon { width: 1.05em; height: 1.05em; }
.pf-username { color: var(--muted); }
.pf-bio { margin: 10px 0 0; line-height: 1.55; overflow-wrap: anywhere; }
.pf-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9em; margin-top: 10px; }
.pf-meta .fa-icon { width: 1em; height: 1em; }
.pf-stats { display: flex; gap: 18px; margin-top: 10px; }
.pf-stat { color: var(--muted); text-decoration: none; font-size: .92em; }
.pf-stat strong { color: var(--text); }
.pf-stat:hover { text-decoration: underline; }
.pf-tabs { margin-top: 6px; }

/* Hồ sơ — tab Trả lời */
.pf-reply { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.pf-reply-on { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .88em; text-decoration: none; }
.pf-reply-on:hover strong { text-decoration: underline; }
.pf-reply-on .fa-icon { width: 1em; height: 1em; flex: none; }
.pf-reply-on strong { color: var(--text); }
.pf-reply-body { margin: 6px 0 4px; line-height: 1.55; }
.pf-reply-time { color: var(--faint); font-size: .8em; }

/* Danh sách followers / following */
.ul-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ul-av { flex: none; width: 48px; height: 48px; border-radius: var(--r-pill); overflow: hidden; }
.ul-av img { width: 100%; height: 100%; object-fit: cover; }
.ul-av-fb { display: grid; place-items: center; width: 100%; height: 100%; background: var(--surface-2); color: var(--muted); }
.ul-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; color: inherit; text-decoration: none; }
.ul-name { font-weight: 700; color: var(--text); }
.ul-name:hover { text-decoration: underline; }
.ul-username { color: var(--muted); font-size: .9em; }
.ul-bio { color: var(--text); font-size: .9em; margin-top: 4px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ul-row .pf-followform { align-self: center; }
.ul-row .pf-action { padding: 6px 16px; }

/* Hồ sơ — ảnh bìa thật + link cá nhân */
.pf-cover.has-img { background: var(--surface-2); }
.pf-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-meta { flex-wrap: wrap; gap: 6px 16px; }
.pf-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.pf-weblink { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); text-decoration: none; font-size: .9em; }
.pf-weblink:hover { text-decoration: underline; }
.pf-weblink .fa-icon { width: 1em; height: 1em; }
/* Trang cài đặt hồ sơ (/settings) — render trong shell app */
.settings-sec { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; margin-bottom: 14px; }
.settings-sec h2 { font-size: 1.05em; margin: 0 0 12px; }
.settings-info { display: flex; flex-direction: column; gap: 12px; }
.settings-info textarea, .settings-info input[type="url"] { width: 100%; }
.settings-ok { background: var(--accent-soft); color: var(--accent); font-weight: 600; padding: 10px 14px; border-radius: var(--r-md); margin-bottom: 12px; }
.settings-hint { color: var(--muted); font-size: .85em; margin: 8px 0 0; }

/* Vùng ảnh bìa — BẤM để chọn ảnh (cả vùng), hover hiện gợi ý */
.settings-cover {
  position: relative; display: block; width: 100%; height: 220px; padding: 0; border: 0; overflow: hidden;
  border-radius: var(--r-md); cursor: pointer;
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #7c3aed));
}
.settings-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.settings-pick-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  color: #fff; font-weight: 600; background: rgba(0, 0, 0, .35); opacity: 0; transition: opacity .15s;
}
.settings-cover:not(.has-img) .settings-pick-hint { opacity: 1; background: transparent; } /* chưa có ảnh → luôn hiện trên gradient */
.settings-cover:hover .settings-pick-hint, .settings-cover:focus-visible .settings-pick-hint { opacity: 1; }
.settings-pick-hint .fa-icon { width: 1.2em; height: 1.2em; }

/* Vùng avatar — BẤM để đổi, badge bút chì ở góc */
.settings-avatar-btn { position: relative; display: inline-block; padding: 0; border: 0; background: none; cursor: pointer; }
.settings-avatar { width: 96px; height: 96px; border-radius: var(--r-pill); object-fit: cover; display: block; }
.settings-avatar-fb { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.settings-avatar-fb .fa-icon { width: 2.4em; height: 2.4em; }
.settings-avatar-edit {
  position: absolute; right: 0; bottom: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center; border: 2px solid var(--surface);
}
.settings-avatar-edit .fa-icon { width: .85em; height: .85em; }

/* Vị trí ảnh bìa: tab phân đoạn (segmented control) — bấm tự cập nhật */
.settings-poswrap { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.settings-poslabel { color: var(--muted); font-size: .9em; }
.seg-tabs { display: inline-flex; background: var(--surface-2); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.seg-tab { border: 0; background: none; padding: 7px 18px; border-radius: var(--r-pill); color: var(--muted); cursor: pointer; font: inherit; font-size: .9em; }
.seg-tab:hover { color: var(--text); }
.seg-tab.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* Ảnh bìa — vị trí hiển thị (object-position) cho cả profile lẫn settings */
.pf-cover-img.pos-top, .settings-cover img.pos-top { object-position: top; }
.pf-cover-img.pos-center, .settings-cover img.pos-center { object-position: center; }
.pf-cover-img.pos-bottom, .settings-cover img.pos-bottom { object-position: bottom; }

/* Composer — khu vực tạo bình chọn (poll) */
.cmp-poll { margin: 10px 0 0 56px; display: flex; flex-direction: column; gap: 8px; }
.cmp-poll-opts { display: flex; flex-direction: column; gap: 8px; }
.cmp-poll-opt { border: 1px solid var(--border); border-radius: var(--r-md); padding: 9px 12px; font: inherit; background: var(--surface); color: var(--text); }
.cmp-poll-opt:focus { outline: none; border-color: var(--accent); }
.cmp-poll-add { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--accent); font: inherit; font-size: .9em; cursor: pointer; padding: 4px 0; }
.cmp-poll-add .fa-icon { width: .9em; height: .9em; }
.cmp-tool.active { background: var(--accent-soft); color: var(--accent); }

/* Composer — hẹn giờ đăng */
.cmp-sched { margin: 10px 0 0 56px; display: flex; flex-direction: column; gap: 6px; }
.cmp-sched-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9em; }
.cmp-sched-label .fa-icon { width: 1em; height: 1em; }
.cmp-sched-input { border: 1px solid var(--border); border-radius: var(--r-md); padding: 8px 10px; font: inherit; background: var(--surface); color: var(--text); max-width: 280px; }

/* ---- Bài của tôi (nháp/chờ duyệt/từ chối) ---- */
.mine-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; margin-bottom: 12px; }
.mine-head { display: flex; align-items: baseline; gap: 10px; }
.mine-title { font-weight: 700; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mine-time { color: var(--muted); font-size: .82em; flex: none; }
.mine-body { margin: 8px 0 0; line-height: 1.55; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mine-meta { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: .85em; margin: 8px 0 0; }
.mine-meta .fa-icon { width: 1em; height: 1em; }
.mine-reject { display: flex; align-items: center; gap: 6px; color: var(--danger); font-size: .85em; margin: 8px 0 0; background: color-mix(in srgb, var(--danger) 8%, transparent); padding: 6px 10px; border-radius: var(--r-sm); }
.mine-reject .fa-icon { width: 1em; height: 1em; flex: none; }
.mine-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mine-form { margin: 0; }
.mine-actions .btn .fa-icon { width: 1em; height: 1em; }
.mine-del { color: var(--danger); }
.cmp-draft { margin-left: auto; }

/* ---- Cột phải: ô tìm kiếm ---- */
.rail-search { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--r-pill); padding: 11px 16px; margin-bottom: 16px; color: var(--muted); }
.rail-search:focus-within { background: var(--surface); border-color: var(--accent); color: var(--accent); }
.rail-search .fa-icon { width: 1.05em; height: 1.05em; flex: none; }
.rail-search-input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--text); }
.rail-search-input:focus { outline: none; }
.rail-search-input::placeholder { color: var(--muted); }
.rail-search-page { margin: 8px 0 16px; }

/* ---- Tab kết quả tìm kiếm (Người / Bài viết) — đồng nhất với .feed-tabs ---- */
.search-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 0 0 8px;
}
.search-tab {
  flex: 1; text-align: center; padding: 14px 8px;
  color: var(--muted); font-weight: 600; text-decoration: none;
  border-bottom: 2px solid transparent;
  min-height: 44px;
}
.search-tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.search-tab:hover { color: var(--text); }

/* ---- Cột phải: gợi ý theo dõi ---- */
.suggest { margin-top: 16px; }
.suggest-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.suggest-row { display: flex; align-items: center; gap: 10px; }
.suggest-av { flex: none; width: 44px; height: 44px; border-radius: var(--r-pill); overflow: hidden; }
.suggest-av img { width: 100%; height: 100%; object-fit: cover; }
.suggest-av-fb { display: grid; place-items: center; width: 100%; height: 100%; background: var(--surface-2); color: var(--muted); }
.suggest-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; text-decoration: none; color: var(--text); }
.suggest-name { font-weight: 700; font-size: .9em; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-verified { color: var(--accent); display: inline-flex; }
.suggest-verified .fa-icon { width: .85em; height: .85em; }
.suggest-username { color: var(--muted); font-size: .8em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Nút theo dõi GỌN trong gợi ý: chữ + padding nhỏ lại → tên có thêm chỗ, đỡ bị cắt. */
.suggest-row .pf-action { flex: none; font-size: .8em; padding: 6px 13px; gap: 5px; }
.suggest-row .pf-action .fa-icon { width: .95em; height: .95em; }

/* ---- Toast thông báo (thay window.alert) — viền trái theo loại, tự ẩn ---- */
.toast-root { position: fixed; left: 0; right: 0; bottom: calc(84px + env(safe-area-inset-bottom, 0)); z-index: 1000; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.toast { pointer-events: auto; max-width: 460px; width: fit-content; display: flex; align-items: center; gap: 10px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--r-md); padding: 12px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.22); font-size: .92em; line-height: 1.45; opacity: 0; transform: translateY(14px); transition: opacity .25s ease, transform .25s cubic-bezier(.16,1,.3,1); cursor: pointer; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-error { border-left-color: var(--danger); }
.toast-success { border-left-color: var(--accent); }
@media (min-width: 1024px) { .toast-root { bottom: 24px; } }

/* ---- Video trong feed: KHÔNG ép 16:9. Giữ tỉ lệ gốc, giới hạn chiều cao
   (video dọc 9:16 không chiếm hết màn). Letterbox nền tối, căn giữa. ---- */
.pc-video { display: block; max-width: 100%; max-height: min(72vh, 640px); width: auto; height: auto; margin-inline: auto; border-radius: var(--r-md); background: #000; }

/* ---- Kho video (/video) + khối video trong feed ---- */
.vlib-sec { margin: 0 0 24px; }
.vlib-h { display: flex; align-items: center; gap: 8px; font-size: 1.1em; font-weight: 800; margin: 0 0 12px; }
.vlib-h .fa-icon { width: 1em; height: 1em; color: var(--accent); }
.vlib-shorts { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
.vlib-shorts .vcard { scroll-snap-align: start; }
.vlib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.vcard { display: block; text-decoration: none; color: var(--text); }
.vcard-thumb { position: relative; display: block; aspect-ratio: 16/9; border-radius: var(--r-md); overflow: hidden; background: #000; }
.vcard-short .vcard-thumb { aspect-ratio: 9/16; }
.vcard-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard-noimg { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); }
.vcard-noimg .fa-icon { width: 2em; height: 2em; }
.vcard-play { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; display: grid; place-items: center; background: rgba(0,0,0,.5); color: #fff; border-radius: 50%; }
.vcard-play .fa-icon { width: 1.2em; height: 1.2em; }
.vcard-dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.78); color: #fff; font-size: .75em; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.vcard-meta { margin-top: 6px; }
.vcard-author { font-size: .85em; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
@media (hover: hover) { .vcard:hover .vcard-thumb { outline: 2px solid var(--accent); outline-offset: 2px; } }

.vstrip { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; margin-bottom: 12px; }
.vstrip-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.vstrip-h { display: flex; align-items: center; gap: 8px; font-size: 1.05em; font-weight: 800; margin: 0; }
.vstrip-h .fa-icon { width: 1em; height: 1em; color: var(--accent); }
.vstrip-all { color: var(--accent); font-weight: 600; font-size: .9em; text-decoration: none; }
.vstrip .vlib-grid { margin-top: 12px; }

/* ---- Trang player video (kiểu Facebook) — THEME-AWARE (đồng nhất sáng/tối) ---- */
.vplayer { position: fixed; inset: 0; background: var(--bg); color: var(--text); display: flex; z-index: 50; }
/* Khu vực video (overlay top/rail/info neo theo đây). Mở panel bình luận → co lại. */
.vplayer-main { position: relative; flex: 1; min-width: 0; height: 100%; display: grid; place-items: center; }
/* Panel bình luận bên phải (desktop), trượt lên từ đáy (mobile). */
.vplayer-comments { flex: none; width: 380px; height: 100%; background: var(--bg); color: var(--text); display: flex; flex-direction: column; border-left: 1px solid var(--border); }
.vplayer-comments-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.vplayer-comments-title { font-weight: 800; font-size: 1.05em; }
.vplayer-comments-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; }
.vplayer-comments-body .comments-h { display: none; } /* tiêu đề đã ở header panel */
@media (max-width: 760px) {
  .vplayer-comments { position: fixed; left: 0; right: 0; bottom: 0; width: auto; height: 72vh; border-left: 0; border-top: 1px solid var(--border); border-radius: 18px 18px 0 0; z-index: 4; box-shadow: 0 -8px 30px rgba(0,0,0,.4); }
}
.vplayer-top { position: absolute; top: 16px; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 16px; z-index: 3; }
/* Pill overlay "frosted" theo theme: đọc rõ trên cả nền sáng/tối lẫn trên video. */
.vplayer-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--text); text-decoration: none; border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.vplayer-btn:hover { background: var(--surface-2); }
.vplayer-btn .fa-icon { width: 1.1em; height: 1.1em; }
.vplayer-stage { display: grid; place-items: center; width: 100%; height: 100%; }
.vplayer-video { max-width: 100%; max-height: 100vh; width: auto; height: auto; display: block; background: #000; }
.vplayer-rail { position: absolute; right: 14px; bottom: 96px; display: flex; flex-direction: column; gap: 16px; z-index: 3; }
.vplayer-act { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; color: var(--text); cursor: pointer; font: inherit; font-size: .78em; font-weight: 600; text-decoration: none; }
.vplayer-ic { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.vplayer-ic .fa-icon { width: 1.3em; height: 1.3em; }
.vplayer-act:hover .vplayer-ic { background: var(--surface-2); }
.vplayer-act.liked { color: var(--accent); }
/* Đã thích: nền accent, icon trên-accent (trắng ở sáng / tối ở dark) + icon đặc. */
.vplayer-act.liked .vplayer-ic { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
/* Swap off/on theo trạng thái — specificity ĐỒNG NHẤT (3 class) để không kẹt. */
.vp-off, .vp-on { align-items: center; }
.vplayer-ic .vp-off { display: inline-flex; }
.vplayer-ic .vp-on { display: none; }
.vplayer-act.liked .vplayer-ic .vp-off { display: none; }
.vplayer-act.liked .vplayer-ic .vp-on { display: inline-flex; }
/* Đã lưu: tô đậm bookmark + nền accent (giống "đã thích"). */
.vplayer-act.saved { color: var(--accent); }
.vplayer-act.saved .vplayer-ic { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.vplayer-act.saved .vplayer-ic .vp-off { display: none; }
.vplayer-act.saved .vplayer-ic .vp-on { display: inline-flex; }
.vplayer-actform { margin: 0; }
/* Card thông tin GỌN (ôm nội dung, không kéo full-width); theo theme, đọc rõ. */
.vplayer-info { position: absolute; left: 16px; bottom: 22px; width: max-content; max-width: min(42%, 440px); display: flex; flex-direction: column; gap: 8px; z-index: 3; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; box-shadow: 0 2px 10px rgba(0,0,0,.14); }
/* ---- Player MOBILE: info trái-dưới (card frosted gọn), rail phải-dưới ---- */
@media (max-width: 760px) {
  /* Back + search xếp THÀNH CỘT DỌC ở mép phải (right:8px) — THẲNG HÀNG với rail
     like/comment/share. Góc trái trống cho nút fullscreen native của video. */
  .vplayer-top { flex-direction: column; left: auto; right: 8px; top: 60px; width: auto; padding: 0; gap: 12px; align-items: center; }
  .vplayer-btn { width: 44px; height: 44px; }
  /* Rail: góc dưới-phải, ngay trên thanh điều khiển; icon gọn hơn. */
  .vplayer-rail { right: 8px; bottom: 64px; gap: 12px; }
  .vplayer-ic { width: 44px; height: 44px; }
  .vplayer-ic .fa-icon { width: 1.2em; height: 1.2em; }
  .vplayer-act { font-size: .72em; }
  /* Info: card FROSTED theo theme (đọc rõ trên video lẫn nền letterbox, mọi chế độ);
     chừa chỗ rail; tác giả + trạng thái theo dõi trên 1 DÒNG. */
  .vplayer-info { left: 12px; right: 66px; bottom: 60px; width: auto; max-width: none;
    background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(10px);
    border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 2px 12px rgba(0,0,0,.2);
    padding: 9px 11px; gap: 5px; }
  .vplayer-author { flex-wrap: nowrap; gap: 8px; }
  .vplayer-avatar { width: 32px; height: 32px; }
  .vplayer-name { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92em; }
  /* Nút theo dõi NHỎ + KHÔNG xuống dòng. */
  .vplayer-info .pf-action { flex: none; white-space: nowrap; padding: 4px 10px; font-size: .72em; }
  .vplayer-info .pf-action .fa-icon { width: .82em; height: .82em; }
  .vplayer-title { font-size: .85em; }
}
.vplayer-author { display: flex; align-items: center; gap: 10px; }
.vplayer-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; }
.vplayer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.vplayer-avatar-fb { display: grid; place-items: center; width: 100%; height: 100%; background: var(--surface-2); color: var(--muted); }
.vplayer-name { font-weight: 700; color: var(--text); text-decoration: none; }
.vplayer-info .pf-action { padding: 7px 16px; }
@media (hover: hover) { .vplayer-info .pf-following:hover { background: rgba(255, 255, 255, .24); } }
.vplayer-title { color: var(--text); text-decoration: none; font-size: .95em; max-width: 620px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Player: nút điều hướng video trước/tiếp (desktop; mobile dùng vuốt) */
.vplayer-nav { position: absolute; right: 78px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--text); border: 1px solid var(--border); text-decoration: none; z-index: 3; transition: background .15s; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.vplayer-nav:hover { background: var(--surface-2); }
.vplayer-nav .fa-icon { width: 1.2em; height: 1.2em; }
.vplayer-nav-up { top: calc(50% - 52px); }
.vplayer-nav-down { top: calc(50% + 8px); }
@media (max-width: 700px) { .vplayer-nav { display: none; } }

/* Player: overlay KHÔNG chặn thanh điều khiển video — chỉ phần tử tương tác mới
   nhận click, vùng trống cho click XUYÊN xuống <video> (play/seek/volume). Đồng
   thời nâng info lên trên control bar native. */
.vplayer-rail, .vplayer-info { pointer-events: none; }
.vplayer-rail .vplayer-act, .vplayer-rail .vplayer-actform, .vplayer-rail button, .vplayer-rail a,
.vplayer-info a, .vplayer-info button, .vplayer-info .follow-btn { pointer-events: auto; }
.vplayer-info { bottom: 60px; }

/* Card video: tiêu đề chính + tác giả phụ (kiểu YouTube); lưới short hẹp hơn. */
.vlib-grid-short { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.vcard-meta { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vcard-title { font-weight: 600; font-size: .9em; line-height: 1.35; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard-author { font-size: .82em; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Kiểm duyệt bản sửa: 2 bản HTML ĐẦY ĐỦ song song (cũ | mới) ---- */
.rev-cmp { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 10px 0; }
@media (min-width: 768px) { .rev-cmp { grid-template-columns: 1fr 1fr; } }
.rev-col { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; background: var(--surface); min-width: 0; }
.rev-col-new { border-color: var(--accent); }
.rev-col-h { display: inline-flex; align-items: center; gap: 6px; font-size: .76em; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 8px; }
.rev-col-new .rev-col-h { color: var(--accent); }
.rev-col-h .fa-icon { width: .9em; height: .9em; }
.rev-title { font-size: 1.05em; font-weight: 700; line-height: 1.35; margin: 0 0 8px; }
/* Body render HTML thật (ảnh/video/định dạng); giới hạn chiều cao + cuộn riêng. */
.rev-html { max-height: 420px; overflow-y: auto; font-size: .95em; }

/* ---- Tab Thiết lập thông báo ---- */
.notif-tabs { position: static; }
.notif-settings { padding: 10px 0 4px; }
.ns-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; margin: 0 0 14px; }
.ns-h { font-size: 1.05em; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.ns-hint { margin: -4px 0 12px; font-size: .9em; }
.ns-status { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; }
.ns-status.ns-on { color: var(--accent); }
.ns-prefs { display: flex; flex-direction: column; }
.ns-pref { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); margin: 0; }
.ns-pref:first-child { border-top: 0; }
.ns-pref-label { font-size: .95em; }
/* Công tắc bật/tắt (accent = thương hiệu, KHÔNG phải xanh tăng-giá). */
.ns-switch { position: relative; flex: none; width: 44px; height: 26px; }
.ns-switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ns-slider { position: absolute; inset: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; transition: background .2s, border-color .2s; }
.ns-slider::before { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.ns-switch input:checked + .ns-slider { background: var(--accent); border-color: var(--accent); }
.ns-switch input:checked + .ns-slider::before { transform: translateX(18px); }
.ns-switch input:focus-visible + .ns-slider { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Like bình luận ---- */
.cm-main { flex: 1; min-width: 0; }
.cm-actions { display: flex; align-items: center; gap: 14px; padding: 3px 0 0 12px; }
.cm-like { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0;
  padding: 2px; cursor: pointer; color: var(--muted); font-size: .82em; line-height: 1; text-decoration: none; }
.cm-like:hover { color: var(--text); }
.cm-like.liked { color: var(--accent); }                 /* accent thương hiệu, KHÔNG dùng đỏ */
.cm-like .fa-icon { width: 1.05em; height: 1.05em; }
.cm-like .cnt:empty { display: none; }
.cm-like .cnt { font-variant-numeric: tabular-nums; }

/* ---- Theo dõi tag/cashtag ---- */
.tag-bar { justify-content: space-between; gap: 12px; }
.tagfollow-form { flex: none; margin-left: auto; }
.tagfollow { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; font-size: .9em; }
.tagfollow .fa-icon { width: 1em; height: 1em; }
/* Trang "Tag theo dõi" */
.ftags { padding: 6px 0; display: flex; flex-direction: column; }
.ftag-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.ftag-chip { font-weight: 700; color: var(--accent); text-decoration: none; font-size: 1.05em; }  /* accent thương hiệu, KHÔNG xanh/đỏ thị trường */
.ftag-chip:hover { text-decoration: underline; }

/* ---- Hộp thoại "Gắn link" trong editor (chỉ admin/mod) — <dialog> top-layer ---- */
.lnk-dlg { border: 1px solid var(--border); border-radius: var(--r-md); padding: 0;
  width: min(420px, 92vw); max-height: 90vh; background: var(--surface); color: var(--text);
  box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.lnk-dlg::backdrop { background: rgba(0,0,0,.45); }
.lnk-box { padding: 20px; overflow-y: auto; }
.lnk-title { margin: 0 0 14px; font-size: 1.1em; }
.lnk-f { display: block; margin-bottom: 12px; }
.lnk-f span { display: block; font-size: .85em; color: var(--muted); margin-bottom: 4px; }
.lnk-f input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text); }
.lnk-chk { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: .9em; }
.lnk-rel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 16px; font-size: .88em; }
.lnk-rel label { display: inline-flex; align-items: center; gap: 5px; }
.lnk-rel-h { color: var(--muted); }
.lnk-actions { display: flex; justify-content: flex-end; gap: 10px; }
.lnk-actions .btn { width: auto; padding: 9px 20px; }

/* ---- Poll: chân (tổng lượt + hạn) + chọn thời hạn trong composer ---- */
.poll-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.poll-total { color: var(--muted); font-size: .85em; }
.poll-deadline { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .85em; }
.poll-deadline .fa-icon { width: .9em; height: .9em; }
.poll-deadline.closed { color: var(--text); font-weight: 600; }
.cmp-poll-dur { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .9em; color: var(--muted); }
.cmp-poll-dur .fa-icon { width: 1em; height: 1em; }
.cmp-poll-dursel { padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); color: var(--text); }

/* Nút admin gỡ bài (đỏ cảnh báo khi hover) */
.pc-hide { color: var(--muted); }
.pc-hide:hover { color: var(--danger); }
.pc-hideform { display: inline-flex; margin: 0; }

/* Tab "Đã gỡ" trong kiểm duyệt */
.mod-hidden-title { display: block; font-weight: 700; color: var(--text); text-decoration: none; margin: 4px 0; }
.mod-hidden-title:hover { color: var(--accent); }
.mod-hidden-by { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85em; }
.mod-hidden-by .fa-icon { width: .9em; height: .9em; }
.nav-badge-muted { background: var(--surface-2); color: var(--muted); }

.mod-hidden-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.mod-unhideform { margin: 0; }

/* Lịch sử chi tiết bài (admin) */
.phist-body { padding: 4px 16px 24px; }
.phist-title { font-weight: 700; margin: 8px 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.phist-actor { color: var(--text); font-weight: 600; }
.pc-history:hover { color: var(--accent); }

/* Rail trái — trạng thái KHÁCH (chưa đăng nhập): giãn nút đăng nhập/đăng ký */
.rail-join { margin: 12px 0 4px; }
.rail-auth { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
