/* Pixel-perfect modern Facebook (2026) comments embed UI */
/* Light mode, matches current facebook.com production */

.fbc-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #ffffff;
  border: 1px solid #ced0d4;
  border-radius: 8px;
  margin: 28px 0;
  overflow: hidden;
  color: #050505;
}

.fbc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #e4e6eb;
  background: #f7f8fa;
}
.fbc-header-title {
  font-size: 17px;
  font-weight: 600;
  color: #050505;
}
.fbc-header-sort {
  font-size: 15px;
  color: #65676b;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
  user-select: none;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: 6px;
}
.fbc-header-sort:hover { background: #ebedf0; }
.fbc-header-sort::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2365676b'><path d='M3.5 6L8 10.5 12.5 6h-9z'/></svg>") no-repeat center / contain;
}

/* Sort dropdown menu */
.fbc-sort-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 240px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.08);
  padding: 8px 0;
  z-index: 100;
  display: none;
}
.fbc-header-sort.fbc-sort-open .fbc-sort-menu { display: block; }
.fbc-sort-option {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: #050505;
  display: block;
  font-weight: 400;
  text-align: left;
  border-radius: 0;
}
.fbc-sort-option:hover { background: #f0f2f5; }
.fbc-sort-option.fbc-sort-active {
  font-weight: 600;
  background: #e7f3ff;
}
.fbc-sort-option-title { display: block; }
.fbc-sort-option-desc {
  display: block;
  font-size: 12px;
  color: #65676b;
  font-weight: 400;
  margin-top: 2px;
}

.fbc-list { padding: 12px 16px 4px; }

.fbc-comment {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  align-items: flex-start;
}

.fbc-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: #d8dadf;
}

.fbc-bubble-wrap { flex: 1; min-width: 0; position: relative; }

