l
/* css/overlays.css - v2 Overlays, Dialogs, Composer, Lightbox & Popovers (owner: overlays worker) */

/* =====================================================================
   1. BACKDROP & SHEET / DIALOG CONTAINERS
   ===================================================================== */
@keyframes ovFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes ovSheetUp {
  from {
    opacity: 0;
    transform: translate3d(0, 100%, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes ovPopIn {
  from {
    opacity: 0;
    transform: scale(.96) translateY(6px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes ovPushIn {
  from {
    opacity: .6;
    transform: translate3d(28px, 0, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.ov-backdrop:not(.hidden),
#frameActionModal:not(.hidden),
#siteThemeModal:not(.hidden),
#checkoutModal:not(.hidden),
#expressionModal:not(.hidden) {
  background: rgba(8, 11, 20, .52) !important;
  backdrop-filter: blur(8px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(8px) saturate(140%) !important;
  animation: ovFadeIn 180ms ease-out forwards;
}

/* Desktop defaults (>=768px and not mobile-sim): Centered dialogs */
@media (min-width: 768px) {

  body:not(.mobile-sim) #frameActionModal,
  body:not(.mobile-sim) #siteThemeModal,
  body:not(.mobile-sim) #checkoutModal,
  body:not(.mobile-sim) #expressionModal {
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
  }

  body:not(.mobile-sim) #frameActionBody,
  body:not(.mobile-sim) #siteThemeBody {
    max-width: 480px !important;
    width: 100% !important;
    border-radius: 24px !important;
    max-height: min(86vh, 700px) !important;
    animation: ovPopIn 220ms var(--ds-ease) forwards !important;
  }

  body:not(.mobile-sim) #frameActionBody.vp-fullpage {
    max-width: 600px !important;
    max-height: min(86vh, 740px) !important;
  }

  body:not(.mobile-sim) #checkoutBody {
    max-width: 440px !important;
    width: 100% !important;
    border-radius: 24px !important;
    max-height: min(86vh, 680px) !important;
    animation: ovPopIn 220ms var(--ds-ease) forwards !important;
  }

  body:not(.mobile-sim) #expressionBody {
    max-width: 520px !important;
    width: 100% !important;
    height: min(560px, 84vh) !important;
    border-radius: 24px !important;
    animation: ovPopIn 220ms var(--ds-ease) forwards !important;
  }

  body:not(.mobile-sim) .ov-grabber-wrap {
    display: none !important;
  }
}

/* Mobile (<768px and mobile-sim): Stylish centered floating modals in the middle; full-screen for fullpage */
@media (max-width: 767px) {

  #frameActionModal:not(.vp-fullpage-wrap),
  #siteThemeModal,
  #expressionModal {
    top: var(--vvt, 0px) !important;
    bottom: auto !important;
    height: var(--vvh, 100dvh) !important;
    max-height: var(--vvh, 100dvh) !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
  }

  #frameActionModal:not(.vp-fullpage-wrap) #frameActionBody,
  #siteThemeBody {
    max-width: 460px !important;
    width: 100% !important;
    border-radius: 24px !important;
    border: 1px solid var(--card-border) !important;
    max-height: min(84dvh, calc(var(--vvh, 100dvh) - 32px)) !important;
    padding-bottom: 0 !important;
    box-shadow: 0 24px 64px -12px rgba(8, 11, 20, .42), 0 0 0 1px rgba(255, 255, 255, .06) !important;
    animation: ovPopIn 220ms var(--ds-ease) forwards !important;
  }

  #frameActionModal:not(.vp-fullpage-wrap) #frameActionBody.vp-flex-shell {
    padding-bottom: 0 !important;
  }

  #expressionModal #expressionBody {
    max-width: 460px !important;
    width: 100% !important;
    height: min(74dvh, 540px) !important;
    max-height: calc(var(--vvh, 100dvh) - 32px) !important;
    border-radius: 24px !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 24px 64px -12px rgba(8, 11, 20, .42) !important;
    animation: ovPopIn 220ms var(--ds-ease) forwards !important;
  }

  #frameActionModal.vp-fullpage-wrap {
    align-items: stretch !important;
    justify-content: stretch !important;
    padding: 0 !important;
  }

  #frameActionModal.vp-fullpage-wrap #frameActionBody.vp-fullpage {
    max-width: 100% !important;
    width: 100% !important;
    height: var(--vvh, 100dvh) !important;
    max-height: var(--vvh, 100dvh) !important;
    border-radius: 0 !important;
    border: 0 !important;
    animation: ovSheetUp 240ms var(--ds-ease) forwards !important;
  }

  #frameActionModal.vp-fullpage-wrap #frameActionBody.sx-anim-push {
    animation: ovPushIn 220ms var(--ds-ease) forwards !important;
  }

  /* Checkout: centered dialog on mobile too */
  #checkoutModal {
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
  }

  #checkoutModal #checkoutBody {
    max-width: 420px !important;
    width: 100% !important;
    border-radius: 24px !important;
    max-height: calc(var(--vvh, 100dvh) - 32px) !important;
    animation: ovPopIn 220ms var(--ds-ease) forwards !important;
  }
}

/* Mobile-sim parity inside #appViewport (centered modals) */
body.mobile-sim #frameActionModal:not(.vp-fullpage-wrap),
body.mobile-sim #siteThemeModal,
body.mobile-sim #expressionModal {
  inset: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 14px !important;
}

