/* Universal content + comments popup system */
html.ucl-open,
html.ucl-open body { overflow: hidden !important; }

/* Hide old inline feed/profile comment lists. The new universal popup owns comments. */
.comments-wrap .comments-header,
.comments-wrap .comment-list,
.comments-wrap .comment-actions,
.comments-wrap .comment-load-more-btn,
.comments-wrap .comment-form-wrap { display: none !important; }
.comments-wrap { margin-top: .65rem; }
.comments-wrap .comment-action-row { display: flex !important; justify-content: stretch; }
.comments-wrap .comment-toggle-btn { width: 100%; min-height: 40px; border-radius: 12px !important; font-weight: 800 !important; }

.ucl.hidden { display: none !important; }
.ucl { position: fixed; inset: 0; z-index: 2147482300; display: flex; align-items: center; justify-content: center; color: #e8eaed; }
/* Quick Stories viewer is z-index: 230000; its comments must always open above that story layer. */
.ucl.ucl-quick-story-top-layer { z-index: 2147483400 !important; }
.report-modal { z-index: 2147483500 !important; }
.report-toast { z-index: 2147483501 !important; }
.ucl-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(10px); }
.ucl-shell { box-sizing: border-box; position: relative; width: min(1440px, 100vw); max-width: 1440px; height: 100dvh; max-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(390px, .72fr); border-radius: 0; overflow: hidden; background: #111315; box-shadow: 0 30px 90px rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.1); }
.ucl-close { position: absolute; right: 14px; top: 12px; z-index: 10; width: 42px; height: 42px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16);     background: rgb(208 188 188 / 94%); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; display:flex; align-items:center; justify-content:center; }
.ucl-close:hover {background: rgb(166 114 114 / 94%); }
.ucl-close-media { display: none; }

@media (min-width: 761px) {
  #universal-comment-lightbox.ucl:not(.ucl-comments-only) .ucl-shell > .ucl-close {
    display: none !important;
  }
  #universal-comment-lightbox.ucl:not(.ucl-comments-only) .ucl-close-media {
    display: flex !important;
    top: 12px !important;
    right: 12px !important;
    width: 36px !important;
    height: 36px !important;
    border: 0 !important;
    background: transparent !important;
    color: #fff !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    font-size: 34px !important;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .82);
  }
  #universal-comment-lightbox.ucl:not(.ucl-comments-only) .ucl-close-media:hover {
    background: rgba(15, 23, 42, .36) !important;
  }
}

