:root {
  --fb-blue: #1877f2;
  --fb-blue-dark: #166fe5;
  --fb-blue-light: #e7f3ff;
  --fb-bg: #fafafa;
  --fb-card: #ffffff;
  --fb-text: #0a0a0a;
  --fb-muted: #737373;
  --fb-border: #e6e6e6;
  --fb-hover: #f5f5f5;
  --fb-green: #42b72a;
  --fb-orange: #e58325;
  --fb-danger: #e41e3f;
  --fb-danger-light: #fde8ec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 1px 3px rgba(0,0,0,.04);
  --bottom-nav-h: 58px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--fb-bg);
  color: var(--fb-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ================= TOP BAR ================= */
.fb-topbar {
  background: var(--fb-card);
  border-bottom: 1px solid var(--fb-border);
  position: sticky;
  top: 0;
  z-index: 30;
  height: 56px;
}
.fb-topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 56px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fb-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}
.fb-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--fb-border, #e4e6eb);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.fb-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fb-search {
  display: flex;
}
.fb-search input {
  width: 220px;
  background: var(--fb-bg);
  border: none;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 14.5px;
  color: var(--fb-text);
}
.fb-search input:focus { outline: 2px solid var(--fb-blue); background: #fff; }

.fb-topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 4px;
}
.fb-nav-icon {
  width: 74px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--fb-muted);
  border-bottom: 3px solid transparent;
  border-radius: 8px 8px 0 0;
}
.fb-nav-icon:hover { background: var(--fb-hover); }
.fb-nav-icon.active { color: var(--fb-blue); border-bottom-color: var(--fb-blue); }

.fb-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  justify-content: flex-end;
}
.fb-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--fb-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--fb-text);
  flex-shrink: 0;
}
.fb-icon-btn:hover { background: #e4e6e9; }

/* ================= ADD MENU (nut + gop cac lua chon dang tin) ================= */
.fb-add-menu { position: relative; flex-shrink: 0; }
.fb-add-menu > summary { list-style: none; cursor: pointer; }
.fb-add-menu > summary::-webkit-details-marker { display: none; }
.fb-add-menu > summary::marker { content: ''; }
.fb-add-menu[open] > summary.fb-icon-btn { background: var(--fb-text); color: #fff; }
.fb-add-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--fb-card);
  border: 1px solid var(--fb-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
  min-width: 200px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fb-add-menu-panel a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fb-text);
}
.fb-add-menu-panel a:hover { background: var(--fb-hover); }