body.mobile-sim #frameActionModal:not(.vp-fullpage-wrap) #frameActionBody,
body.mobile-sim #siteThemeBody {
  max-width: 100% !important;
  width: 100% !important;
  border-radius: 24px !important;
  border: 1px solid var(--card-border) !important;
  max-height: calc(100% - 36px) !important;
  padding-bottom: 0 !important;
  box-shadow: 0 24px 64px -12px rgba(8, 11, 20, .42) !important;
  animation: ovPopIn 220ms var(--ds-ease) forwards !important;
}

body.mobile-sim #frameActionModal:not(.vp-fullpage-wrap) #frameActionBody.vp-flex-shell {
  padding-bottom: 0 !important;
}

body.mobile-sim #expressionModal #expressionBody {
  max-width: 100% !important;
  width: 100% !important;
  height: min(74%, 520px) !important;
  max-height: calc(100% - 36px) !important;
  border-radius: 24px !important;
  border: 1px solid var(--card-border) !important;
  animation: ovPopIn 220ms var(--ds-ease) forwards !important;
}

body.mobile-sim #frameActionModal.vp-fullpage-wrap {
  inset: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  padding: 0 !important;
}

body.mobile-sim #frameActionModal.vp-fullpage-wrap #frameActionBody.vp-fullpage {
  max-width: 100% !important;
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  border: 0 !important;
  animation: ovSheetUp 240ms var(--ds-ease) forwards !important;
}

body.mobile-sim #checkoutModal {
  inset: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
}

body.mobile-sim #checkoutModal #checkoutBody {
  max-width: 100% !important;
  width: 100% !important;
  border-radius: 24px !important;
  max-height: calc(100% - 36px) !important;
  animation: ovPopIn 220ms var(--ds-ease) forwards !important;
}

.vp-sheet.ov-dragging {
  animation: none !important;
  transition: none !important;
}

.ov-grabber-wrap {
  display: none !important;
}

.ov-grabber {
  width: 36px;
  height: 4px;
  border-radius: 9999px;
  background: var(--card-border);
}

.vp-sheet {
  background: var(--background) !important;
  border: 1px solid var(--card-border) !important;
  box-shadow: var(--ds-shadow-pop) !important;
  color: var(--foreground);
}

/* Shared sheet bar & header */
.ov-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--ds-glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  flex-shrink: 0;
}

.ov-bar-title {
  flex: 1;
  min-width: 0;
  font-family: var(--ds-font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

.ov-bar-sub {
  font-size: 12.5px;
  color: var(--muted-foreground);
  margin-top: 1px;
}

.ov-dock {
  flex-shrink: 0;
  padding: 12px 16px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--background);
}

/* =====================================================================
   2. THREADS-GRADE COMPOSER (#composerModal)
   ===================================================================== */
.cmp-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 11, 20, .54);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  animation: ovFadeIn 180ms ease-out forwards;
}

.cmp-sheet {
  width: 100%;
  max-width: 600px;
  max-height: min(86vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--ds-shadow-pop);
  overflow: hidden;
  animation: ovPopIn 220ms var(--ds-ease) forwards;
}

@keyframes cmpSheetUp {
  from {
    opacity: 0;
    transform: translate3d(0, 100%, 0);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 767px) {
  .cmp-wrap {
    padding: 0;
    align-items: stretch;
    background: var(--background);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    top: var(--vvt, 0px) !important;
    bottom: auto !important;
    height: var(--vvh, 100dvh) !important;
    max-height: var(--vvh, 100dvh) !important;
  }

  .cmp-sheet {
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    animation: cmpSheetUp 280ms var(--ds-ease) forwards;
  }

  body:not(.mobile-sim) .cmp-panel {
    padding-bottom: 0;
  }

  body.kb-open:not(.mobile-sim) .cmp-panel {
    padding-bottom: 0;
  }

  /* Keep .cmp-dock in normal flex flow inside .cmp-sheet (which already fills --vvh above the keyboard)
     so Android/iOS keyboard resize NEVER double-offsets the bottom toolbar up to the top of the modal. */
  body:not(.mobile-sim) .cmp-dock {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    flex-shrink: 0;
    z-index: 4;
  }

  body.kb-open:not(.mobile-sim) .cmp-dock {
    padding-bottom: 8px !important;
  }

  body:not(.mobile-sim) .cmp-tray {
    height: min(var(--kbh, 276px), calc(var(--vvh, 100dvh) - 170px));
    max-height: calc(var(--vvh, 100dvh) - 160px);
  }

  body:not(.mobile-sim) .cmp-pill-select select,
  body:not(.mobile-sim) .cmp-mini-select {
    font-size: 14px;
  }
}

body.mobile-sim .cmp-wrap {
  padding: 0;
  align-items: stretch;
  background: var(--background);
  backdrop-filter: none;
}

body.mobile-sim .cmp-sheet {
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  animation: cmpSheetUp 280ms var(--ds-ease) forwards;
}

body.mobile-sim .cmp-tray {
  height: 268px;
  max-height: 268px;
}

body.mobile-sim .cmp-pill-select select,
body.mobile-sim .cmp-mini-select {
  font-size: 14px;
}

.cmp-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 54px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--ds-glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}