.ucl-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: radial-gradient(circle at top left, #20242b, #050506 62%); }
.ucl-media-panel { min-width: 0; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ucl-media-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 18px; }
.ucl-media-object { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 18px; box-shadow: 0 18px 60px rgba(0,0,0,.48);}
.ucl-media-empty { width: min(520px, 80%); min-height: 260px; border: 1px dashed rgba(255,255,255,.18); border-radius: 22px; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.62); font-weight: 800; background: rgba(255,255,255,.05); }
.ucl-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 46px; height: 58px; border: 0; border-radius: 16px; background: rgba(255,255,255,.12); color: #fff; font-size: 42px; line-height: 1; cursor: pointer; }
.ucl-prev { left: 14px; }
.ucl-next { right: 14px; }
.ucl-nav:hover { background: rgba(255,255,255,.22); }
.ucl-media-counter { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 7px 12px; border-radius: 999px; background: rgba(0,0,0,.42); color: #fff; font-size: 13px; font-weight: 900; }

.ucl.ucl-image-mode .ucl-media-object { image-rendering: auto; }
@media (min-width: 761px) {
  .ucl.ucl-image-mode {
    align-items: stretch;
    justify-content: center;
  }
  .ucl.ucl-image-mode .ucl-shell {
    width: min(1440px, 100vw);
    height: 100dvh;
    max-width: 1440px;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  }
  .ucl.ucl-image-mode .ucl-main {
    grid-template-rows: minmax(0, 1fr);
  }
  .ucl.ucl-image-mode .ucl-content-panel {
    display: none;
  }
  .ucl.ucl-image-mode .ucl-media-stage {
    padding: 0;
    background: #000;
  }
  .ucl.ucl-image-mode .ucl-media-object {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0;
    box-shadow: none;
  }
  .ucl.ucl-image-mode .ucl-side {
    border-left: 1px solid rgba(255,255,255,.12);
    box-shadow: -18px 0 44px rgba(0,0,0,.28);
  }
}

.ucl-content-panel { border-top: 1px solid rgba(255,255,255,.1); background: rgba(9,10,12,.92); padding: 14px 18px 16px; max-height: 270px; overflow: auto; }
.ucl-author { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.ucl-author-avatar img { width: 44px; height: 44px; object-fit: cover; border-radius: 999px; border: 2px solid rgba(255,255,255,.22); }
.ucl-author-copy { min-width: 0; display: flex; flex-direction: column; }
.ucl-author-name { color: #fff; font-weight: 900; text-decoration: none; }
.ucl-author-copy span { color: rgba(255,255,255,.62); font-size: 13px; }

.ucl-open-link { display:none; margin-left: auto; color: #fff; background: rgba(24,119,242,.9); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 900; font-size: 12px; }


.ucl-content h1 { margin: 0 0 8px; font-size: clamp(18px, 2vw, 26px); color: #fff; }
.ucl-body-text { color: rgba(255,255,255,.88); line-height: 1.55; font-size: 14px; }
.ucl-shared-card { margin-top: 12px; display: grid; grid-template-columns: 72px minmax(0,1fr); gap: 12px; padding: 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.ucl-shared-card img { width: 72px; height: 72px; object-fit: cover; border-radius: 14px; }
.ucl-shared-card p { margin: 4px 0 0; color: rgba(255,255,255,.68); max-height: 42px; overflow: hidden; }
.ucl-shared-icon { width: 72px; height: 72px; border-radius: 14px; display:flex; align-items:center; justify-content:center; background: rgba(255,255,255,.1); font-size:28px; }

.ucl-side { min-height: 0; min-width: 0; display: grid; grid-template-rows: auto auto minmax(0,1fr) auto auto; background: #f0f2f5; color: #111827; border-left: 1px solid rgba(255,255,255,.1); }
.ucl-side-head { padding: 12px 62px 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid rgba(15,23,42,.08); }
.ucl-side-title { min-width: 0; }
.ucl-side-head h2 { margin: 0; font-size: 21px; font-weight: 950; }
.ucl-side-head p { margin: 2px 0 0; color: #667085; font-size: 13px; font-weight: 700; }
.ucl-side-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ucl-target-actions { display: flex; align-items: center; justify-content: flex-end; min-height: 32px; }
.ucl-target-actions:empty { display: none; }
.ucl-delete-post-btn {
  min-height: 32px;
  border: 1px solid rgba(185, 28, 28, .22);
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  padding: 8px 12px;
  box-shadow: 0 8px 20px rgba(185, 28, 28, .12);
}
.ucl-delete-post-btn:hover,
.ucl-delete-post-btn:focus-visible { background: #ef4444; border-color: #ef4444; color: #fff; outline: none; }
.ucl-delete-post-btn:disabled { cursor: wait; opacity: .62; }
.ucl-target-react { padding: 6px 18px; border-bottom: 1px solid rgba(15,23,42,.08); display: flex; align-items: center; justify-content: flex-start; gap: 10px; min-height: 40px; box-sizing: border-box; }
.ucl-reaction-summary { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.ucl-reaction-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 999px; background: #fff; border: 1px solid rgba(15,23,42,.08); font-size: 12px; font-weight: 900; box-shadow: 0 4px 12px rgba(15,23,42,.05); }
.ucl-reaction-empty { color: #667085; font-size: 12px; font-weight: 800; }

.ucl-thread { min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px 18px 16px; overscroll-behavior: contain; margin-top: 0; }
.ucl-comment { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 9px; margin: 0 0 10px; padding-left: calc(var(--ucl-depth, 0) * 16px); }
.ucl-comment.depth-0 { padding-left: 0; }
.ucl-comment-avatar img { width: 36px; height: 36px; border-radius: 999px; object-fit: cover; border: 1px solid rgba(15,23,42,.1); background: #fff; }
.ucl-comment-main { min-width: 0; }
.ucl-comment-bubble { display: inline-block; max-width: 100%; background: #fff; color: #111827; border-radius: 18px; padding: 9px 11px; box-shadow: 0 5px 16px rgba(15,23,42,.06); border: 1px solid rgba(15,23,42,.06); }
.ucl-comment-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.ucl-comment-head a { color: #111827; font-weight: 950; text-decoration: none; font-size: 13px; }
.ucl-comment-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.ucl-comment-date { color: #64748b; font-size: 11px; font-weight: 800; white-space: nowrap; }
.ucl-comment-text { margin-top: 3px; line-height: 1.38; font-size: 14px; color: #111827; overflow-wrap: anywhere; }
.ucl-comment-delete { width: 22px; height: 22px; border-radius: 999px; border: 0; background: #f1f5f9; color: #334155; cursor: pointer; font-weight: 900;padding: 0px 0px; }
.ucl-comment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 3px 0 0 8px; min-height: 28px; }
.ucl-comment-actions .ucl-reaction-summary { font-size: 12px; }
.ucl-reply-btn { border: 0; background: transparent; color: #475467; font-weight: 900; font-size: 12px; cursor: pointer; padding: 4px 2px; }
.ucl-reply-btn:hover { color: #1877f2; }
.ucl-replies { margin-top: 8px; }

.ucl-reaction-wrap { position: relative; display: inline-flex; align-items: center; }
.ucl-like-btn { border: 0; border-radius: 999px; background: #fff; color: #344054; box-shadow: 0 4px 12px rgba(15,23,42,.07); padding: 8px 12px; font-weight: 950; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ucl-like-btn.is-active { color: #1877f2; background: #eaf3ff; }
.ucl-reaction-wrap.is-compact .ucl-like-btn { padding: 4px 6px; box-shadow: none; background: transparent; font-size: 12px; }
.ucl-reaction-wrap.is-compact .ucl-like-btn b { display: none; }
.ucl-reaction-flyout { position: absolute; left: 0; bottom: calc(100% + 8px); display: none; align-items: center; gap: 5px; padding: 7px 8px; border-radius: 999px; background: #fff; box-shadow: 0 12px 35px rgba(15,23,42,.24); border: 1px solid rgba(15,23,42,.08); z-index: 40; white-space: nowrap; }
.ucl-reaction-wrap:focus-within .ucl-reaction-flyout { display: inline-flex; }
.ucl-reaction-flyout button { border: 0; background: transparent; font-size: 23px; line-height: 1; padding: 5px; border-radius: 999px; cursor: pointer; transition: transform .12s ease; }
.ucl-reaction-flyout button:hover { transform: translateY(-4px) scale(1.16); }

.ucl-loader { display: none; padding: 8px 18px; color: #667085; font-weight: 800; font-size: 12px; text-align: center; }
.ucl-loader.is-visible { display: block; }
.ucl-empty, .ucl-error { margin: 20px auto; padding: 15px; text-align: center; border-radius: 18px; background: #fff; color: #667085; font-weight: 850; }
.ucl-error { color: #b42318; background: #fff1f3; }
.ucl-skeleton-line, .ucl-skeleton-block { border-radius: 14px; background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.18), rgba(255,255,255,.08)); animation: uclPulse 1.2s infinite linear; }
.ucl-skeleton-line { width: 180px; height: 34px; }
.ucl-skeleton-block { width: 100%; height: 90px; }
@keyframes uclPulse { from { opacity: .55; } 50% { opacity: 1; } to { opacity: .55; } }

.ucl-composer { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 9px; align-items: end; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid rgba(15,23,42,.08); }
.ucl-composer-avatar { width: 36px; height: 36px; object-fit: cover; border-radius: 999px; border: 1px solid rgba(15,23,42,.08); }
.ucl-composer textarea, .ucl-reply-form textarea { width: 100%; box-sizing: border-box; resize: none; max-height: 120px; min-height: 40px; border: 1px solid rgba(15,23,42,.1); border-radius: 18px; background: #f2f4f7; color: #111827; padding: 10px 12px; outline: none; font: inherit; }
.ucl-composer textarea:focus, .ucl-reply-form textarea:focus { border-color: #1877f2; box-shadow: 0 0 0 3px rgba(24,119,242,.13); background: #fff; }
.ucl-composer button, .ucl-reply-form button[type="submit"] { border: 0; background: #1877f2; color: #fff; font-weight: 950; border-radius: 999px; padding: 10px 14px; cursor: pointer; }
.ucl-composer button:disabled, .ucl-reply-form button:disabled { opacity: .65; cursor: wait; }
.ucl-reply-form-wrap { margin: 7px 0 8px; }
.ucl-reply-form { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 7px; align-items: end; }
.ucl-reply-form button[data-ucl-cancel-reply] { border: 0; background: transparent; color: #667085; font-weight: 900; cursor: pointer; }

@media (max-width: 760px) {
  .ucl { align-items: stretch; justify-content: stretch; }
  .ucl-shell { width: 100vw; height: 100dvh; border-radius: 0; grid-template-columns: 1fr; grid-template-rows: minmax(38dvh, 44dvh) minmax(0, 1fr); }
  .ucl-main { min-height: 0; grid-template-rows: minmax(0, 1fr) auto; }
  .ucl-media-stage { padding: 10px; }
  .ucl-media-object { border-radius: 12px; }
  .ucl-content-panel { max-height: 150px; padding: 10px 12px; }
  .ucl-content h1 { font-size: 18px; }
  .ucl-body-text { font-size: 13px; max-height: 72px; overflow: auto; }
  .ucl-side { border-left: 0; min-height: 0; grid-template-rows: auto auto minmax(0,1fr) auto auto; }
  .ucl-side-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    justify-content: stretch;
    column-gap: 8px;
    padding: 10px 8px 8px 12px;
  }
  .ucl-side-title,
  .ucl-side-head > :first-child {
    min-width: 0;
    justify-self: start;
  }
  .ucl-side-tools {
    width: auto;
    min-width: max-content;
    justify-self: end;
    justify-content: flex-end;
    gap: 6px;
    margin-left: auto;
    flex-wrap: nowrap;
  }
  .ucl-delete-post-btn { min-height: 30px; padding: 7px 10px; }
  .ucl-target-react { padding: 5px 12px; min-height: 38px; }
  .ucl-thread { padding: 10px 12px 12px; }
  .ucl-comment { grid-template-columns: 34px minmax(0,1fr); padding-left: calc(var(--ucl-depth, 0) * 9px); }
  .ucl-comment-avatar img { width: 32px; height: 32px; }
  .ucl-nav { width: 38px; height: 48px; font-size: 32px; }
  .ucl-close { top: 8px; right: 8px; background: rgba(0,0,0,.38); }
  .ucl-composer { grid-template-columns: 32px minmax(0, 1fr) auto; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .ucl-composer-avatar { width: 32px; height: 32px; }
  .ucl-composer button { padding: 9px 11px; }
}

/* Universal comments repair: sorting, viewport-safe reactions, composer avatar */
.ucl-sort-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
  padding: 0;
  border-bottom: 0;
  background: transparent;
  font-size: 12px;
  color: rgb(67 67 67 / 72%);
  min-width: 0;
}
.ucl-sort-row span { display: none; }
.ucl-sort-row button {
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(15,23,42,.05);
}
.ucl-sort-row button.is-active {
  background: #1877f2;
  color: #fff;
  border-color: #1877f2;
  box-shadow: 0 8px 20px rgba(24,119,242,.26);
}
.ucl-composer-avatar,
.ucl-comment-avatar img,
.ucl-author-avatar img {
  object-fit: cover;
  background: rgba(255,255,255,.12);
}
.ucl-reaction-wrap { position: relative; }
.ucl-reaction-flyout {
  max-width: calc(100vw - 16px);
  pointer-events: auto;
  z-index: 999999;
}
.ucl-reaction-wrap.is-flyout-visible .ucl-reaction-flyout {
  display: inline-flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}
@media (max-width: 720px) {
  .ucl-reaction-flyout {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    transform: none !important;
    justify-content: center;
    border-radius: 999px;
  }
}

/* Color-background posts inside the universal lightbox */
.ucl-bg-post-preview {
  width: min(92%, 720px);
  min-height: min(72dvh, 720px);
  border-radius: 26px;
  display: grid;
  place-items: center;
  padding: 36px;
  text-align: center;
  color: #fff;
  font-size: clamp(24px, 4vw, 54px);
  font-weight: 1000;
  line-height: 1.12;
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
  overflow: hidden;
}
.ucl-bg-post-preview > div { max-width: 100%; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .ucl-bg-post-preview { width: 94vw; min-height: 36dvh; border-radius: 18px; padding: 24px; font-size: clamp(20px, 8vw, 42px); }
}

/* Reaction button left, reaction totals right inside universal lightbox */
.ucl-target-react {
  padding: 6px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 40px;
  box-sizing: border-box;
}
.ucl-target-react > .ucl-reaction-wrap,
.ucl-comment-actions > .ucl-reaction-wrap {
  order: 1;
}
.ucl-target-react > .ucl-reaction-summary,
.ucl-comment-actions > .ucl-reaction-summary {
  order: 2;
}
.ucl-comment-actions .ucl-reaction-chip,
.ucl-target-react .ucl-reaction-chip {
  gap: 5px;
}
.ucl-comment-actions .ucl-reaction-chip span,
.ucl-target-react .ucl-reaction-chip span {
  order: 1;
}
.ucl-comment-actions .ucl-reaction-chip b,
.ucl-target-react .ucl-reaction-chip b {
  order: 2;
}


/* Universal comments extra-small mobile hardening */
@media (max-width: 560px) {
  .ucl { align-items: flex-end; }
  .ucl-shell {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 42dvh) minmax(0, 1fr);
  }
  .ucl-main {
    grid-template-rows: minmax(0,1fr) auto;
    min-height: 0;
  }
  .ucl-media-stage { padding: 10px; }
  .ucl-media-object { max-height: calc(42dvh - 24px); width: auto; }
  .ucl-nav { width: 34px; height: 44px; font-size: 28px; border-radius: 12px; }
  .ucl-prev { left: 8px; }
  .ucl-next { right: 8px; }
  .ucl-content-panel {
    max-height: 120px;
    padding: 10px 12px 12px;
  }
  .ucl-author-avatar img { width: 36px; height: 36px; }
  .ucl-open-link { padding: 7px 10px; font-size: 11px; }
  .ucl-side {
    min-height: 0;
    grid-template-rows: auto auto minmax(0,1fr) auto auto;
  }
  .ucl-side-head {
    padding: 10px 12px 6px;
    gap: 8px;
  }
  .ucl-side-head h2 { font-size: 18px; }
  .ucl-side-head p { font-size: 12px; }
  .ucl-sort-row {
    padding: 0;
    gap: 5px;
    font-size: 11px;
    justify-content: flex-end;
    white-space: nowrap;
  }
  .ucl-sort-row button {
    padding: 6px 8px;
    font-size: 11px;
  }
  .ucl-target-react {
    padding: 5px 10px;
    gap: 7px;
    flex-wrap: wrap;
    align-items: center;
  }
  .ucl-target-react .ucl-like-btn {
    padding: 7px 10px;
    font-size: 13px;
  }
  .ucl-target-react .ucl-reaction-summary {
    gap: 5px;
    min-width: 0;
  }
  .ucl-target-react .ucl-reaction-chip {
    padding: 4px 7px;
    font-size: 11px;
  }
  .ucl-thread {
    padding: 8px 10px 10px;
  }
  .ucl-comment {
    grid-template-columns: 30px minmax(0,1fr);
    gap: 8px;
    padding-left: calc(var(--ucl-depth, 0) * 7px);
    margin-bottom: 8px;
  }
  .ucl-comment-avatar img { width: 30px; height: 30px; }
  .ucl-comment-bubble {
    padding: 8px 10px;
    border-radius: 16px;
  }
  .ucl-comment-text { font-size: 13px; line-height: 1.32; }
  .ucl-comment-actions {
    gap: 6px;
    margin-left: 4px;
    min-height: 24px;
  }
  .ucl-reply-btn, .ucl-comment-actions .ucl-reaction-summary, .ucl-comment-actions .ucl-like-btn {
    font-size: 11px;
  }
  .ucl-reaction-flyout {
    left: 8px !important;
    right: 8px !important;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 6px 8px;
    gap: 2px;
  }
  .ucl-reaction-flyout button { font-size: 21px; padding: 4px; }
  .ucl-composer {
    grid-template-columns: 28px minmax(0,1fr) auto;
    gap: 7px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }
  .ucl-composer-avatar { width: 28px; height: 28px; }
  .ucl-composer textarea {
    min-height: 36px;
    max-height: 88px;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 16px;
  }
  .ucl-composer button {
    padding: 8px 10px;
    min-width: 64px;
    font-size: 13px;
    border-radius: 14px;
  }
}

@media (max-width: 400px) {
  .ucl-sort-row span { width: auto; }
  .ucl-side-head{align-items:flex-start}
  .ucl-side-tools{width:auto;min-width:max-content;justify-content:flex-end;justify-self:end}
  .ucl-sort-row button{padding:5px 7px;font-size:10px}
  .ucl-target-react .ucl-like-btn b { display: inline; }
  .ucl-target-react .ucl-reaction-summary { width: 100%; }
  .ucl-open-link { margin-left: 0; }
  .ucl-author { align-items: flex-start; flex-wrap: wrap; }
}


/* Reaction System Rebuild Phase 3: universal comment reactions on platform layer */
.ucl-target-react > .platform-reaction-root,
.ucl-comment-actions > .platform-reaction-root,
.reply-actions > .platform-reaction-root {
  order: 1;
}
.ucl-target-react > .platform-reaction-root .platform-reaction-summary,
.ucl-comment-actions > .platform-reaction-root .platform-reaction-summary,
.reply-actions > .platform-reaction-root .platform-reaction-summary {
  order: 2;
}
.ucl-target-platform-reaction {
  width: 100%;
  justify-content: space-between;
  gap: 12px;
}
.platform-comment-reaction-bar--ucl .platform-reaction-main {
  min-height: 24px;
  padding: 4px 7px;
  box-shadow: none;
}
.platform-comment-reaction-bar--ucl .platform-reaction-main-label {
  font-size: 12px;
}
.platform-comment-reaction-bar--ucl .platform-reaction-summary {
  font-size: 11px;
}
@media (max-width: 560px) {
  .ucl-target-platform-reaction {
    width: 100%;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
  }
  .ucl-target-platform-reaction .platform-reaction-main {
    padding: 7px 10px;
  }
  .ucl-target-platform-reaction .platform-reaction-summary {
    width: 100%;
  }
}


.ucl-composer-main{min-width:0;display:grid;gap:8px}
.ucl-composer-tools{display:flex;align-items:center;gap:8px;flex-wrap:nowrap}
.ucl-emoji-wrap{position:relative;display:inline-flex;flex:0 0 auto}
.ucl-composer .ucl-emoji-btn,.ucl-reply-form .ucl-emoji-btn{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;min-width:42px;padding:0!important;border:1px solid rgba(15,23,42,.08)!important;border-radius:999px!important;background:#fff!important;color:#111827!important;font-size:19px;line-height:1;box-shadow:0 4px 14px rgba(15,23,42,.06);cursor:pointer}
.ucl-composer .ucl-emoji-btn:hover,.ucl-reply-form .ucl-emoji-btn:hover,.ucl-composer .ucl-emoji-btn[aria-expanded="true"],.ucl-reply-form .ucl-emoji-btn[aria-expanded="true"]{background:#eef4ff!important;border-color:rgba(24,119,242,.22)!important;box-shadow:0 8px 22px rgba(24,119,242,.14)}
.ucl-emoji-picker{position:absolute;right:0;bottom:calc(100% + 10px);z-index:25;width:min(326px,calc(100vw - 32px));max-height:min(420px,58dvh);overflow:auto;padding:12px;border:1px solid rgba(15,23,42,.12);border-radius:18px;background:rgba(255,255,255,.98);box-shadow:0 18px 48px rgba(15,23,42,.22);backdrop-filter:blur(14px)}
.ucl-reply-form .ucl-emoji-picker{left:0;right:auto}
.ucl-emoji-picker.hidden{display:none!important}
.ucl-emoji-picker-head{position:sticky;top:-12px;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:10px;margin:-12px -12px 10px;padding:10px 10px 9px 12px;border-bottom:1px solid rgba(15,23,42,.08);background:rgba(255,255,255,.98);backdrop-filter:blur(12px);color:#111827}
.ucl-emoji-picker-head strong{font-size:13px;font-weight:950;line-height:1}
.ucl-composer .ucl-emoji-close,.ucl-reply-form .ucl-emoji-close{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;min-width:30px;padding:0!important;border:0!important;border-radius:999px!important;background:#eef2f7!important;color:#111827!important;font-size:22px;font-weight:900;line-height:1;cursor:pointer;box-shadow:none!important}
.ucl-composer .ucl-emoji-close:hover,.ucl-reply-form .ucl-emoji-close:hover,.ucl-composer .ucl-emoji-close:focus-visible,.ucl-reply-form .ucl-emoji-close:focus-visible{background:#111827!important;color:#fff!important;outline:0}
.ucl-emoji-section{display:grid;gap:6px}
.ucl-emoji-section+.ucl-emoji-section{margin-top:10px}
.ucl-emoji-title{font-size:11px;font-weight:950;letter-spacing:.04em;text-transform:uppercase;color:#667085}
.ucl-emoji-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:5px}
.ucl-composer .ucl-emoji-option,.ucl-reply-form .ucl-emoji-option{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;min-width:0;padding:0!important;border:0!important;border-radius:10px!important;background:#f8fafc!important;color:#111827!important;font-size:21px;line-height:1;box-shadow:none!important;cursor:pointer;transition:background .15s ease,transform .15s ease}
.ucl-composer .ucl-emoji-option:hover,.ucl-reply-form .ucl-emoji-option:hover{background:#e8f1ff!important;transform:translateY(-1px)}
.ucl-upload-btn{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:999px;border:1px solid rgba(15,23,42,.08);background:#fff;cursor:pointer;box-shadow:0 4px 14px rgba(15,23,42,.06);flex:0 0 42px}
.ucl-upload-btn input{display:none}
.ucl-upload-icon{font-size:18px;line-height:1}
.ucl-composer button[type="submit"],.ucl-reply-form button[type="submit"]{min-width:74px}
.ucl-upload-under{display:grid;gap:8px}
.ucl-upload-under.hidden{display:none!important}
.ucl-upload-preview{display:grid;grid-template-columns:56px minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px 12px;border-radius:16px;background:#f8fafc;border:1px solid rgba(15,23,42,.08)}
.ucl-upload-preview.hidden{display:none!important}
.ucl-upload-preview img{width:56px;height:56px;border-radius:14px;object-fit:cover;background:#e5e7eb}
.ucl-upload-meta{min-width:0;display:grid;gap:2px}
.ucl-upload-meta strong,.ucl-upload-meta span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ucl-upload-meta strong{font-size:13px;color:#111827}
.ucl-upload-meta span{font-size:12px;color:#667085}
.ucl-upload-clear{height:32px;border:0;border-radius:999px;padding:0 12px;font-weight:900;background:rgba(239,68,68,.12);color:#b91c1c;cursor:pointer}
.ucl-reuse-btn{height:40px;border:1px solid rgba(15,23,42,.09);border-radius:999px;padding:0 13px;font-weight:900;background:#fff;color:#172033;box-shadow:0 4px 14px rgba(15,23,42,.06);cursor:pointer;white-space:nowrap}
.ucl-upload-progress{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}
.ucl-upload-progress.hidden{display:none!important}
.ucl-upload-progress-bar{height:8px;border-radius:999px;background:#dbe3ef;overflow:hidden}
.ucl-upload-progress-fill{width:0;height:100%;border-radius:999px;background:linear-gradient(90deg,#1877f2,#61a5ff)}
.ucl-upload-progress-text{font-size:12px;font-weight:900;color:#475467}
.ucl-reply-form{grid-template-columns:minmax(0,1fr);gap:8px;align-items:stretch}
.ucl-reply-form .ucl-composer-tools{justify-content:flex-start}
.ucl-reply-form button[data-ucl-cancel-reply]{padding:10px 8px}
@media (max-width:980px){.ucl-composer-tools{gap:7px}.ucl-upload-btn,.ucl-composer .ucl-emoji-btn,.ucl-reply-form .ucl-emoji-btn{width:40px;height:40px;min-width:40px;flex-basis:40px}.ucl-emoji-picker{right:-48px;width:min(310px,calc(100vw - 24px));max-height:52dvh}.ucl-reply-form .ucl-emoji-picker{left:0;right:auto}.ucl-composer button[type="submit"],.ucl-reply-form button[type="submit"]{padding:9px 12px;min-width:68px}.ucl-upload-preview{grid-template-columns:48px minmax(0,1fr) auto}.ucl-upload-preview img{width:48px;height:48px}}


/* Comment-popup-only mode: no target media/content preview, only the comment system. */
.ucl.ucl-comments-only .ucl-shell {
  width: min(680px, calc(100vw - 56px)) !important;
  max-width: calc(100vw - 56px) !important;
  height: min(760px, calc(100dvh - 56px)) !important;
  max-height: calc(100dvh - 56px) !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 1fr !important;
  background: #f0f2f5;
  border-radius: 22px !important;
  border: 1px solid rgba(15,23,42,.12) !important;
}
.ucl.ucl-comments-only .ucl-main,
.ucl.ucl-comments-only .ucl-media-panel,
.ucl.ucl-comments-only .ucl-content-panel,
.ucl.ucl-comments-only .ucl-shared,
.ucl.ucl-comments-only .ucl-author,
.ucl.ucl-comments-only .ucl-content {
  display: none !important;
}
.ucl.ucl-comments-only .ucl-side {
  border-left: 0 !important;
  min-height: 0;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  justify-self: stretch;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
}
.ucl.ucl-comments-only .ucl-comments-panel {
  width: 100% !important;
  max-width: none !important;
}
.ucl.ucl-comments-only .ucl-side-head {
  padding-right: 62px;
}
.ucl.ucl-comments-only .ucl-thread {
  margin-top: 0;
  padding-top: 12px;
}
.ucl.ucl-comments-only .ucl-empty {
  margin-top: 8px;
}
.ucl.ucl-comments-only .ucl-close {
  top: 12px !important;
  right: 12px !important;
  z-index: 60;
  background: #111827;
  color: #fff;
  border-color: rgba(15,23,42,.18);
}
/* Keep target previews hidden, but keep comment image upload available. */
.ucl.ucl-comments-only .ucl-upload-btn {
  display: inline-flex !important;
}
.ucl.ucl-comments-only [data-ucl-upload-under].hidden {
  display: none !important;
}
.ucl.ucl-comments-only [data-ucl-upload-under]:not(.hidden) {
  display: grid !important;
}
.ucl.ucl-comments-only .ucl-composer {
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
}
.ucl.ucl-comments-only .ucl-composer-tools {
  justify-content: flex-end;
}
.ucl.ucl-comments-only .ucl-composer-avatar {
  align-self: center;
}
.ucl.ucl-comments-only .ucl-composer-main {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "input tools"
    "upload upload";
  align-items: center;
  gap: 8px;
}
.ucl.ucl-comments-only .ucl-composer-main > textarea {
  grid-area: input;
  min-width: 0;
}
.ucl.ucl-comments-only .ucl-composer-main > .ucl-composer-tools {
  grid-area: tools;
  align-items: center;
  justify-content: flex-end;
}
.ucl.ucl-comments-only .ucl-composer-main > .ucl-upload-under {
  grid-area: upload;
}
@media (max-width: 760px) {
  .ucl.ucl-comments-only .ucl-shell {
    width: 100vw !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: 0 !important;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }
  .ucl.ucl-comments-only .ucl-side {
    min-height: 0;
  }
  .ucl.ucl-comments-only .ucl-thread {
    padding: 12px;
  }
}


/* Restore image upload buttons inside comment/reply composers after comments-only cleanup. */
.ucl.ucl-comments-only .ucl-reply-form .ucl-upload-btn,
.ucl.ucl-comments-only .ucl-composer .ucl-upload-btn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.ucl.ucl-comments-only .ucl-reply-form [data-ucl-upload-under]:not(.hidden),
.ucl.ucl-comments-only .ucl-composer [data-ucl-upload-under]:not(.hidden) {
  display: grid !important;
}

.ucl-comment-image img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: min(420px, 100%) !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: unset !important;
  object-position: 50% 50% !important;
}
.ucl-comment-sticker,
.feed-comment-sticker,
.profile-comment-sticker,
.comment-sticker,
.reply-sticker,
.content-comment-sticker {
  margin-top: 8px;
}
.ucl-comment-sticker img,
.feed-comment-sticker img,
.profile-comment-sticker img,
.comment-sticker img,
.reply-sticker img,
.content-comment-sticker img {
  display: block;
  width: min(132px, 42vw);
  max-height: 132px;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 10px 26px rgba(15,23,42,.10);
}
.ucl-upload-preview.is-sticker img {
  object-fit: contain;
  background: #fff;
}

/* Mobile composer alignment: keep comment input controls on one usable row. */
@media (max-width: 560px) {
  .ucl.ucl-comments-only .ucl-composer,
  .ucl-composer {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }
  .ucl-composer-avatar {
    align-self: center;
    width: 28px;
    height: 28px;
  }
  .ucl-composer-main {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "input tools"
      "upload upload";
    align-items: center;
    gap: 7px;
  }
  .ucl-composer-main > textarea {
    grid-area: input;
    min-width: 0;
  }
  .ucl-composer-main > .ucl-composer-tools {
    grid-area: tools;
    justify-content: flex-end;
    gap: 6px;
  }
  .ucl-composer-main > .ucl-upload-under {
    grid-area: upload;
  }
  .ucl-composer .ucl-emoji-btn,
  .ucl-composer .ucl-upload-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    flex-basis: 36px;
  }
  .ucl-composer button[type="submit"] {
    height: 36px;
    min-width: 58px;
    padding: 0 12px;
  }
}

@media (max-width: 380px) {
  .ucl-composer .ucl-emoji-btn,
  .ucl-composer .ucl-upload-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    flex-basis: 34px;
  }
  .ucl-composer button[type="submit"] {
    min-width: 54px;
    padding: 0 10px;
  }
}


/* Mobile comments/media behavior:
   - Mobile comment button opens comments-only popup with comment images/oEmbed still available.
   - Mobile media/image click opens media-only viewer without comments.
   - Desktop keeps full media + comments behavior. */
@media (max-width: 760px) {
  .ucl.ucl-mobile-comments-only .ucl-main {
    display: none !important;
  }
  .ucl.ucl-mobile-comments-only .ucl-shell {
    grid-template-columns: 1fr !important;
  }
  .ucl.ucl-mobile-comments-only .ucl-side {
    width: 100% !important;
    max-width: none !important;
  }
  .ucl.ucl-mobile-media-only .ucl-side {
    display: none !important;
  }
  .ucl.ucl-mobile-media-only .ucl-shell {
    grid-template-columns: 1fr !important;
  }
  .ucl.ucl-mobile-media-only .ucl-main {
    width: 100% !important;
  }
  .ucl.ucl-mobile-media-only .ucl-content-panel {
    display: none !important;
  }
  .ucl.ucl-mobile-media-only .ucl-media-panel {
    min-height: 100dvh;
  }
  .uw-img-mobile-media-only [data-uw-img-comments],
  .uw-img-mobile-media-only [data-uw-img-comment-form],
  .uw-img-mobile-media-only [data-uw-img-reactions] {
    display: none !important;
  }
}

/* Composer repair after upload-library rollout. Keep comments compact and clean. */
.ucl-composer input[type="file"][hidden],
.ucl-reply-form input[type="file"][hidden] {
  display: none !important;
}
.ucl-composer,
.ucl.ucl-comments-only .ucl-composer {
  align-items: center;
  gap: 10px;
}
.ucl-composer-main {
  min-width: 0;
}
.ucl-composer-main > textarea {
  min-height: 42px;
}
.ucl-composer-tools {
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.ucl-composer .ucl-emoji-btn,
.ucl-composer .ucl-upload-btn,
.ucl-composer .ucl-sticker-btn,
.ucl-composer .ucl-giphy-btn,
.ucl-reply-form .ucl-emoji-btn,
.ucl-reply-form .ucl-upload-btn,
.ucl-reply-form .ucl-sticker-btn,
.ucl-reply-form .ucl-giphy-btn {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  flex: 0 0 40px !important;
  padding: 0 !important;
}
.ucl-sticker-btn,
.ucl-giphy-btn {
  border: 1px solid rgba(15,23,42,.08) !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #172033 !important;
  box-shadow: 0 4px 14px rgba(15,23,42,.06) !important;
  cursor: pointer;
  font-weight: 950;
  line-height: 1;
}
.ucl-sticker-btn span,
.ucl-giphy-btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: linear-gradient(135deg,#eef5ff,#f4e8ff);
  color: #2563eb;
  font-size: 11px;
}
.ucl-giphy-btn span {
  width: 28px;
  background: linear-gradient(135deg,#fff7ed,#eef5ff);
  color: #111827;
  font-size: 10px;
  letter-spacing: 0;
}
.ucl-composer button[type="submit"],
.ucl-reply-form button[type="submit"] {
  height: 40px;
  min-width: 70px;
  padding: 0 16px !important;
  border-radius: 999px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ucl.ucl-comments-only .ucl-composer-main {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "input tools"
    "upload upload";
}
.ucl-upload-preview {
  max-width: 100%;
}
.ucl-upload-preview.is-giphy img {
  object-fit: cover;
}

.ucl-image-picker.hidden {
  display: none !important;
}
.ucl-image-picker {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 18px;
}
.ucl-image-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .42);
}
.ucl-image-picker-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(560px, calc(100dvh - 42px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, .12);
  background: color-mix(in srgb, var(--card, #fff) 94%, var(--bg, #f8fafc));
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
}
.ucl-image-picker-panel header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
}
.ucl-image-picker-panel header div {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.ucl-image-picker-panel header strong {
  font-size: 16px;
  color: var(--text, #111827);
}
.ucl-image-picker-panel header span,
.ucl-image-picker-empty {
  font-size: 12px;
  color: var(--muted, #667085);
}
.ucl-image-picker-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.ucl-image-picker-actions .ucl-image-upload-new {
  width: auto;
  min-width: 104px;
  padding: 0 14px;
  font-size: 12px;
  background: linear-gradient(135deg, var(--accent, #1877f2), #7c3aed);
  color: #fff;
}
.ucl-image-picker-panel header button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 900;
  background: rgba(15, 23, 42, .08);
  color: var(--text, #111827);
  cursor: pointer;
}
.ucl-image-picker-panel header .ucl-image-upload-new {
  width: auto;
  min-width: 104px;
  padding: 0 14px;
  font-size: 12px;
  background: linear-gradient(135deg, var(--accent, #1877f2), #7c3aed);
  color: #fff;
}
.ucl-image-picker-grid {
  min-height: 180px;
  overflow: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
  align-content: start;
  align-items: start;
}
.ucl-image-picker-grid > p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 20px;
  border-radius: 18px;
  background: rgba(148, 163, 184, .12);
}
.ucl-image-picker-more {
  display: block;
  justify-self: center;
  margin: 0 0 14px;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: #111827;
  color: #fff;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
}
.ucl-image-picker-more.hidden {
  display: none !important;
}
.ucl-image-picker-more:disabled {
  opacity: .68;
  cursor: wait;
}
.ucl-image-choice-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  align-self: start;
  align-content: start;
}
.ucl-image-choice {
  display: grid;
  gap: 7px;
  min-width: 0;
  width: 100%;
  align-content: start;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 16px;
  padding: 8px;
  background: color-mix(in srgb, var(--card, #fff) 96%, var(--accent, #1877f2) 4%);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
  cursor: pointer;
  text-align: left;
}
.ucl-image-choice:hover {
  border-color: color-mix(in srgb, var(--accent, #1877f2) 40%, rgba(15, 23, 42, .08));
  transform: translateY(-1px);
}
.ucl-image-choice img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(148, 163, 184, .18);
}
.ucl-image-choice span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
  color: var(--text, #111827);
}
.ucl-image-choice small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted, #667085);
}
.ucl-image-choice-delete {
  min-height: 32px;
  height: 32px;
  align-self: start;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, #ef4444 10%, var(--card, #fff));
  color: #b42318;
  font-size: 11px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(180, 35, 24, .16);
}
.ucl-image-choice-delete:hover {
  background: color-mix(in srgb, #ef4444 18%, var(--card, #fff));
  color: #991b1b;
}
.ucl-image-choice-delete:disabled {
  opacity: .62;
  cursor: wait;
}
.ucl-giphy-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 16px 0;
}
.ucl-giphy-search input {
  min-width: 0;
  height: 42px;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 999px;
  padding: 0 14px;
  background: #f8fafc;
  color: #111827;
  font-weight: 850;
  outline: 0;
}
.ucl-giphy-search input:focus {
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.ucl-giphy-search button {
  height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: #2563eb;
  color: #fff;
  font-weight: 950;
  cursor: pointer;
}
.ucl-giphy-grid {
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
}
.ucl-giphy-choice img {
  aspect-ratio: 4 / 3;
}
.ucl-giphy-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 14px;
}
.ucl-giphy-footer .ucl-image-picker-more {
  margin: 0;
}
.ucl-giphy-footer span {
  color: #111827;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

/* Comment image picker: keep reuse/upload above the comment drawer chrome. */
.ucl-image-picker {
  position: fixed;
  inset: 0;
  z-index: 2147482400;
  display: grid;
  place-items: end center;
  padding: 16px;
  isolation: isolate;
}
.ucl-image-picker-backdrop {
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(8px);
}
.ucl-image-picker-panel {
  width: min(640px, calc(100vw - 24px));
  max-height: min(680px, calc(100dvh - 32px));
}

@media (max-width: 980px) {
  .ucl.ucl-image-picker-open .ucl-composer {
    visibility: hidden;
    pointer-events: none;
  }
  .ucl.ucl-image-picker-open .ucl-side {
    overflow: hidden;
  }
}

@media (min-width: 641px) and (max-width: 980px) {
  .ucl-image-picker {
    padding: 0;
    place-items: end stretch;
  }
  .ucl-image-picker-panel {
    width: 100dvw;
    height: min(82dvh, 720px);
    max-height: calc(100dvh - 6px);
    border-right: 0;
    border-left: 0;
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
  }
  .ucl-image-picker-panel header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: color-mix(in srgb, var(--card, #fff) 96%, var(--bg, #f8fafc));
  }
  .ucl-image-picker-grid {
    min-height: 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  }
}

@media (max-width: 640px) {
  .ucl-image-picker {
    padding: 0;
    place-items: end stretch;
  }
  .ucl-image-picker-panel {
    width: 100dvw;
    height: min(82dvh, 720px);
    max-height: calc(100dvh - 6px);
    border-right: 0;
    border-left: 0;
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
  }
  .ucl-image-picker-panel header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
    background: color-mix(in srgb, var(--card, #fff) 96%, var(--bg, #f8fafc));
  }
  .ucl-image-picker-actions {
    gap: 7px;
  }
  .ucl-image-picker-actions .ucl-image-upload-new,
  .ucl-image-picker-panel header .ucl-image-upload-new {
    min-width: 98px;
    height: 38px;
    padding: 0 12px;
  }
  .ucl-image-picker-panel header button:not(.ucl-image-upload-new) {
    width: 38px;
    height: 38px;
  }
  .ucl-image-picker-grid {
    min-height: 0;
    padding: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-content: start;
    align-items: start;
  }
  .ucl-giphy-search {
    padding: 10px 10px 0;
    gap: 7px;
  }
  .ucl-giphy-search input,
  .ucl-giphy-search button {
    height: 38px;
  }
  .ucl-giphy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ucl-giphy-footer {
    padding: 0 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .ucl-image-choice {
    padding: 6px;
    border-radius: 13px;
    gap: 5px;
    min-height: 0;
  }
  .ucl-image-choice-card {
    gap: 5px;
    height: auto;
    min-height: 0;
  }
  .ucl-image-choice img {
    border-radius: 10px;
  }
  .ucl-image-choice span {
    font-size: 11px;
  }
  .ucl-image-choice small {
    display: none;
  }
  .ucl-image-choice-delete {
    height: 30px;
    min-height: 30px;
    padding: 0 10px;
    font-size: 10px;
  }
}

@media (max-width: 360px) {
  .ucl-image-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

html[data-theme] .ucl-reuse-btn,
html[data-theme] .ucl-upload-preview,
html[data-theme] .ucl-giphy-search input {
  background: color-mix(in srgb, var(--card) 92%, var(--bg)) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}
html[data-theme] .ucl-upload-meta strong,
html[data-theme] .ucl-upload-meta span,
html[data-theme] .ucl-image-picker-panel header strong,
html[data-theme] .ucl-image-choice span,
html[data-theme] .ucl-giphy-footer span {
  color: var(--text) !important;
}
html[data-theme] .ucl-image-picker-panel header span,
html[data-theme] .ucl-image-picker-empty {
  color: var(--muted) !important;
}

/* Mobile comment composer: give the text box its own row. */
@media (max-width: 560px) {
  .ucl-composer,
  .ucl.ucl-comments-only .ucl-composer {
    position: relative;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom)) !important;
  }

  .ucl-composer-avatar,
  .ucl.ucl-comments-only .ucl-composer-avatar {
    position: absolute;
    left: 8px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: 28px !important;
    height: 28px !important;
    z-index: 1;
  }

  .ucl-composer-main,
  .ucl.ucl-comments-only .ucl-composer-main {
    width: 100%;
    min-width: 0;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "input"
      "tools"
      "upload" !important;
    gap: 7px !important;
  }

  .ucl-composer-main > textarea,
  .ucl.ucl-comments-only .ucl-composer-main > textarea {
    grid-area: input !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .ucl-composer-main > .ucl-composer-tools,
  .ucl.ucl-comments-only .ucl-composer-main > .ucl-composer-tools {
    grid-area: tools !important;
    min-height: 36px;
    justify-content: flex-end !important;
    padding-left: 36px;
  }

  .ucl-composer-main > .ucl-upload-under,
  .ucl.ucl-comments-only .ucl-composer-main > .ucl-upload-under {
    grid-area: upload !important;
  }
}

/* Mobile image lightbox: media-only state must occupy the entire phone viewport. */
@media (max-width: 760px) {
  .ucl.ucl-mobile-media-only,
  .ucl.ucl-image-mode.ucl-mobile-media-only {
    align-items: stretch !important;
    justify-content: stretch !important;
  }

  .ucl.ucl-mobile-media-only .ucl-shell,
  .ucl.ucl-image-mode.ucl-mobile-media-only .ucl-shell {
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border: 0 !important;
    border-radius: 0 !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
    background: #000 !important;
  }

  .ucl.ucl-mobile-media-only .ucl-main,
  .ucl.ucl-image-mode.ucl-mobile-media-only .ucl-main {
    display: grid !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    grid-template-rows: 1fr !important;
    background: #000 !important;
  }

  .ucl.ucl-mobile-media-only .ucl-media-panel,
  .ucl.ucl-image-mode.ucl-mobile-media-only .ucl-media-panel,
  .ucl.ucl-mobile-media-only .ucl-media-stage,
  .ucl.ucl-image-mode.ucl-mobile-media-only .ucl-media-stage {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #000 !important;
  }

  .ucl.ucl-mobile-media-only .ucl-media-stage,
  .ucl.ucl-image-mode.ucl-mobile-media-only .ucl-media-stage {
    padding: 0 !important;
  }

  .ucl.ucl-mobile-media-only .ucl-media-object,
  .ucl.ucl-image-mode.ucl-mobile-media-only .ucl-media-object {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .ucl.ucl-mobile-media-only .ucl-side,
  .ucl.ucl-mobile-media-only .ucl-content-panel,
  .ucl.ucl-mobile-media-only .ucl-target-react,
  .ucl.ucl-mobile-media-only .ucl-composer {
    display: none !important;
  }

  .ucl.ucl-mobile-media-only .ucl-close {
    top: calc(12px + env(safe-area-inset-top, 0px)) !important;
    right: 12px !important;
    background: rgba(15, 23, 42, .72) !important;
    color: #fff !important;
  }

  .ucl.ucl-mobile-media-only .ucl-media-counter {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .ucl.ucl-mobile-media-only .ucl-nav {
    background: rgba(15, 23, 42, .54) !important;
    color: #fff !important;
  }
}

/* Mobile lightbox edge lock: prevent desktop shell gutters on phone viewports. */
@media (max-width: 760px) {
  html.ucl-open,
  html.ucl-open body {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 100% !important;
    overscroll-behavior: none !important;
  }

  #universal-comment-lightbox.ucl {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    width: 100dvw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    overflow: hidden !important;
  }

  #universal-comment-lightbox.ucl .ucl-backdrop {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    width: 100dvw !important;
    height: 100vh !important;
    height: 100dvh !important;
  }

  #universal-comment-lightbox.ucl .ucl-shell {
    position: absolute !important;
    inset: 0 !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
    transform: none !important;
  }

  #universal-comment-lightbox.ucl .ucl-main,
  #universal-comment-lightbox.ucl .ucl-side,
  #universal-comment-lightbox.ucl .ucl-media-panel,
  #universal-comment-lightbox.ucl .ucl-media-stage {
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }
}

/* Mobile image lightbox action rail. */
.ucl-mobile-actionbar {
  display: none;
}

@media (max-width: 760px) {
  #universal-comment-lightbox.ucl.ucl-mobile-media-only {
    background: #000 !important;
  }

  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-backdrop {
    background: #000 !important;
    backdrop-filter: none !important;
  }

  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-shell {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    width: 100dvw !important;
    min-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
  }

  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-main,
  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-media-panel,
  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-media-stage {
    width: 100vw !important;
    width: 100dvw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-width: 100vw !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #000 !important;
    overflow: hidden !important;
  }

  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-main {
    display: block !important;
  }

  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-media-object {
    width: 100vw !important;
    width: 100dvw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-width: 100dvw !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    object-fit: contain !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
  }

  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-side,
  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-content-panel,
  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-target-react,
  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-composer {
    display: none !important;
  }

  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-close {
    top: calc(10px + env(safe-area-inset-top, 0px)) !important;
    right: calc(10px + env(safe-area-inset-right, 0px)) !important;
    width: 42px !important;
    height: 42px !important;
    border: 1px solid rgba(255, 255, 255, .16) !important;
    background: rgba(15, 23, 42, .74) !important;
    color: #fff !important;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .32) !important;
    backdrop-filter: blur(14px) !important;
  }

  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-nav {
    width: 42px !important;
    height: 54px !important;
    border-radius: 18px !important;
    background: rgba(15, 23, 42, .46) !important;
    color: #fff !important;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .28) !important;
    backdrop-filter: blur(14px) !important;
  }

  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-prev {
    left: calc(10px + env(safe-area-inset-left, 0px)) !important;
  }

  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-next {
    right: calc(10px + env(safe-area-inset-right, 0px)) !important;
  }

  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-media-counter {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
    background: rgba(15, 23, 42, .62) !important;
    border: 1px solid rgba(255, 255, 255, .12) !important;
    color: #fff !important;
    backdrop-filter: blur(14px) !important;
  }

  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-mobile-actionbar {
    position: absolute;
    z-index: 8;
    left: calc(10px + env(safe-area-inset-left, 0px));
    right: calc(10px + env(safe-area-inset-right, 0px));
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 58px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 26px;
    background: rgba(15, 23, 42, .64);
    color: #fff;
    box-shadow: 0 18px 54px rgba(0, 0, 0, .42);
    backdrop-filter: blur(20px);
    box-sizing: border-box;
  }

  .ucl-mobile-reactions {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
  }

  .ucl-mobile-action-btn {
    flex: 0 0 auto;
    min-width: 52px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 18px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 950;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  }

  .ucl-mobile-action-btn:active {
    transform: translateY(1px);
  }

  .ucl-mobile-action-btn svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .ucl-mobile-action-btn b {
    min-width: 10px;
    font-size: 13px;
    line-height: 1;
  }

  .ucl-mobile-share-btn.is-active {
    background: linear-gradient(135deg, #1877f2, #8b5cf6);
    border-color: rgba(255, 255, 255, .24);
  }

  .ucl-mobile-share-btn[hidden] {
    display: none !important;
  }

  .ucl-mobile-reactions .platform-reaction-root {
    width: auto !important;
    max-width: 100%;
    min-width: 0;
    gap: 6px !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
  }

  .ucl-mobile-reactions .platform-reaction-main {
    min-height: 44px !important;
    padding: 8px 11px !important;
    border: 1px solid rgba(255, 255, 255, .14) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, .12) !important;
    color: #fff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08) !important;
  }

  .ucl-mobile-reactions .platform-reaction-root.has-reaction .platform-reaction-main {
    background: linear-gradient(135deg, rgba(24, 119, 242, .95), rgba(139, 92, 246, .95)) !important;
    color: #fff !important;
  }

  .ucl-mobile-reactions .platform-reaction-main-icon {
    font-size: 18px !important;
  }

  .ucl-mobile-reactions .platform-reaction-main-label,
  .ucl-mobile-reactions .platform-reaction-summary {
    display: none !important;
  }
}

@media (max-width: 380px) {
  #universal-comment-lightbox.ucl.ucl-mobile-media-only .ucl-mobile-actionbar {
    left: calc(7px + env(safe-area-inset-left, 0px));
    right: calc(7px + env(safe-area-inset-right, 0px));
    bottom: calc(7px + env(safe-area-inset-bottom, 0px));
    gap: 6px;
    padding: 6px;
  }

  .ucl-mobile-action-btn {
    min-width: 46px;
    height: 42px;
    padding: 0 10px;
  }

  .ucl-mobile-reactions .platform-reaction-main {
    min-height: 42px !important;
    padding: 7px 10px !important;
  }
}
