* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
body { background: #f0f2f5; color: #1c1e21; line-height: 1.5; }
.hidden { display: none !important; }
.muted { color: #65676b; }
.pill { background: #e7f3ff; color: #1877f2; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; display: inline-block; margin-top: 6px; }

.fb-auth-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: #f0f2f5; }
.fb-auth-container { width: 100%; max-width: 980px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; }
.fb-logo-text { color: #1877f2; font-size: 48px; font-weight: 900; letter-spacing: -1px; line-height: 1.1; margin-bottom: 12px; }
.fb-tagline { font-size: 20px; color: #1c1e21; margin-bottom: 16px; }
.fb-meta-box { background: #fff; border: 1px solid #dddfe2; border-radius: 10px; padding: 12px 14px; font-size: 13px; color: #4b5563; display: flex; flex-direction: column; gap: 4px; word-break: break-word; }

.auth-card { background: #fff; width: 100%; max-width: 440px; margin: 0 auto; padding: 22px; border-radius: 12px; box-shadow: 0 4px 18px rgba(0,0,0,0.1); }
.locale-selectors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.locale-field label { display: block; font-size: 11px; font-weight: 700; color: #4b5563; margin-bottom: 3px; }
.locale-field select, .auth-select-full { width: 100%; padding: 8px 10px; border: 1px solid #dddfe2; border-radius: 8px; font-size: 13px; background: #fff; margin-bottom: 10px; }
.locale-field select { margin-bottom: 0; }

.auth-tabs { display: flex; gap: 8px; margin: 10px 0 14px; }
.auth-tabs button { flex: 1; padding: 9px; border: 1px solid #dddfe2; background: #f0f2f5; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 13px; }
.auth-tabs button.active { background: #1877f2; color: #fff; border-color: #1877f2; }
.auth-card input { width: 100%; padding: 11px 12px; margin-bottom: 10px; border: 1px solid #dddfe2; border-radius: 8px; font-size: 14px; }
.btn-full { width: 100%; padding: 11px; font-size: 15px; }
.auth-alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; margin-bottom: 12px; background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.security-note { margin-top: 12px; padding: 9px 11px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; font-size: 12px; color: #1e3a8a; }
.auth-policy-links { margin-top: 14px; font-size: 12px; text-align: center; line-height: 1.8; }

.btn-primary { background: #1877f2; color: #fff; border: none; padding: 9px 14px; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 13px; }
.btn-success { background: #42b72a; color: #fff; border: none; padding: 9px 14px; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 13px; }
.btn-secondary { background: #e4e6eb; color: #1c1e21; border: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 13px; }
.link-btn { background: none; border: none; color: #1877f2; font-weight: 600; cursor: pointer; font-size: 12px; text-decoration: underline; }

.topbar { position: sticky; top: 0; z-index: 200; height: 56px; background: #fff; border-bottom: 1px solid #dddfe2; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; gap: 10px; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; }
.brand-badge { width: 38px; height: 38px; border-radius: 50%; background: #1877f2; color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.search-box input { background: #f0f2f5; border: none; padding: 8px 14px; border-radius: 999px; width: 190px; font-size: 13px; }
.mini-select { padding: 6px 8px; border: 1px solid #dddfe2; border-radius: 8px; font-size: 12px; background: #f0f2f5; max-width: 110px; }
.topbar-center { display: flex; gap: 4px; }
.nav-tab { background: none; border: none; padding: 8px 12px; border-radius: 8px; font-weight: 700; cursor: pointer; color: #65676b; font-size: 13px; }
.nav-tab.active { background: #e7f3ff; color: #1877f2; }
.icon-btn { position: relative; width: 36px; height: 36px; border-radius: 50%; border: none; background: #f0f2f5; cursor: pointer; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
.badge { position: absolute; top: -3px; right: -3px; background: #e41e3f; color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 999px; }
.profile-chip { display: flex; align-items: center; gap: 6px; background: #f0f2f5; padding: 4px 10px 4px 4px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 13px; }
.profile-chip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

.dropdown-panel { position: absolute; top: 52px; right: 14px; width: 285px; background: #fff; border: 1px solid #dddfe2; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); padding: 10px; z-index: 300; max-height: 82vh; overflow-y: auto; }
.dropdown-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; border-bottom: 1px solid #f0f2f5; margin-bottom: 6px; }
.dropdown-profile-head { padding: 8px; border-bottom: 1px solid #f0f2f5; margin-bottom: 6px; display: flex; flex-direction: column; gap: 2px; }
.dropdown-item { width: 100%; text-align: left; background: none; border: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: #1c1e21; }
.dropdown-item:hover { background: #f0f2f5; }
.dropdown-item.danger { color: #dc2626; }

.main-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 240px; gap: 16px; max-width: 1360px; margin: 16px auto; padding: 0 14px; }
.card { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; margin-bottom: 8px; background: #fff; }
.sidebar-user img { width: 38px; height: 38px; border-radius: 50%; }
.sidebar-menu { list-style: none; background: #fff; border-radius: 12px; padding: 8px; margin-bottom: 12px; }
.sidebar-menu li { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; }
.sidebar-menu li:hover { background: #f0f2f5; }
.sidebar-footer-info { background: #fff; border-radius: 12px; padding: 12px; font-size: 12px; color: #65676b; display: flex; flex-direction: column; gap: 4px; word-break: break-word; }

.stories-bar { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.story-card { min-width: 112px; height: 165px; border-radius: 12px; padding: 10px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; flex-shrink: 0; }
.story-avatar-ring { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.25); border: 2px solid #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.story-name { font-size: 12px; font-weight: 700; }

.composer-top { display: flex; gap: 10px; align-items: flex-start; }
.composer-top img { width: 38px; height: 38px; border-radius: 50%; }
.composer-top textarea { flex: 1; border: none; background: #f0f2f5; border-radius: 10px; padding: 10px 12px; resize: vertical; font-size: 14px; }
.media-input-row { display: flex; gap: 8px; margin-top: 10px; }
.media-input-row input, .media-input-row select { padding: 8px 10px; border: 1px solid #dddfe2; border-radius: 8px; font-size: 13px; }
.media-input-row input { flex: 1; }
.composer-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0f2f5; flex-wrap: wrap; gap: 8px; }
.composer-tools { display: flex; gap: 8px; align-items: center; }
.tool-btn { background: #f0f2f5; border: none; padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; }
.privacy-select { padding: 7px 10px; border: 1px solid #dddfe2; border-radius: 8px; font-size: 12px; }

.feed-filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-chip { background: #fff; border: 1px solid #dddfe2; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 12px; }
.filter-chip.active { background: #1877f2; color: #fff; border-color: #1877f2; }

.post-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.post-author-info { display: flex; gap: 10px; align-items: center; }
.post-author-info img { width: 38px; height: 38px; border-radius: 50%; }
.post-meta { font-size: 12px; color: #65676b; }
.verified-badge { color: #1877f2; font-weight: 800; }
.post-body { white-space: pre-wrap; font-size: 14px; margin: 8px 0; }
.post-media { width: 100%; max-height: 420px; object-fit: cover; border-radius: 10px; margin: 8px 0; }
.post-stats { display: flex; justify-content: space-between; font-size: 12px; color: #65676b; padding: 8px 0; border-bottom: 1px solid #f0f2f5; }
.post-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px 0; border-bottom: 1px solid #f0f2f5; }
.post-action-btn { background: none; border: none; padding: 7px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 12px; color: #65676b; }
.post-action-btn:hover, .post-action-btn.liked { background: #f0f2f5; color: #1877f2; }
.comments-box { margin-top: 8px; }
.comment-item { background: #f0f2f5; padding: 7px 10px; border-radius: 10px; font-size: 13px; margin-bottom: 6px; }
.comment-form { display: flex; gap: 6px; margin-top: 6px; }
.comment-form input { flex: 1; padding: 7px 12px; border: 1px solid #dddfe2; border-radius: 999px; font-size: 13px; }

.settings-box { border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.settings-label { display: block; font-size: 13px; font-weight: 700; margin-top: 10px; margin-bottom: 4px; }
.settings-input { width: 100%; padding: 9px 12px; border: 1px solid #dddfe2; border-radius: 8px; margin-bottom: 8px; font-size: 13px; background: #fff; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 10px; }
.mini-card { border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px; background: #fff; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.contact-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.contact-row:hover { background: #f0f2f5; }
.online-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.profile-card { text-align: center; }
.profile-lg-avatar { width: 92px; height: 92px; border-radius: 50%; margin-bottom: 8px; }

.site-footer { max-width: 1360px; margin: 20px auto 28px; padding: 16px; background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; text-align: center; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

.messenger-popup { position: fixed; bottom: 0; right: 20px; width: 320px; background: #fff; border: 1px solid #dddfe2; border-radius: 12px 12px 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,0.15); z-index: 320; }
.messenger-header { background: #1877f2; color: #fff; padding: 10px 12px; border-radius: 12px 12px 0 0; display: flex; justify-content: space-between; align-items: center; }
.close-btn { background: none; border: none; color: inherit; font-size: 16px; cursor: pointer; font-weight: 700; }
.chat-users-strip { display: flex; gap: 4px; padding: 6px 8px; overflow-x: auto; border-bottom: 1px solid #f0f2f5; }
.chat-user-chip { border: 1px solid #dddfe2; background: #f0f2f5; padding: 4px 10px; border-radius: 999px; font-size: 12px; cursor: pointer; }
.chat-user-chip.active { background: #1877f2; color: #fff; border-color: #1877f2; }
.chat-messages { height: 220px; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.msg-bubble { max-width: 78%; padding: 8px 11px; border-radius: 14px; font-size: 13px; }
.msg-sent { background: #1877f2; color: #fff; align-self: flex-end; }
.msg-received { background: #f0f2f5; color: #1c1e21; align-self: flex-start; }
.chat-input-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid #f0f2f5; }
.chat-input-form input { flex: 1; padding: 7px 10px; border: 1px solid #dddfe2; border-radius: 999px; font-size: 13px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; padding: 14px; z-index: 400; }
.modal-box { background: #fff; width: 100%; max-width: 580px; border-radius: 12px; overflow: hidden; max-height: 88vh; display: flex; flex-direction: column; }
.modal-header { padding: 12px 16px; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; color: #1c1e21; }
.modal-body { padding: 16px; overflow-y: auto; font-size: 14px; }
.modal-body p { margin-bottom: 10px; }
.modal-body ul { margin-left: 18px; margin-bottom: 10px; }
.modal-body li { margin-bottom: 6px; }
.story-modal-body { padding: 28px; font-size: 18px; font-weight: 700; text-align: center; }

.mobile-only { display: none; }
@media (max-width: 900px) {
  .fb-auth-container { grid-template-columns: 1fr; gap: 18px; }
  .fb-logo-text { font-size: 36px; text-align: center; }
  .fb-tagline { font-size: 16px; text-align: center; }
  .main-layout { grid-template-columns: 1fr; }
  .left-sidebar { display: none; }
  .left-sidebar.mobile-open { display: block; position: fixed; top: 56px; left: 0; bottom: 0; width: 250px; background: #f0f2f5; padding: 12px; z-index: 250; overflow-y: auto; }
  .right-sidebar { display: none; }
  .mobile-only { display: inline-flex; }
  .search-box input { width: 120px; }
}