.fbc-bubble {
  background: #f0f2f5;
  border-radius: 18px;
  padding: 8px 12px;
  display: inline-block;
  max-width: 100%;
  position: relative;
}
.fbc-bubble-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 2px;
}
.fbc-name {
  font-weight: 600;
  font-size: 13px;
  color: #050505;
}
.fbc-name a { color: #050505; text-decoration: none; }
.fbc-name a:hover { text-decoration: underline; }

.fbc-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #e4e6eb;
  color: #65676b;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
}
.fbc-badge-topfan { background: #fff0e6; color: #b35900; }
.fbc-badge-topfan::before {
  content: '';
  display: inline-block;
  width: 11px;
  height: 11px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='%23ff8c00'><path d='M6 1L2.5 4 6 11l3.5-7L6 1z'/></svg>") no-repeat center / contain;
}
.fbc-badge-verified {
  width: 14px; height: 14px; padding: 0; background: transparent;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='11' fill='%231877f2'/><path d='M9.5 16.5L5 12l1.4-1.4 3.1 3.1 7.1-7.1 1.4 1.4-8.5 8.5z' fill='white'/></svg>") no-repeat center / contain;
}
.fbc-badge-page {
  background: transparent;
  color: #65676b;
  padding: 0;
  font-size: 12px;
  font-weight: 400;
}
.fbc-badge-page::before {
  content: '· ';
  margin: 0 2px;
}

.fbc-text {
  font-size: 14px;
  line-height: 1.34;
  color: #050505;
  margin: 0;
  word-wrap: break-word;
}

.fbc-bubble-reactions {
  position: absolute;
  bottom: -8px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid #ced0d4;
  border-radius: 12px;
  padding: 1px 6px 1px 4px;
  font-size: 12px;
  color: #65676b;
  font-weight: 600;
  height: 22px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.fbc-rxn {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  vertical-align: middle;
}
.fbc-rxn + .fbc-rxn { margin-left: -3px; }
.fbc-rxn-like { background: linear-gradient(180deg,#1877f2 0%,#0a5dcc 100%); }
.fbc-rxn-like::before {
  content: '';
  display: block;
  width: 100%; height: 100%;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'><path d='M5.7 14H3.5c-.5 0-.9-.4-.9-.9V8.5c0-.5.4-.9.9-.9h2.2v6.4zm8.7-7c0-.7-.5-1.2-1.2-1.2H10l.5-2.4c.1-.4-.2-.8-.6-.9-.3-.1-.7.1-.8.4L7 7.5v6.5h5.5c.5 0 .9-.3 1.1-.8l1-3.7c.1-.5-.2-1-.7-1.1.5-.1.8-.6.7-1.1l-.2-.3z'/></svg>") no-repeat center / 11px;
}
.fbc-rxn-love { background: linear-gradient(180deg,#f33e58 0%,#e0162b 100%); }
.fbc-rxn-love::before {
  content: '';
  display: block; width: 100%; height: 100%;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'><path d='M8 14s-5.5-3.5-5.5-7.5C2.5 4.5 4 3 6 3c1 0 1.7.4 2 1 .3-.6 1-1 2-1 2 0 3.5 1.5 3.5 3.5C13.5 10.5 8 14 8 14z'/></svg>") no-repeat center / 10px;
}
.fbc-rxn-haha { background: linear-gradient(180deg,#f7b125 0%,#e88e0a 100%); position: relative; }
.fbc-rxn-haha::before {
  content: '😂';
  position: absolute;
  font-size: 13px;
  line-height: 16px;
  text-align: center;
  width: 100%;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
}
.fbc-rxn-wow { background: linear-gradient(180deg,#f7b125 0%,#e88e0a 100%); position: relative; }
.fbc-rxn-wow::before {
  content: '😮';
  position: absolute;
  font-size: 13px;
  line-height: 16px;
  text-align: center;
  width: 100%;
}
.fbc-rxn-fire { background: linear-gradient(180deg,#ff6b35 0%,#d94816 100%); position: relative; }
.fbc-rxn-fire::before {
  content: '🔥';
  position: absolute;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  width: 100%;
}
.fbc-rxn-care { background: linear-gradient(180deg,#f7b125 0%,#e88e0a 100%); position: relative; }
.fbc-rxn-care::before {
  content: '🥰';
  position: absolute;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  width: 100%;
}
.fbc-rxn-sad { background: linear-gradient(180deg,#f7b125 0%,#e88e0a 100%); position: relative; }
.fbc-rxn-sad::before {
  content: '😢';
  position: absolute;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  width: 100%;
}
.fbc-rxn-angry { background: linear-gradient(180deg,#e88e0a 0%,#d14d10 100%); position: relative; }
.fbc-rxn-angry::before {
  content: '😠';
  position: absolute;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  width: 100%;
}
.fbc-rxn-count { margin-left: 4px; vertical-align: middle; }

.fbc-actions {
  font-size: 12px;
  color: #65676b;
  margin: 8px 12px 0;
  display: flex;
  gap: 12px;
  align-items: center;
}
.fbc-action {
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  position: relative;
}
.fbc-action:hover { text-decoration: underline; }
.fbc-action.fbc-action-liked { color: #1877f2; }
.fbc-action.fbc-action-reacted-love { color: #f33e58; }
.fbc-action.fbc-action-reacted-haha,
.fbc-action.fbc-action-reacted-wow,
.fbc-action.fbc-action-reacted-care { color: #f7b125; }
.fbc-action.fbc-action-reacted-fire { color: #ff6b35; }

/* Reaction picker — popover above Like button on hover/long-press */
.fbc-rxn-picker {
  position: absolute;
  bottom: calc(100% + 6px);
  left: -8px;
  background: #fff;
  border-radius: 32px;
  padding: 6px 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18), 0 1px 3px rgba(0,0,0,0.12);
  display: none;
  z-index: 100;
  white-space: nowrap;
}
.fbc-action:hover .fbc-rxn-picker,
.fbc-action.fbc-active-picker .fbc-rxn-picker {
  display: block;
  animation: fbc-pop 0.15s ease-out;
}
@keyframes fbc-pop {
  from { opacity: 0; transform: translateY(4px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.fbc-rxn-pick {
  display: inline-block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin: 0 1px;
  font-size: 28px;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease;
  vertical-align: middle;
  user-select: none;
}
.fbc-rxn-pick:hover {
  transform: scale(1.4) translateY(-4px);
}
.fbc-rxn-pick[data-rxn="like"]::before { content: '👍'; }
.fbc-rxn-pick[data-rxn="love"]::before { content: '❤️'; }
.fbc-rxn-pick[data-rxn="care"]::before { content: '🥰'; }
.fbc-rxn-pick[data-rxn="haha"]::before { content: '😂'; }
.fbc-rxn-pick[data-rxn="wow"]::before { content: '😮'; }
.fbc-rxn-pick[data-rxn="sad"]::before { content: '😢'; }
.fbc-rxn-pick[data-rxn="angry"]::before { content: '😠'; }
.fbc-rxn-pick[data-rxn="fire"]::before { content: '🔥'; }

/* Inline reply form (hidden by default, shown when Reply clicked) */
.fbc-reply-form {
  display: none;
  margin: 6px 0 0 0;
  padding: 0;
}
.fbc-reply-form.fbc-active {
  display: flex;
  gap: 8px;
  align-items: center;
}
.fbc-reply-form-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #1877f2;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  object-fit: cover;
}
.fbc-reply-form-input-wrap {
  flex: 1;
  background: #f0f2f5;
  border-radius: 18px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fbc-reply-form-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  color: #050505;
  font-family: inherit;
  resize: none;
  min-height: 18px;
  max-height: 80px;
}
.fbc-reply-form-input::placeholder { color: #65676b; }
.fbc-reply-form-submit {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231877f2'><path d='M2 21l21-9L2 3v7l15 2-15 2z'/></svg>") no-repeat center / contain;
  cursor: pointer;
  flex-shrink: 0;
}
.fbc-reply-form-submit:disabled { opacity: 0.4; cursor: default; }

/* User-posted comment marker (when localStorage has user comments) */
.fbc-comment.fbc-user-posted .fbc-bubble {
  background: #e7f3ff;
}
.fbc-time {
  color: #65676b;
  font-weight: 400;
  font-size: 12px;
}

/* Nested replies — indented with vertical threading line + curved branches */
.fbc-replies {
  margin: 4px 0 0 0;
  padding-left: 48px;
  position: relative;
}
/* The vertical line descending from parent avatar — height set by JS to stop at last reply avatar */
.fbc-replies::before {
  content: '';
  position: absolute;
  left: 19px;
  top: -8px;
  height: var(--fbc-thread-h, calc(100% - 18px));
  width: 2px;
  background: #ced0d4;
  border-radius: 2px;
}
.fbc-replies .fbc-comment {
  margin: 0 0 12px;
  position: relative;
}
/* The curved branch from vertical line to each reply avatar */
.fbc-replies .fbc-comment::before {
  content: '';
  position: absolute;
  left: -29px;
  top: 14px;
  width: 22px;
  height: 14px;
  border-left: 2px solid #ced0d4;
  border-bottom: 2px solid #ced0d4;
  border-bottom-left-radius: 8px;
}
.fbc-replies .fbc-avatar-img { width: 32px; height: 32px; }

.fbc-more-replies {
  margin: 4px 0 10px 48px;
  font-size: 13px;
  font-weight: 600;
  color: #65676b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* Curve arrow icon removed per user request */
.fbc-more-replies:hover { text-decoration: underline; }

/* "View N more comments" */
.fbc-more {
  padding: 4px 16px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #65676b;
  cursor: pointer;
}
.fbc-more:hover { text-decoration: underline; }

/* Compose box */
.fbc-compose {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 12px;
  border-top: 1px solid #e4e6eb;
  background: #fff;
}
.fbc-compose-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.fbc-compose-input-wrap {
  flex: 1;
  background: #f0f2f5;
  border-radius: 18px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fbc-compose-input {
  flex: 1;
  font-size: 14px;
  color: #65676b;
  border: none;
  background: transparent;
  outline: none;
  cursor: text;
}
.fbc-compose-icons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.fbc-compose-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  cursor: pointer;
  opacity: 0.85;
}
.fbc-compose-icon:hover { opacity: 1; }
.fbc-icon-emoji { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2365676b' stroke-width='2'><circle cx='12' cy='12' r='10'/><circle cx='8.5' cy='10' r='1' fill='%2365676b'/><circle cx='15.5' cy='10' r='1' fill='%2365676b'/><path d='M8 14a4 4 0 0 0 8 0' stroke-linecap='round'/></svg>"); }
.fbc-icon-camera { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2365676b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/><circle cx='12' cy='13' r='4'/></svg>"); }
.fbc-icon-gif {
  width: 28px; height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #65676b;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  color: #65676b;
  background: none;
}
.fbc-icon-gif::before { content: 'GIF'; }
.fbc-icon-sticker { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2365676b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 12L13 4v8h8z'/><path d='M21 12a9 9 0 1 1-9-9'/></svg>"); }

@media (max-width: 600px) {
  .fbc-list { padding: 10px 12px 4px; }
  .fbc-bubble { padding: 8px 11px; }
  .fbc-text { font-size: 13.5px; }
  .fbc-replies { margin-left: 40px; }
  .fbc-more-replies { margin-left: 40px; }
  .fbc-name { font-size: 13px; }
  .fbc-avatar-img { width: 36px; height: 36px; }
  .fbc-replies .fbc-avatar-img { width: 28px; height: 28px; }
}
