
:root {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --surface-soft: #f7f8fa;
  --line: #dfe3e8;
  --text: #1c1e21;
  --muted: #65676b;
  --blue: #1877f2;
  --blue-soft: #e7f3ff;
  --green: #31a24c;
  --warning: #f7b928;
  --danger: #e41e3f;
  --shadow: 0 1px 2px rgba(0,0,0,.08);
  --shadow-soft: 0 4px 12px rgba(0,0,0,.05);
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
body {
  margin: 0;
  color: var(--text);
  font: 15px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; }
input, textarea, select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #d9dde3;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: #9cc2ff;
  box-shadow: 0 0 0 3px rgba(24,119,242,.14);
}
textarea { resize: vertical; }
.fb-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.fb-topbar-left,
.fb-topbar-center,
.fb-topbar-right,
.top-actions,
.author-row,
.author-line,
.post-header,
.stats-row,
.post-actions,
.profile-body,
.inline-form,
.split,
.user-chip,
.mini-user,
.name-with-badge,
.audio-player-head,
.comment-author-link,
.fb-nav,
.fb-action-group,
.fb-user-pill,
.feed-shell,
.quick-actions,
.story-strip,
.story-card,
.composer-head,
.composer-actions,
.status-meta,
.post-summary,
.reaction-summary,
.reaction-inline,
.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fb-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.3rem;
  flex: 0 0 auto;
}
.search-pill {
  height: 40px;
  border-radius: 999px;
  background: #f0f2f5;
  border: 0;
  padding: 0 16px;
}
.fb-nav { justify-content: center; }
.fb-nav a {
  width: 112px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-radius: 10px;
  position: relative;
  font-size: 1.3rem;
}
.fb-nav a.active,
.fb-nav a:hover {
  background: #f0f2f5;
  color: var(--blue);
}
.fb-nav a.active::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 3px;
  background: var(--blue);
  border-radius: 999px;
}
.fb-circle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e4e6eb;
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 700;
}
.fb-user-pill {
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
}
.fb-user-pill:hover { background: #f0f2f5; }
.fb-user-pill img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: calc(100vh - 56px);
}
.sidebar {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow: auto;
  padding: 18px 14px 24px;
  background: transparent;
}
.brand { display:none; }
.sidebar-footer { display: grid; gap: 12px; margin-top: 18px; }
.menu { display: grid; gap: 2px; }
.menu a,
.user-chip,
.mini-user {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  transition: background .16s ease;
}
.menu a:hover,
.user-chip:hover,
.mini-user:hover,
.author-link:hover,
.comment-author-link:hover,
.profile-handle:hover,
.story-card:hover {
  background: rgba(0,0,0,.04);
}
.menu-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e7f3ff;
  color: var(--blue);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 1rem;
}
.main-content { padding: 16px 16px 32px; }
.page-head { display:none; }
.narrow { max-width: 680px; margin: 0 auto; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.feed-column { max-width: 680px; margin: 0 auto; }
.grid-cards { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.stack-lg > * + * { margin-top: 16px; }
.stack-md > * + * { margin-top: 12px; }
.stack-sm > * + * { margin-top: 8px; }
.mt-lg { margin-top: 16px; }
.grow { flex: 1; }
.wrap { flex-wrap: wrap; }
.row-gap { display: flex; flex-wrap: wrap; gap: 8px; }
.clean-list { list-style: none; margin: 0; padding: 0; }
.small-list li + li { margin-top: 8px; }
.small-list a { color: var(--blue); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card.no-padding { padding: 0; overflow: hidden; }
.post-card {
  padding: 12px 0 0;
  border-radius: 10px;
  overflow: hidden;
}
.post-card > *:not(.media-frame):not(.reaction-summary) { padding-left: 16px; padding-right: 16px; }
.post-card > .media-frame { margin: 10px 0 0; }
.toolbar,
.wide-toolbar { display:grid; gap:12px; align-items:center; }
.toolbar { grid-template-columns: 1.8fr .9fr auto auto; }
.wide-toolbar { grid-template-columns: 1.6fr .9fr .9fr auto auto auto; }
.checkbox-inline { display:flex; align-items:center; gap:8px; color:var(--muted); }
.checkbox-inline input { width:auto; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 700;
}
.btn.secondary { background: #8b5cf6; }
.btn.ghost { background: #e4e6eb; color: var(--text); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.flash { margin-bottom: 12px; border-radius: 10px; padding: 12px 14px; }
.flash.success { background: #eaf8ee; color: #12662a; }
.flash.error { background: #fdecef; color: #a61b34; }
.avatar,
.mini-user img,
.user-chip img,
.comment-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  flex: 0 0 40px;
}
.profile-avatar {
  width: 132px;
  height: 132px;
  min-width: 132px;
  border-radius: 50%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  margin-top: -80px;
  border: 4px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.profile-cover { width:100%; height:300px; object-fit:cover; background:#dde3ea; }
.profile-body { align-items:flex-end; gap:16px; padding:0 18px 18px; }
.author-row,.author-link { min-width:0; }
.author-link,.comment-author-link,.profile-handle { color:inherit; }
.author-link { flex:1; }
.author-line,.name-with-badge { flex-wrap:wrap; }
.author-line h2 { margin:0; font-size:1.85rem; }
.author-link strong,.user-chip strong,.mini-user strong,.comment-author-link strong { font-size:.95rem; }
.author-row small,.muted,.sidebar small,.status-meta,.subtitle,.post-copy,.comment small,.user-chip small,.mini-user small,.stats-row,.audio-player-head small { color: var(--muted); }
.verified-icon { display:inline-flex; align-items:center; justify-content:center; color:var(--blue); flex:0 0 auto; }
.verified-icon svg { display:block; }
.verified-sm { width:18px; height:18px; }
.verified-md { width:20px; height:20px; }
.verified-lg { width:22px; height:22px; }
.badge,.pill { display:inline-flex; align-items:center; justify-content:center; min-height:24px; padding:0 10px; border-radius:999px; font-size:12px; font-weight:700; }
.badge { background:#eef0f3; color:#495057; }
.pill { background:#f0f2f5; color:#495057; }
.type-chip { font-size:11px; letter-spacing:.03em; }
.type-news { color:#1b74e4; }
.type-photo { color:#a53ce7; }
.type-video { color:#ef4444; }
.type-audio { color:#059669; }
.type-quote { color:#7c3aed; }
.trust-common { background:#eef0f3; color:#48505b; }
.trust-verified { background:#e7f3ff; color:#1b74e4; }
.trust-professional { background:#ecfdf3; color:#157347; }
.trust-institutional { background:#f3edff; color:#6941c6; }
.status-draft { background:#f0f2f5; color:#65676b; }
.status-review { background:#fff4d6; color:#936b00; }
.status-published { background:#eaf8ee; color:#157347; }
.status-correction { background:#fdecef; color:#b42318; }
.author-highlight { background:#fff3cd; color:#946200; }
.danger-soft { background:#fdecef; color:#b42318; }
.post-card h2 { margin: 12px 0 4px; font-size:1.1rem; line-height:1.3; }
.subtitle,.post-copy { margin:0 0 10px; }
.media-frame { width:100%; overflow:hidden; background:#eef1f5; margin:12px 0; }
.media-frame-vertical { max-width:500px; margin-left:auto; margin-right:auto; aspect-ratio:9 / 16; border-radius:0; }
.cover-media,.embed-media { width:100%; height:100%; object-fit:cover; background:#000; }
.embed-media.media-portrait { aspect-ratio:9 / 16; }
.type-photo .media-frame-vertical .cover-media,
.type-video .media-frame-vertical .cover-media { aspect-ratio:9 / 16; }
.type-news .cover-media { aspect-ratio:16 / 9; }
.read-more summary { list-style:none; font-weight:600; color:#1b74e4; cursor:pointer; margin-bottom:8px; }
.read-more summary::-webkit-details-marker { display:none; }
.rich-text,.discussion-prompt,.panel,.comment,.source-box { border-radius:0; background:transparent; padding:8px 16px 12px; }
.rich-text p,.discussion-prompt p,.comment p,.source-box p,.source-box li { margin:0; }
.discussion-prompt strong,.source-box strong { display:inline-block; margin-bottom:6px; }
.source-box { margin-top:0; }
.warning-panel { background:#fff8db; border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding:12px 16px; }
.quote-box { margin:8px 16px 0; padding:38px 22px; background:#f0f2f5; border-radius:12px; text-align:center; }
.quote-mark { display:inline-flex; align-items:center; justify-content:center; width:72px; height:72px; margin-bottom:14px; border-radius:50%; background:var(--blue-soft); color:var(--blue); font-size:2.2rem; font-weight:800; }
.quote-box p { margin:0; font-size:1.5rem; line-height:1.35; font-weight:800; }
.audio-player-card { margin:12px 16px 0; padding:14px; border-radius:14px; background:linear-gradient(180deg,#f8fbff 0%, #eef4ff 100%); }
.audio-player-head { margin-bottom:10px; }
.audio-icon { width:42px; height:42px; border-radius:50%; display:grid; place-items:center; background:var(--blue); color:#fff; font-size:1.15rem; }
.embed-audio { width:100%; height:46px; }
.reaction-summary { justify-content:space-between; padding:10px 16px 8px; color:var(--muted); }
.reaction-inline { gap:0; }
.reaction-bubble { width:20px; height:20px; border-radius:50%; display:grid; place-items:center; color:#fff; font-size:11px; border:2px solid #fff; margin-left:-4px; }
.reaction-bubble:first-child { margin-left:0; }
.react-like { background:#1877f2; }
.react-love { background:#f33e58; }
.react-sad,.react-wow { background:#f7b125; }
.react-angry { background:#e9710f; }
.react-vomit { background:#cc8f00; }
.reaction-bar { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:4px; padding:4px 8px 8px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.reaction-form { margin:0; }
.react-fb { width:100%; justify-content:center; min-height:38px; border-radius:8px; background:transparent; color:var(--muted); display:inline-flex; align-items:center; gap:8px; }
.react-fb:hover { background:#f0f2f5; }
.react-fb.active { background:#e7f3ff; color:var(--blue); }
.react-fb-icon { width:22px; height:22px; border-radius:50%; display:grid; place-items:center; font-size:13px; background:transparent; }
.react-fb-count { font-weight:700; font-size:13px; }
.post-actions { justify-content:space-between; flex-wrap:wrap; gap:12px; padding:10px 16px 12px; color:var(--muted); }
.comment { margin-top:10px; background:#f0f2f5; border-radius:18px; }
.comment-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:6px; }
.comment-author-link { display:inline-flex; align-items:center; gap:6px; }
.inline-form { flex-wrap:wrap; }
.inline-form input { flex:1; min-width:220px; }
.auth-wrap { max-width:540px; }
.profile-handle { color:var(--muted); }
.stats-row { flex-wrap:wrap; gap:14px; }
.story-strip { gap:12px; overflow:auto; padding-bottom:4px; }
.story-card { flex-direction:column; align-items:flex-start; min-width:112px; height:188px; padding:12px; border-radius:12px; background:linear-gradient(180deg,#dbeafe 0%, #bfdbfe 100%); box-shadow:var(--shadow-soft); }
.story-card strong { margin-top:auto; }
.composer-card { padding:12px 16px; }
.composer-head { margin-bottom:12px; }
.composer-input { flex:1; background:#f0f2f5; border-radius:999px; min-height:40px; padding:0 16px; display:flex; align-items:center; color:var(--muted); }
.composer-actions { justify-content:space-around; border-top:1px solid var(--line); padding-top:8px; }
.composer-actions a { flex:1; justify-content:center; display:inline-flex; align-items:center; gap:8px; height:40px; border-radius:8px; color:var(--muted); }
.composer-actions a:hover { background:#f0f2f5; }
.reaction-legend { font-size:13px; color:var(--muted); }
@media (max-width: 1280px) {
  .fb-topbar { grid-template-columns: 280px 1fr 220px; }
  .wide-toolbar { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1080px) {
  .fb-topbar { grid-template-columns: 1fr auto; gap:10px; height:auto; padding:10px 12px; }
  .fb-topbar-center { display:none; }
  .app-shell,.grid-main { grid-template-columns: 1fr; }
  .sidebar { position:static; height:auto; padding-top:12px; }
}
@media (max-width: 720px) {
  .main-content { padding:12px 8px 24px; }
  .menu { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .menu a span:last-child { font-size:13px; }
  .toolbar,.wide-toolbar { grid-template-columns:1fr; }
  .grid-cards { grid-template-columns:1fr; }
  .profile-body { align-items:flex-start; flex-direction:column; }
  .profile-avatar { width:104px; height:104px; min-width:104px; border-radius:50%; }
  .media-frame-vertical { max-width:100%; }
  .quote-box p { font-size:1.28rem; }
  .reaction-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