.cmp-head-link {
  justify-self: start;
  padding: 6px 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--foreground);
  transition: opacity 150ms ease;
}

.cmp-head-link:hover {
  opacity: .7;
}

.cmp-head-title {
  justify-self: center;
  font-family: var(--ds-font-display);
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

.cmp-head-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cmp-drafts-btn {
  width: 34px;
  height: 34px;
  color: var(--muted-foreground);
}

.cmp-drafts-btn.is-active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.cmp-badge {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cmp-post-btn {
  min-width: 68px;
  height: 32px;
  font-size: 13.5px;
}

.cmp-tabs {
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cmp-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cmp-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: none;
}

.cmp-scroll::-webkit-scrollbar {
  display: none;
}

.cmp-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.cmp-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 40px;
}

.cmp-rail-line {
  width: 2px;
  flex: 1;
  min-height: 24px;
  margin-top: 8px;
  border-radius: 9999px;
  background: var(--border);
}

.cmp-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cmp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cmp-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--ds-font-display);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--foreground);
}

.cmp-sched-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px 2px 9px;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--primary) 13%, transparent);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  max-width: 100%;
}

.cmp-sched-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 2px 4px 2px 0;
  color: inherit;
  font: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmp-sched-pill-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.cmp-sched-pill-x {
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  color: inherit;
  opacity: .8;
  transition: background-color 120ms ease, opacity 120ms ease;
}

.cmp-sched-pill-x:hover {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  opacity: 1;
}

.cmp-text {
  width: 100%;
  min-height: 88px;
  border: 0;
  background: transparent;
  padding: 0;
  resize: none;
  font-size: 16px;
  line-height: 1.48;
  color: var(--foreground);
}

.cmp-text:focus {
  outline: none;
}

.cmp-text::placeholder {
  color: var(--muted-foreground);
}

.cmp-quote {
  border-radius: var(--ds-radius-m);
  font-size: 13.5px;
}

.cmp-media:empty {
  display: none;
}

.cmp-media-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.cmp-media-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.cmp-media-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.cmp-media-strip::-webkit-scrollbar {
  display: none;
}

.cmp-media-thumb {
  position: relative;
  width: 92px;
  height: 92px;
  flex: 0 0 92px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: var(--content);
  scroll-snap-align: start;
  cursor: grab;
  transition: transform 140ms ease, border-color 140ms ease;
}

.cmp-media-thumb.is-drag-over {
  border-color: var(--primary);
  transform: scale(1.03);
}

.cmp-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cmp-media-idx {
  position: absolute;
  left: 5px;
  bottom: 5px;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cmp-media-rm {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, .74);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: background-color 120ms ease, transform 120ms ease;
}

.cmp-media-rm:hover {
  background: rgba(0, 0, 0, .92);
  transform: scale(1.06);
}

.cmp-media-add-tile {
  width: 92px;
  height: 92px;
  flex: 0 0 92px;
  border-radius: 14px;
  border: 1.5px dashed var(--card-border);
  background: var(--card);
  color: var(--muted-foreground);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  transition: border-color 140ms ease, color 140ms ease, background-color 140ms ease;
}

.cmp-media-add-tile:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}

.cmp-media-add-tile svg {
  width: 20px;
  height: 20px;
}

.cmp-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cmp-layout-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
}

.cmp-card {
  padding: 14px;
  border-radius: var(--ds-radius-l);
  border: 1px solid var(--card-border);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cmp-card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--foreground);
}

.cmp-card-title svg {
  width: 17px;
  height: 17px;
  color: var(--primary);
}

.cmp-poll-q,
.cmp-poll-opt {
  width: 100%;
  border-radius: var(--ds-radius-s);
  border: 1px solid var(--card-border);
  background: var(--background);
  padding: 10px 12px;
  font-size: 16px;
  color: var(--foreground);
  transition: border-color 150ms ease;
}

.cmp-poll-q {
  font-weight: 600;
}

.cmp-poll-q:focus,
.cmp-poll-opt:focus {
  outline: none;
  border-color: var(--primary);
}

.cmp-poll-opts {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cmp-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 2px;
}

.cmp-card-foot-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cmp-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--link);
  padding: 4px 2px;
}

.cmp-text-btn svg {
  width: 14px;
  height: 14px;
}

.cmp-text-btn.is-danger {
  color: var(--error);
}

.cmp-mini-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-radius: 9999px;
  border: 1px solid var(--card-border);
  background: var(--background);
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--foreground);
  cursor: pointer;
  outline: none;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.cmp-mini-select:hover {
  background: var(--ds-hover);
}

.cmp-mini-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}

.cmp-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cmp-dt {
  padding: 9px 12px;
  font-size: 13.5px;
}

.cmp-topics:empty {
  display: none;
}

.cmp-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cmp-settings {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.cmp-pill-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px 0 12px;
  border-radius: 9999px;
  border: 1px solid var(--card-border);
  background: var(--content);
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.cmp-pill-select:hover {
  color: var(--foreground);
  background: var(--ds-press);
  border-color: color-mix(in srgb, var(--foreground) 18%, var(--card-border));
}

.cmp-pill-select:focus-within {
  color: var(--foreground);
  background: var(--background);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}

.cmp-pill-select svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  pointer-events: none;
}