/* ================= RECENT POST BUBBLES (thay cho day nut "Dang tin...") ================= */
.fb-recent-bubbles {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 6px 2px;
  scrollbar-width: none;
}
.fb-recent-bubbles::-webkit-scrollbar { display: none; }
.bubble-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 62px;
  flex-shrink: 0;
}
.bubble-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  padding: 2.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bubble-ring-tro { background: var(--fb-blue); }
.bubble-ring-docu { background: var(--fb-green); }
.bubble-ring-vieclam { background: var(--fb-orange); }
.bubble-ring-doctan { background: var(--fb-danger); }
.bubble-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 2.5px solid var(--fb-card);
}
.bubble-label {
  font-size: 11px;
  color: var(--fb-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.fb-user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: var(--fb-bg);
}
.fb-user-chip:hover { background: #e4e6e9; }
.fb-user-chip .av {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--fb-blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.fb-user-chip .nm { font-size: 13.5px; font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================= BOTTOM NAV (chi hien tren man hinh dien thoai) ================= */
.fb-bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  height: var(--bottom-nav-h);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--fb-card);
  border-top: 1px solid var(--fb-border);
  align-items: center;
  justify-content: space-around;
}
.fb-bottom-nav .fb-nav-icon { width: auto; flex: 1; height: var(--bottom-nav-h); border-radius: 0; border-bottom: none; font-size: 21px; }
.fb-bottom-nav .fb-nav-icon.active { color: var(--fb-text); }
.fb-nav-icon-avatar .fb-nav-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--fb-text); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.fb-nav-icon-avatar.active .fb-nav-avatar { box-shadow: 0 0 0 2px var(--fb-text); }

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s ease;
}
.btn-primary { background: var(--fb-text); color: #fff; }
.btn-primary:hover { background: #262626; }
.btn-ghost { background: var(--fb-bg); color: var(--fb-text); border-color: var(--fb-border); }
.btn-ghost:hover { background: var(--fb-hover); }
.btn-danger { background: var(--fb-danger-light); color: var(--fb-danger); }
.btn-danger:hover { background: #fbd4dc; }
.btn-sm { padding: 7px 14px; min-height: 32px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn-pill { border-radius: 999px; }

/* ================= SHELL / 3-COLUMN LAYOUT ================= */
.fb-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 12px 60px;
  display: grid;
  grid-template-columns: 280px minmax(0,1fr) 300px;
  gap: 20px;
  align-items: start;
}
.fb-shell.no-right { grid-template-columns: 280px minmax(0,1fr); }
.fb-shell.bare { display: flex; justify-content: center; padding-top: 40px; }

.fb-left {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fb-left-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
}
.fb-left-profile:hover { background: var(--fb-hover); }
.fb-left-profile .av {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--fb-blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.fb-left-profile .nm { font-size: 14.5px; font-weight: 600; }

.fb-left-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
}
.fb-left-link:hover { background: var(--fb-hover); }
.fb-left-link .ic {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--fb-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.fb-left-divider { border: none; border-top: 1px solid var(--fb-border); margin: 8px 0; }
.fb-left-heading { font-size: 13px; font-weight: 700; color: var(--fb-muted); padding: 8px; }

.fb-left-mini-post {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  font-size: 13.5px;
}
.fb-left-mini-post:hover { background: var(--fb-hover); }
.fb-left-mini-post .ic { width: 32px; height: 32px; border-radius: 8px; background: var(--fb-blue-light); display:flex; align-items:center; justify-content:center; font-size:15px; flex-shrink:0; }
.fb-left-mini-post .tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fb-login-card {
  background: var(--fb-card);
  border: 1px solid var(--fb-border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.fb-login-card p { font-size: 13.5px; color: var(--fb-muted); margin: 0 0 12px; }
.fb-login-card .row { display: flex; gap: 8px; }

/* ================= MAIN CONTENT ================= */
.fb-main { min-width: 0; }

.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14.5px;
}
.flash-ok { background: #e3f3df; color: #1a7d2c; border: 1px solid #c3e6cb; }
.flash-error { background: var(--fb-danger-light); color: var(--fb-danger); border: 1px solid #f3c9c6; }

/* composer-style prompt box (like FB "what's on your mind") */
.fb-composer {
  background: var(--fb-card);
  border: 1px solid var(--fb-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.fb-composer .av { width: 40px; height: 40px; border-radius: 50%; background: var(--fb-blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.fb-composer-input {
  flex: 1;
  background: var(--fb-bg);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--fb-muted);
  font-size: 14.5px;
}
.fb-composer-input:hover { background: #e4e6e9; }

.fb-hero {
  background: linear-gradient(135deg, var(--fb-blue) 0%, #0d5bc4 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 16px;
}
.fb-hero h1 { margin: 0 0 8px; font-size: 22px; }
.fb-hero p { margin: 0 0 16px; font-size: 14px; opacity: .95; max-width: 560px; }
.fb-hero-stats { display: flex; gap: 22px; margin-top: 16px; }
.fb-hero-stats .n { font-size: 20px; font-weight: 800; }
.fb-hero-stats .l { font-size: 12px; opacity: .85; }
.fb-hero .btn-primary { background: #fff; color: var(--fb-blue); }
.fb-hero .btn-ghost { background: rgba(255,255,255,.16); color: #fff; }
.fb-hero .btn-ghost:hover { background: rgba(255,255,255,.26); }

/* ================= FEED POST CARD ================= */
.fb-post {
  background: var(--fb-card);
  border: 1px solid var(--fb-border);
  border-radius: var(--radius);
  box-shadow: none;
  margin-bottom: 16px;
  overflow: hidden;
  transition: box-shadow .15s ease;
}
.fb-post:hover { box-shadow: var(--shadow); }
.fb-post-header {
  display: flex;
  gap: 10px;
  padding: 12px 16px 8px;
}
.fb-post-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--fb-blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.fb-post-headtext { min-width: 0; flex: 1; }
.fb-post-name { font-size: 14.5px; font-weight: 700; }
.fb-post-name .kind { font-weight: 500; color: var(--fb-muted); }
.fb-post-sub { font-size: 12.5px; color: var(--fb-muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.fb-pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--fb-blue-light);
  color: var(--fb-blue-dark);
}
.fb-pill.warn { background: #fdf1de; color: #8a5a00; }
.fb-pill.job { background: #f0e8fd; color: #6b3fa0; }
.fb-pill.muted { background: var(--fb-bg); color: var(--fb-muted); }

.fb-post-body { padding: 2px 16px 12px; }
.fb-post-title { font-size: 15.5px; font-weight: 700; margin: 0 0 4px; }
.fb-post-price { font-size: 15.5px; font-weight: 800; color: var(--fb-blue); margin: 0 0 6px; }
.fb-post-desc { font-size: 14px; color: var(--fb-text); white-space: pre-wrap; }

.fb-post-img {
  width: 100%;
  max-height: 380px;
  min-height: 140px;
  object-fit: cover;
  background: var(--fb-bg);
  display: block;
}
.fb-post-img-fallback {
  width: 100%;
  height: 160px;
  background: var(--fb-blue-light);
  color: var(--fb-blue);
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fb-post-actions {
  display: flex;
  border-top: 1px solid var(--fb-border);
  margin: 4px 12px 0;
  padding: 4px 0;
}
.fb-post-actions a, .fb-post-actions button {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--fb-muted);
  background: transparent;
  border: none;
  cursor: pointer;
}
.fb-post-actions a:hover, .fb-post-actions button:hover { background: var(--fb-hover); }

/* ================= FILTER BAR ================= */
.fb-filterbar {
  background: var(--fb-card);
  border: 1px solid var(--fb-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.fb-filterbar .filter-field { display: flex; flex-direction: column; gap: 4px; }
.fb-filterbar label { font-size: 12px; color: var(--fb-muted); font-weight: 700; }

/* ================= RIGHT SIDEBAR ================= */
.fb-right { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 14px; }
.fb-widget {
  background: var(--fb-card);
  border: 1px solid var(--fb-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.fb-widget h3 { margin: 0 0 10px; font-size: 15px; }
.fb-trend-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: 13.5px; border-bottom: 1px solid #f0f0f0; }
.fb-trend-row:last-child { border-bottom: none; }
.fb-trend-row .cnt { background: var(--fb-blue-light); color: var(--fb-blue-dark); font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.fb-tip { font-size: 13px; color: var(--fb-muted); line-height: 1.5; }

/* ================= FORM CARD (login/register/post forms) ================= */
.form-card {
  background: var(--fb-card);
  border: 1px solid var(--fb-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  max-width: 480px;
  width: 100%;
}
.form-card.wide { max-width: 640px; }
.form-title { margin: 0 0 6px; font-size: 22px; }
.form-sub { color: var(--fb-muted); font-size: 14px; margin: 0 0 22px; }
.form-row { margin-bottom: 16px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--fb-border);
  border-radius: 6px;
  font-size: 14.5px;
  font-family: inherit;
  background: #fff;
  color: var(--fb-text);
}
textarea { resize: vertical; min-height: 100px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--fb-blue);
  box-shadow: 0 0 0 3px var(--fb-blue-light);
}
.hint { font-size: 12px; color: var(--fb-muted); margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }
.form-footer-link { text-align: center; margin-top: 18px; font-size: 14px; color: var(--fb-muted); }
.form-footer-link a { color: var(--fb-blue); font-weight: 600; }

/* ================= DETAIL PAGE ================= */
.detail-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.detail-img { width:100%; height: 320px; border-radius: var(--radius); background: var(--fb-blue-light) center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 60px; color: var(--fb-blue); margin-bottom: 16px; }
.detail-panel { background: var(--fb-card); border: 1px solid var(--fb-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.detail-price { font-size: 24px; font-weight: 800; color: var(--fb-blue); margin: 2px 0 12px; }
.detail-meta-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--fb-border); font-size: 14px; }
.detail-meta-row:last-child { border-bottom: none; }
.detail-meta-row .k { color: var(--fb-muted); }
.seller-box { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--fb-border); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--fb-blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.prose { white-space: pre-wrap; font-size: 14.5px; }
.owner-actions { display: flex; gap: 8px; margin-top: 14px; }
.card-tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--fb-blue-light); color: var(--fb-blue-dark); }
.card-tag.tag-o-ghep { background: #fdf1de; color: #8a5a00; }
.card-tag.tag-sold { background: var(--fb-bg); color: var(--fb-muted); }

/* ================= PROFILE ================= */
.profile-header { display: flex; align-items: center; gap: 16px; background: var(--fb-card); border: 1px solid var(--fb-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; border-radius: 50%; background: var(--fb-blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.mini-list-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--fb-card); border: 1px solid var(--fb-border); border-radius: var(--radius); margin-bottom: 10px; gap: 12px; }
.mini-list-item .info { flex: 1; min-width: 0; }
.mini-list-item .title { font-weight: 700; font-size: 14.5px; margin: 0 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list-item .meta { font-size: 12.5px; color: var(--fb-muted); }
.mini-list-item .actions { display: flex; gap: 6px; flex-shrink: 0; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--fb-muted); background: var(--fb-card); border: 1px dashed var(--fb-border); border-radius: var(--radius); }
.section { margin: 20px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.section-head h2 { margin: 0; font-size: 18px; }
.section-head .link { font-size: 13.5px; font-weight: 600; color: var(--fb-blue); }
.muted { color: var(--fb-muted); }
.page-title { font-size: 22px; margin: 4px 0 4px; }
.page-sub { color: var(--fb-muted); margin: 0 0 16px; font-size: 14px; }

.site-footer { text-align: center; padding: 24px 0 40px; color: var(--fb-muted); font-size: 12.5px; }

/* ================= HOI DOC THAN - the bai dang toi gian (lay cam hung tu bo cuc
   anh vuong + chu thich pho bien, khong sao chep logo/thuong hieu rieng) ================= */
.ig-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--fb-text); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13.5px; flex-shrink: 0;
}
.ig-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 20px; background: none; border: none; cursor: pointer;
  color: var(--fb-text); text-decoration: none;
}
.ig-icon-btn:hover { background: var(--fb-hover); }
.ig-icon-btn.active { filter: none; }
.ig-icon-btn-static { cursor: default; }
.ig-icon-btn-static:hover { background: none; }

.ig-feed { display: flex; flex-direction: column; gap: 20px; max-width: 470px; margin: 0 auto; }

.ig-post {
  background: var(--fb-card);
  border: 1px solid var(--fb-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ig-post-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 12px;
}
.ig-post-user { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit; }
.ig-username { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-post-time { font-size: 12px; color: var(--fb-muted); flex-shrink: 0; }

.ig-post-media {
  display: block; width: 100%; aspect-ratio: 1 / 1;
  background: var(--fb-blue-light) center/cover no-repeat;
}
.ig-post-media-empty { display: flex; align-items: center; justify-content: center; font-size: 44px; color: var(--fb-blue); }
.ig-post-media-lg { aspect-ratio: 4 / 5; max-height: 560px; }

.ig-post-actions { display: flex; align-items: center; gap: 2px; padding: 4px 6px; }
.ig-post-likes { padding: 0 14px; font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.ig-post-caption { padding: 0 14px; font-size: 14px; margin-bottom: 6px; line-height: 1.4; }
.ig-post-comments-link { display: block; padding: 0 14px 12px; font-size: 13px; color: var(--fb-muted); }
.ig-post-owner-actions { display: flex; gap: 14px; padding: 0 14px 8px; }
.ig-post-owner-actions a, .ig-post-owner-actions button {
  background: none; border: none; padding: 0; font-size: 13px; font-weight: 600;
  color: var(--fb-muted); cursor: pointer;
}
.ig-post-owner-actions a:hover, .ig-post-owner-actions button:hover { color: var(--fb-text); }

.ig-post-detail { max-width: 470px; margin: 0 auto; }

/* -- che do "luot xem tung the" kieu the doi thoai (tinder-inspired), chi hien khi co JS -- */
.ig-deck-wrap { max-width: 420px; margin: 0 auto 20px; text-align: center; }
.ig-deck { min-height: 60px; }
.ig-deck-card { text-align: left; box-shadow: var(--shadow); user-select: none; touch-action: pan-y; }
.ig-deck-meta { display: flex; align-items: center; justify-content: space-between; padding: 0 14px 14px; font-size: 13.5px; color: var(--fb-muted); }
.ig-deck-meta a { color: var(--fb-muted); }
.ig-deck-chat-link { color: var(--fb-blue) !important; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ig-deck-actions { display: flex; justify-content: center; gap: 22px; margin-top: 18px; }
.ig-deck-btn {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--fb-card); border: 1px solid var(--fb-border);
  box-shadow: var(--shadow); font-size: 24px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .1s ease;
}
.ig-deck-btn:active { transform: scale(.92); }
.ig-deck-btn-skip { color: var(--fb-muted); }
.ig-deck-btn-like { color: #e0245e; }
.ig-deck-progress { margin-top: 12px; font-size: 12.5px; color: var(--fb-muted); }
.ig-deck-empty {
  padding: 48px 20px; color: var(--fb-muted); background: var(--fb-card);
  border: 1px dashed var(--fb-border); border-radius: var(--radius); font-size: 14.5px; line-height: 1.6;
}
.ig-deck-empty a { color: var(--fb-blue); font-weight: 600; }

.doctan-comment-section { border-top: 1px solid var(--fb-border); padding: 14px; }
.doctan-comment-heading { margin: 0 0 10px; font-size: 15px; }
.doctan-comment-form { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; }
.doctan-comment-form textarea { flex: 1; min-height: 40px; resize: vertical; padding: 10px 12px; border: 1px solid var(--fb-border); border-radius: var(--radius); font: inherit; }
.doctan-comment-list { display: flex; flex-direction: column; gap: 12px; }
.doctan-comment { display: flex; gap: 10px; align-items: flex-start; }
.doctan-comment-body { flex: 1; background: var(--fb-bg); border-radius: var(--radius); padding: 8px 12px; }
.doctan-comment-body p { margin: 0; font-size: 14px; }
.doctan-comment-meta { font-size: 12px; color: var(--fb-muted); margin-top: 4px !important; }
.doctan-comment-del { border: none; background: none; color: var(--fb-muted); cursor: pointer; font-size: 12px; padding: 0; margin-left: 6px; }
.doctan-comment-del:hover { color: #d32f2f; }

/* ================= TIN NHAN (tro chuyen rieng 1-1) ================= */
.fb-nav-icon-chat { position: relative; }
.chat-nav-badge {
  position: absolute; top: 4px; right: 10px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--fb-danger); color: #fff;
  border-radius: 999px; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.fb-bottom-nav .chat-nav-badge { top: 6px; right: 16px; }

.chat-inbox-list { display: flex; flex-direction: column; gap: 2px; max-width: 560px; margin: 0 auto; }
.chat-inbox-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius); text-decoration: none; color: inherit;
  background: var(--fb-card); border: 1px solid var(--fb-border);
}
.chat-inbox-item:hover { background: var(--fb-hover); }
.chat-inbox-item.unread { border-color: var(--fb-blue); }
.chat-inbox-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-inbox-name { font-size: 14.5px; font-weight: 700; }
.chat-inbox-item.unread .chat-inbox-name { color: var(--fb-blue); }
.chat-inbox-preview { font-size: 13px; color: var(--fb-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-inbox-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.chat-inbox-time { font-size: 11.5px; color: var(--fb-muted); }
.chat-badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--fb-danger); color: #fff;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

.chat-thread-wrap { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; height: calc(100vh - 220px); min-height: 420px; }
.chat-thread-header {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--fb-card); border: 1px solid var(--fb-border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.chat-back { text-decoration: none; color: var(--fb-text); font-size: 18px; padding: 4px; }
.chat-thread-name { font-weight: 700; font-size: 15px; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px;
  background: var(--fb-bg); border-left: 1px solid var(--fb-border); border-right: 1px solid var(--fb-border);
}
.chat-bubble-row { display: flex; flex-direction: column; max-width: 78%; }
.chat-bubble-row.mine { align-self: flex-end; align-items: flex-end; }
.chat-bubble-row.theirs { align-self: flex-start; align-items: flex-start; }
.chat-bubble { padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.4; word-break: break-word; }
.chat-bubble-row.mine .chat-bubble { background: var(--fb-blue); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble-row.theirs .chat-bubble { background: var(--fb-card); border: 1px solid var(--fb-border); border-bottom-left-radius: 4px; }
.chat-bubble-time { font-size: 10.5px; color: var(--fb-muted); margin-top: 3px; padding: 0 4px; }
.chat-send-form {
  display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px;
  background: var(--fb-card); border: 1px solid var(--fb-border);
  border-radius: 0 0 var(--radius) var(--radius);
}
.chat-send-form textarea {
  flex: 1; min-height: 40px; max-height: 120px; resize: vertical;
  padding: 9px 12px; border: 1px solid var(--fb-border); border-radius: var(--radius); font: inherit;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1080px) {
  .fb-shell, .fb-shell.no-right { grid-template-columns: 240px minmax(0,1fr); }
  .fb-right { display: none; }
}
@media (max-width: 860px) {
  .fb-topbar-inner { gap: 6px; padding: 0 10px; }
  .fb-search input { width: 120px; }
  .fb-nav-icon { width: 64px; }
  .fb-add-menu-panel { position: fixed; left: 10px; right: 10px; top: 64px; min-width: 0; }
  .fb-shell, .fb-shell.no-right { grid-template-columns: 1fr; }
  body { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
  .fb-bottom-nav { display: flex; }
  .fb-topbar-center { display: none; }
  .fb-left {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    background: var(--fb-card);
    border: 1px solid var(--fb-border);
    border-radius: var(--radius);
    padding: 6px;
    margin-bottom: 4px;
    box-shadow: none;
  }
  .fb-left-profile, .fb-left-heading, .fb-left-mini-post, .fb-left-divider, .fb-left-primary, .fb-login-card { display: none; }
  .fb-left-link { flex-direction: column; gap: 4px; white-space: nowrap; font-size: 12px; padding: 10px 12px; min-height: 44px; }
  .fb-left-link .ic { width: 30px; height: 30px; font-size: 15px; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
  .ig-feed, .ig-deck-wrap, .ig-post-detail { max-width: 100%; }
  .ig-post-media-lg { aspect-ratio: 1 / 1; max-height: none; }
  .fb-icon-btn, .ig-icon-btn { width: 44px; height: 44px; }
  .btn { min-height: 44px; }
  .chat-thread-wrap { height: calc(100vh - 260px); }
}
@media (max-width: 560px) {
  .fb-user-chip .nm { display: none; }
  .fb-search input { width: 84px; }
  form[action="/dang-xuat"] .btn { padding: 7px 10px; font-size: 12.5px; }
  .ig-deck-btn { width: 60px; height: 60px; font-size: 26px; }
  .fb-hero { padding: 22px 18px; }
  .fb-hero-stats { gap: 16px; flex-wrap: wrap; }
}