.cmp-pill-select select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  color: var(--foreground);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  padding: 0 20px 0 0 !important;
  margin: 0 !important;
  min-width: 0;
}

.cmp-pill-select select::-ms-expand {
  display: none;
}

.cmp-pill-select select:focus,
.cmp-pill-select select:focus-visible {
  outline: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

.cmp-pill-select .cmp-pill-chev {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--muted-foreground);
  pointer-events: none;
}

.cmp-pill-select option {
  background: var(--background);
  color: var(--foreground);
  font-weight: 500;
}

.cmp-rule-hint {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px 6px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--card-border));
  background: color-mix(in srgb, var(--primary) 9%, var(--card));
  color: var(--foreground);
  font-size: 12.5px;
  font-weight: 600;
  animation: ovFadeIn 140ms ease-out;
}

.cmp-rule-hint svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
}

.cmp-tray {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 10px 14px 10px;
  height: 276px;
  max-height: 276px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  animation: ovFadeIn 150ms ease-out;
}

.cmp-tray>* {
  flex-shrink: 0;
}

.cmp-tray-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cmp-tray-search input {
  height: 38px;
  font-size: 16px;
}

.cmp-tray-grid-scroll {
  flex: 1 1 auto !important;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.cmp-tray-grid-scroll::-webkit-scrollbar {
  display: none;
}

.cmp-gif-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
  grid-auto-rows: max-content;
  width: 100%;
}

.cmp-gif-tile {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0b0f1a;
  text-align: left;
  transition: border-color 140ms ease, transform 110ms ease;
}

.cmp-gif-tile:hover {
  border-color: var(--primary);
}

.cmp-gif-tile:active {
  transform: scale(.97);
}

.cmp-gif-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cmp-gif-badge {
  position: absolute;
  bottom: 5px;
  left: 6px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, .74);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.cmp-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  align-content: start;
  grid-auto-rows: max-content;
  width: 100%;
}

@media (min-width: 600px) {
  body:not(.mobile-sim) .cmp-emoji-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }
}

.cmp-emoji-btn {
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  transition: background-color 120ms ease, transform 110ms ease;
}

.cmp-emoji-btn:hover {
  background: var(--ds-hover);
  transform: scale(1.14);
}

.cmp-emoji-btn:active {
  transform: scale(.92);
}

.cmp-img-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
  grid-auto-rows: max-content;
  width: 100%;
}

@media (min-width: 600px) {
  body:not(.mobile-sim) .cmp-img-picker-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.cmp-img-pick-tile {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: var(--content);
  transition: border-color 140ms ease, transform 110ms ease;
}

.cmp-img-pick-tile:hover {
  border-color: var(--primary);
}

.cmp-img-pick-tile:active {
  transform: scale(.96);
}

.cmp-img-pick-tile:disabled {
  opacity: .45;
  pointer-events: none;
}

.cmp-img-pick-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cmp-dock {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--background);
}

.cmp-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.cmp-tool-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
}

.cmp-tool {
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  transition: background-color 140ms ease, color 140ms ease, transform 120ms ease, opacity 140ms ease;
}

.cmp-tool:hover:not(:disabled) {
  background: var(--ds-hover);
  color: var(--foreground);
}

.cmp-tool:active:not(:disabled) {
  transform: scale(.92);
}

.cmp-tool.is-active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 13%, transparent);
}

.cmp-tool.is-disabled,
.cmp-tool:disabled {
  opacity: .34;
  cursor: not-allowed;
  pointer-events: none;
}

.cmp-tool svg {
  width: 21px;
  height: 21px;
}

/* Schedule Sheet / Dialog */
.cmp-sched-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cmp-sched-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: var(--ds-radius-m);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--card-border));
  background: color-mix(in srgb, var(--primary) 8%, var(--card));
}

.cmp-sched-summary svg {
  width: 17px;
  height: 17px;
  color: var(--primary);
  flex-shrink: 0;
}

.cmp-sched-summary.is-invalid {
  border-color: var(--error);
  background: color-mix(in srgb, var(--error) 8%, var(--card));
}

.cmp-sched-summary.is-invalid svg {
  color: var(--error);
}

.cmp-sched-sum-title {
  font-family: var(--ds-font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--foreground);
}

.cmp-sched-tz {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.cmp-sched-quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.cmp-sched-quick-btn {
  padding: 7px 10px;
  border-radius: var(--ds-radius-m);
  border: 1px solid var(--card-border);
  background: var(--background);
  text-align: left;
  transition: border-color 140ms ease, background-color 140ms ease, transform 110ms ease;
}

.cmp-sched-quick-btn:hover {
  background: var(--ds-hover);
}

.cmp-sched-quick-btn:active {
  transform: scale(.98);
}

.cmp-sched-quick-btn.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, var(--background));
}

.cmp-sched-quick-lbl {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--foreground);
}

.cmp-sched-quick-sub {
  font-size: 11px;
  color: var(--muted-foreground);
  margin-top: 1px;
}

.cmp-cal {
  border: 1px solid var(--card-border);
  border-radius: var(--ds-radius-l);
  background: var(--background);
  padding: 10px 12px;
}

.cmp-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cmp-cal-month {
  font-family: var(--ds-font-display);
  font-size: 14.5px;
  font-weight: 800;
  color: var(--foreground);
}

.cmp-cal-dow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted-foreground);
  margin-bottom: 4px;
}

.cmp-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.cmp-cal-day {
  height: 31px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  transition: background-color 120ms ease, color 120ms ease, transform 100ms ease;
}

.cmp-cal-day:hover:not(:disabled) {
  background: var(--ds-hover);
}

.cmp-cal-day:active:not(:disabled) {
  transform: scale(.92);
}

.cmp-cal-day.is-today {
  box-shadow: inset 0 0 0 1.5px var(--primary);
  color: var(--primary);
  font-weight: 800;
}

.cmp-cal-day.is-selected {
  background: var(--primary) !important;
  color: var(--primary-foreground) !important;
  font-weight: 800;
  box-shadow: none;
}

.cmp-cal-day.is-past,
.cmp-cal-day:disabled {
  opacity: .28;
  cursor: not-allowed;
  pointer-events: none;
}

.cmp-time-box {
  border: 1px solid var(--card-border);
  border-radius: var(--ds-radius-l);
  background: var(--background);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cmp-time-wheels {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cmp-wheel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 52px;
  border-radius: 12px;
  background: var(--content);
  padding: 2px;
}

.cmp-wheel-step {
  width: 100%;
  height: 20px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  transition: background-color 120ms ease, color 120ms ease;
}

.cmp-wheel-step:hover {
  background: var(--ds-hover);
  color: var(--foreground);
}

.cmp-wheel-step svg {
  width: 13px;
  height: 13px;
}

.cmp-wheel-val {
  font-family: var(--ds-font-display);
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  padding: 1px 0;
  color: var(--foreground);
}

.cmp-wheel-colon {
  font-family: var(--ds-font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--muted-foreground);
}

/* Edit Post & Disabled Menu Item */
.pop-menu-item.is-disabled,
.pop-menu-item:disabled {
  opacity: .44;
  cursor: not-allowed;
  pointer-events: none;
}

.pop-menu-sub {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted-foreground);
}

#editPostTa,
#editPostReason,
#editRepTa,
#editRepReason,
#editDmTa {
  font-size: 16px;
}

.cmp-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cmp-counter svg {
  width: 24px;
  height: 24px;
  transform: rotate(-90deg);
}

.cmp-counter span {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 14px;
}

.cmp-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* =====================================================================
   3. IMMERSIVE MEDIA VIEWER & PER-IMAGE PAGE (#lightbox)
   ===================================================================== */
.lb-root {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  touch-action: none;
  overflow: hidden;
}

.lb-bg {
  position: absolute;
  inset: 0;
  background: #000;
  transition: opacity 180ms ease;
}

.lb-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 14px 22px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .38) 65%, transparent 100%);
  transition: opacity 200ms ease, transform 200ms var(--ds-ease);
}

.lb-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.lb-author {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
  text-align: left;
}

.lb-author-av {
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, .22);
}

.lb-author-meta {
  min-width: 0;
  flex: 1;
  line-height: 1.2;
}

.lb-author-name {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-family: var(--ds-font-display);
  font-size: 14px;
  font-weight: 700;
}

.lb-author-sub {
  color: rgba(255, 255, 255, .74);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-view-post {
  height: 32px;
  padding: 0 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 140ms ease, transform 120ms ease;
}

.lb-view-post:hover {
  background: rgba(255, 255, 255, .26);
}

.lb-view-post:active {
  transform: scale(.95);
}

@media (max-width: 767px) {
  .lb-top .lb-view-post {
    display: none;
  }
}

body.mobile-sim .lb-top .lb-view-post {
  display: none;
}

.lb-btn {
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 150ms ease, transform 120ms ease;
}

.lb-btn:hover {
  background: rgba(255, 255, 255, .25);
}

.lb-btn:active {
  transform: scale(.92);
}

.lb-btn svg {
  width: 19px;
  height: 19px;
}

.lb-counter {
  padding: 5px 11px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lb-stage {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
}

.lb-drag-wrap {
  width: 100%;
  height: 100%;
  will-change: transform;
  transform-origin: center center;
}

.lb-track {
  display: flex;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.lb-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 58px 10px 142px;
  box-sizing: border-box;
  overflow: visible;
}

@media (min-width: 768px) {
  body:not(.mobile-sim) .lb-slide {
    padding: 66px 72px 176px;
  }
}

.lb-zoom-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  will-change: transform;
  touch-action: none;
}

.lb-stage {
  touch-action: none;
}

.lb-root.is-zoomed .lb-img {
  cursor: grab;
}

.lb-root.is-zoomed .lb-img:active {
  cursor: grabbing;
}

.lb-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  user-select: none;
  -webkit-user-drag: none;
}

.lb-img.is-avatar {
  width: min(290px, 74vw);
  height: min(290px, 74vw);
  border-radius: 9999px;
  object-fit: cover;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 150ms ease, transform 120ms ease, opacity 180ms ease;
}

.lb-nav:hover {
  background: rgba(255, 255, 255, .28);
}

.lb-nav:active {
  transform: translateY(-50%) scale(.92);
}

.lb-nav:disabled {
  opacity: .28;
  pointer-events: none;
}

.lb-nav svg {
  width: 22px;
  height: 22px;
}

.lb-prev {
  left: 16px;
}

.lb-next {
  right: 16px;
}

@media (max-width: 767px) {
  .lb-nav {
    display: none !important;
  }
}

body.mobile-sim .lb-nav {
  display: none !important;
}

.lb-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 14px max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .56) 66%, transparent 100%);
  transition: opacity 200ms ease, transform 200ms var(--ds-ease);
}

.lb-caption {
  width: 100%;
  max-width: 600px;
  color: rgba(255, 255, 255, .94);
  font-size: 13.5px;
  line-height: 1.42;
  text-align: left;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.lb-caption-txt {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}

.lb-caption-txt.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  max-height: 120px;
  overflow-y: auto;
}

.lb-caption.is-centered .lb-caption-txt {
  text-align: center;
}

.lb-caption-link {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.lb-caption-link:hover {
  background: rgba(255, 255, 255, .26);
}

@media (min-width: 768px) {
  body:not(.mobile-sim) .lb-caption-link {
    display: none;
  }
}

.lb-dots {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-dots .car-dots {
  position: static;
  transform: none;
  background: transparent;
  backdrop-filter: none;
  padding: 2px 4px;
}

@media (min-width: 768px) {
  body:not(.mobile-sim) .lb-dots {
    display: none !important;
  }
}

.lb-thumbs {
  display: none;
  align-items: center;
  justify-content: safe center;
  gap: 7px;
  width: 100%;
  max-width: 720px;
  overflow-x: auto;
  padding: 4px 8px;
}

@media (min-width: 768px) {
  body:not(.mobile-sim) .lb-thumbs:not(.hidden) {
    display: flex;
  }
}

.lb-thumb {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  opacity: .56;
  cursor: pointer;
  transition: opacity 150ms ease, transform 150ms var(--ds-ease), border-color 150ms ease;
}

.lb-thumb:hover {
  opacity: .88;
}

.lb-thumb.is-active {
  opacity: 1;
  border-color: #ffffff;
  transform: scale(1.08);
}

.lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lb-actions {
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}

.lb-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  padding: 0 9px;
  border-radius: 9999px;
  color: rgba(255, 255, 255, .92);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background-color 140ms ease, color 140ms ease, transform 120ms ease;
}

.lb-act-btn:hover {
  background: rgba(255, 255, 255, .12);
}

.lb-act-btn:active {
  transform: scale(.92);
}

.lb-act-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.lb-act-btn.is-liked {
  color: #ff3b5c;
}

.lb-act-btn.is-reposted {
  color: #00ba7c;
}

.lb-act-btn.is-saved {
  color: #60a5fa;
}

.lb-act-btn.is-downloaded {
  color: #34d399;
}

.lb-act-btn.is-pop svg {
  animation: pfSpringPop 320ms var(--ds-ease);
}

#lightbox.is-ui-hidden .lb-top {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

#lightbox.is-ui-hidden .lb-bottom {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

#lightbox.is-ui-hidden .lb-nav {
  opacity: 0;
  pointer-events: none;
}

/* Per-image / Per-video Comments Sheet (NEVER blurs the media preview!) */
.lb-cmt-backdrop {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: transparent;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  animation: ovFadeIn 160ms ease-out forwards;
}

/* Mobile: cleanly frame photo/video in the top unblurred stage right above the Comments sheet */
#lightbox.is-comments-open {
  justify-content: flex-start;
}

#lightbox.is-comments-open .lb-stage {
  flex: 0 0 auto;
  height: calc(100% - min(60dvh, 480px));
  width: 100%;
  overflow: hidden;
  transition: height 220ms var(--ds-ease), width 220ms var(--ds-ease);
}

#lightbox.is-comments-open .lb-slide {
  padding: 54px 12px 10px;
}

#lightbox.is-comments-open .lb-bottom {
  opacity: 0;
  pointer-events: none;
}

#lightbox.is-comments-open .lb-img {
  max-height: 100% !important;
  max-width: 100% !important;
  border-radius: 12px;
}

#lightbox.is-comments-open .vp-player.is-lightbox {
  max-height: 100% !important;
  width: min(100%, 420px);
  aspect-ratio: 16 / 9;
}

@media (min-width: 768px) {
  body:not(.mobile-sim) #lightbox.is-comments-open .lb-stage {
    flex: 1 1 auto;
    height: 100%;
    width: calc(100% - 416px);
    overflow: hidden;
  }

  body:not(.mobile-sim) #lightbox.is-comments-open .lb-slide {
    padding: 66px 64px 168px;
  }

  body:not(.mobile-sim) #lightbox.is-comments-open .lb-top,
  body:not(.mobile-sim) #lightbox.is-comments-open .lb-bottom {
    right: 416px;
    opacity: 1;
    pointer-events: auto;
    transition: right 220ms var(--ds-ease);
  }

  body:not(.mobile-sim) #lightbox.is-comments-open .lb-img {
    max-height: 100% !important;
    border-radius: 12px;
  }

  body:not(.mobile-sim) #lightbox.is-comments-open .vp-player.is-lightbox {
    width: min(94%, 860px);
    max-height: min(70dvh, 580px) !important;
  }

  body:not(.mobile-sim) #lightbox.is-comments-open .lb-next {
    right: 16px;
  }
}

.lb-cmt-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 22;
  height: min(60dvh, 480px);
  max-height: calc(var(--vvh, 100dvh) - 24px);
  border-radius: 24px 24px 0 0;
  background: var(--background);
  color: var(--foreground);
  border-top: 1px solid var(--card-border);
  box-shadow: var(--ds-shadow-pop);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: ovSheetUp 280ms var(--ds-ease) forwards;
}

@media (min-width: 768px) {
  body:not(.mobile-sim) .lb-cmt-sheet {
    left: auto;
    top: 16px;
    right: 16px;
    bottom: 16px;
    width: 396px;
    height: auto;
    max-height: none;
    border-radius: 22px;
    border: 1px solid var(--card-border);
    animation: ovPushIn 220ms var(--ds-ease) forwards;
  }

  body:not(.mobile-sim) .lb-cmt-grabber {
    display: none;
  }
}

.lb-cmt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.lb-cmt-sort {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 9999px;
  background: var(--content);
  border: 1px solid var(--border);
}

.lb-cmt-sort button {
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-foreground);
  transition: all 130ms ease;
}

.lb-cmt-sort button.is-on {
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

.lb-cmt-title {
  font-family: var(--ds-font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.lb-cmt-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0;
}

.lb-cmt-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  transition: background-color 220ms ease;
}

.lb-cmt-item.is-just-posted {
  background: color-mix(in srgb, var(--primary) 9%, transparent);
}

.lb-cmt-item+.lb-cmt-item {
  border-top: 1px solid var(--border);
}

.lb-cmt-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.lb-cmt-thread-line {
  width: 2px;
  flex: 1;
  min-height: 16px;
  margin-top: 6px;
  border-radius: 9999px;
  background: var(--border);
}

.lb-cmt-body {
  flex: 1;
  min-width: 0;
}

.lb-cmt-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.lb-cmt-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.25;
  min-width: 0;
}

.lb-cmt-author {
  font-family: var(--ds-font-display);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-cmt-time {
  font-size: 11.5px;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.lb-cmt-text {
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.42;
  color: var(--foreground);
  overflow-wrap: anywhere;
}

.lb-cmt-acts {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.lb-cmt-act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  transition: color 130ms ease, transform 110ms ease;
}

.lb-cmt-act:hover {
  color: var(--foreground);
}

.lb-cmt-act:active {
  transform: scale(.92);
}

.lb-cmt-act.is-on {
  color: #f4245e;
}

.lb-cmt-act.is-danger:hover {
  color: var(--error);
}

.lb-cmt-act svg {
  width: 14.5px;
  height: 14.5px;
}

.lb-cmt-nested {
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lb-cmt-sub {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.lb-cmt-sub.is-just-posted {
  background: color-mix(in srgb, var(--primary) 9%, transparent);
  border-radius: 10px;
  padding: 6px;
  margin: -6px;
}

.lb-cmt-replyto {
  font-size: 11.5px;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.lb-cmt-replyto span {
  color: var(--primary);
  font-weight: 600;
}

.lb-cmt-ctx-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 9%, var(--content));
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
}

.lb-cmt-ctx-banner button {
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 700;
  padding: 0 4px;
}

.lb-cmt-ctx-banner button:hover {
  color: var(--foreground);
}

.lb-cmt-compose {
  flex-shrink: 0;
  padding: 8px 12px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--background);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.lb-cmt-emojis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
}

.lb-cmt-em {
  width: 32px;
  height: 28px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  transition: background-color 120ms ease, transform 120ms ease;
}

.lb-cmt-em:hover {
  background: var(--ds-hover);
  transform: scale(1.12);
}

.lb-cmt-em:active {
  transform: scale(.9);
}

.lb-cmt-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-cmt-pill {
  min-height: 42px;
  flex: 1;
  min-width: 0;
  padding: 4px 5px 4px 12px;
  gap: 3px;
}

.lb-cmt-pill input {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  font-size: 14.5px;
}

.lb-cmt-pill .pf-reply-tools {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}

.lb-cmt-pill .pf-tool-btn {
  width: 28px;
  height: 28px;
}

.lb-cmt-pill .pf-tool-gif {
  width: auto;
  padding: 0 4px;
}

#inlineCommentTray_lb_cmt {
  margin-top: 2px;
}

/* =====================================================================
   4. ANCHORED POPOVERS (.anchored-popover-card)
   ===================================================================== */
@keyframes ovPopAnchor {
  from {
    opacity: 0;
    transform: scale(.96) translateY(-2px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.anchored-popover-card {
  position: absolute;
  z-index: 94;
  background: var(--background);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 6px;
  box-shadow: var(--ds-shadow-pop);
  animation: ovPopAnchor 130ms var(--ds-ease) forwards;
  user-select: none;
  max-width: min(280px, calc(100vw - 20px));
}

html.dark .anchored-popover-card {
  background: var(--card);
  border-color: var(--card-border);
  box-shadow: var(--ds-shadow-pop);
}

.pop-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--foreground);
  text-align: left;
  transition: background-color 120ms ease, transform 100ms ease;
  white-space: nowrap;
}

.pop-menu-item:hover {
  background: var(--ds-hover);
}

.pop-menu-item:active {
  transform: scale(.98);
  background: var(--ds-press);
}

.pop-menu-item svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  stroke-width: 1.8;
}

.pop-menu-item.pop-danger {
  color: var(--error);
}

.pop-menu-item.pop-danger:hover {
  background: color-mix(in srgb, var(--error) 11%, transparent);
}

.pop-menu-divider {
  height: 1px;
  margin: 4px 8px;
  background: var(--border);
}

/* =====================================================================
   5. PICKERS (LANGUAGE / CURRENCY / COUNTRY) · THEME · CHECKOUT · REGISTER
   ===================================================================== */
.ov-picker-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

@media (min-width: 600px) {
  body:not(.mobile-sim) .ov-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ov-pick-item {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--ds-radius-m);
  border: 1px solid var(--card-border);
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  transition: border-color 140ms ease, background-color 140ms ease, transform 110ms ease;
}

.ov-pick-item:hover {
  background: var(--ds-hover);
}

.ov-pick-item:active {
  transform: scale(.985);
}

.ov-pick-item.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 7%, var(--background));
}

.ov-check-dot {
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--primary-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ov-check-dot svg {
  width: 13px;
  height: 13px;
}

/* Site theme modal */
.ov-theme-surfaces {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ov-surface-btn {
  padding: 12px;
  border-radius: var(--ds-radius-m);
  border: 1.5px solid var(--card-border);
  background: var(--background);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease, transform 120ms ease;
}

.ov-surface-btn:hover {
  background: var(--ds-hover);
}

.ov-surface-btn:active {
  transform: scale(.98);
}

.ov-surface-btn.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 7%, var(--background));
}

.ov-surface-swatch {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.ov-surface-swatch::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  height: 5px;
  border-radius: 9999px;
  background: var(--primary);
}

.ov-accent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ov-accent-btn {
  padding: 10px 6px;
  border-radius: var(--ds-radius-m);
  border: 1.5px solid var(--card-border);
  background: var(--background);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--foreground);
  transition: border-color 150ms ease, background-color 150ms ease, transform 120ms ease;
}

.ov-accent-btn:hover {
  background: var(--ds-hover);
}

.ov-accent-btn:active {
  transform: scale(.96);
}

.ov-accent-btn.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--background));
  font-weight: 700;
}

.ov-accent-dot {
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

/* Checkout modal */
.ov-chk-summary {
  padding: 14px 16px;
  border-radius: var(--ds-radius-l);
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ov-chk-methods {
  border: 1px solid var(--card-border);
  border-radius: var(--ds-radius-l);
  overflow: hidden;
  background: var(--background);
}

.ov-chk-method {
  width: 100%;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: background-color 120ms ease;
}

.ov-chk-method+.ov-chk-method {
  border-top: 1px solid var(--border);
}

.ov-chk-method:hover {
  background: var(--ds-hover);
}

.ov-chk-method.is-active {
  background: color-mix(in srgb, var(--primary) 7%, transparent);
}

.ov-chk-method.is-disabled {
  opacity: .48;
}

.ov-radio {
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  border: 2px solid var(--card-border);
  flex-shrink: 0;
  position: relative;
}

.ov-chk-method.is-active .ov-radio {
  border-color: var(--primary);
}

.ov-chk-method.is-active .ov-radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 9999px;
  background: var(--primary);
}

.ov-chk-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 2px 2px;
  border-top: 1px solid var(--border);
  font-family: var(--ds-font-display);
  font-size: 16px;
  font-weight: 800;
}

/* Register account categories */
.ov-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ov-cat-btn {
  padding: 10px 12px;
  border-radius: var(--ds-radius-m);
  border: 1.5px solid var(--card-border);
  background: var(--background);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: border-color 140ms ease, background-color 140ms ease, transform 110ms ease;
}

.ov-cat-btn:hover {
  background: var(--ds-hover);
}

.ov-cat-btn:active {
  transform: scale(.98);
}

.ov-cat-btn.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--background));
}

/* Expression studio modal */
.ov-exp-grid-emoji {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

@media (min-width: 600px) {
  body:not(.mobile-sim) .ov-exp-grid-emoji {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

.exp-search-box input {
  font-size: 16px;
}

.exp-gif-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  grid-auto-rows: max-content;
  width: 100%;
}

.exp-gif-card {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #0b0f1a;
  text-align: left;
  transition: border-color 140ms ease, transform 110ms ease;
}

.exp-gif-card:hover {
  border-color: var(--primary);
}

.exp-gif-card:active {
  transform: scale(.98);
}

.exp-gif-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.exp-gif-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.exp-gif-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px 8px 5px;
  background: linear-gradient(to top, rgba(0, 0, 0, .8), transparent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toast & floating payment receipt positioning */
#toast {
  bottom: 78px;
  z-index: 98 !important;
  box-shadow: var(--ds-shadow-pop);
}

@media (min-width: 768px) {
  body:not(.mobile-sim) #toast {
    bottom: 24px;
  }
}

body.mobile-sim #toast {
  position: absolute !important;
  bottom: 78px !important;
}

body:has(#installBanner:not(.hidden)) #toast {
  bottom: 146px !important;
}

body.mobile-sim:has(#installBanner:not(.hidden)) #toast {
  bottom: 146px !important;
}

body.mobile-sim #payConfirmFloat {
  position: absolute !important;
  bottom: 76px !important;
  left: 12px !important;
  right: 12px !important;
  width: auto !important;
}