/* IG217.103: standalone gallery shell and full-viewport gallery photo dialog. */
body.page-gallery-feed .feed-bg--gallery {padding:24px 0 44px!important}
body.page-gallery-feed .feed-bg--gallery > .feed-grid--gallery-modern {
  display:block!important;position:relative!important;
  width:min(1260px,calc(100% - 156px))!important;max-width:1260px!important;min-width:0!important;
  margin:0 auto!important;padding:0!important;transform:none!important;
}
body.page-gallery-feed .feed-grid--gallery-modern > #mainPanel {
  display:block!important;position:relative!important;inset:auto!important;
  float:none!important;transform:none!important;width:100%!important;max-width:none!important;min-width:0!important;
  margin:0!important;padding:0!important;
}
body.page-gallery-feed .gallery-page--standalone {display:block!important;width:100%!important;max-width:none!important;min-width:0!important;margin:0!important;padding:0!important}
body.page-gallery-feed .gallery-grid-section {border-radius:24px!important;overflow:visible!important}
body.page-gallery-feed .gallery-grid {grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:20px!important;padding:22px!important;width:100%!important;box-sizing:border-box!important}
body.page-gallery-feed .gallery-grid--single {grid-template-columns:minmax(0,760px)!important;justify-content:center!important}
body.page-gallery-feed :where(.gallery-card,.gallery-card__media-wrap,.gallery-card__meta) {min-width:0!important;max-width:100%!important}
body.page-gallery-feed #galleryGrid .gallery-card__media {position:relative!important;width:100%!important;height:auto!important;min-height:0!important;aspect-ratio:1/1!important;overflow:hidden!important;border-radius:16px!important}
body.page-gallery-feed #galleryGrid .gallery-card__media img {display:block!important;width:100%!important;height:100%!important;max-width:100%!important;object-fit:cover!important}
body.page-gallery-feed #galleryGrid.gallery-grid--single .gallery-card__media {aspect-ratio:16/10!important}
body.page-gallery-feed #galleryGrid.gallery-grid--single .gallery-card__media img {object-fit:contain!important}
body.page-gallery-feed .gallery-card__caption {overflow-wrap:anywhere}
body.page-gallery-feed .gallery-owner-actions--standalone {margin-top:20px!important}
body.page-gallery-feed #notifBadge[hidden],body.page-gallery-feed .kruh-feed-rail__badge[hidden] {display:none!important}
@media(max-width:1279px) {body.page-gallery-feed .gallery-grid {grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media(max-width:1100px) {
  body.page-gallery-feed .feed-bg--gallery > .feed-grid--gallery-modern {width:calc(100% - 32px)!important}
  body.page-gallery-feed .kruh-feed-rail {display:none!important}
}
@media(max-width:860px) {body.page-gallery-feed .gallery-grid {grid-template-columns:repeat(2,minmax(0,1fr))!important;padding:16px!important;gap:14px!important}}
@media(max-width:480px) {
  body.page-gallery-feed .feed-bg--gallery > .feed-grid--gallery-modern {width:calc(100% - 20px)!important}
  body.page-gallery-feed .gallery-grid {padding:12px!important;gap:12px!important;grid-template-columns:minmax(0,1fr)!important}
}
html[data-theme="dark"] body.page-gallery-feed :where(.gallery-grid-section,.gallery-standalone-manage),
body.dark.page-gallery-feed :where(.gallery-grid-section,.gallery-standalone-manage) {background:#111!important;background-image:none!important;border-color:#292929!important;color:#f5f5f5!important}
html[data-theme="dark"] body.page-gallery-feed :where(.gallery-grid-section .card__head,.gallery-card,.gallery-standalone-manage summary),
body.dark.page-gallery-feed :where(.gallery-grid-section .card__head,.gallery-card,.gallery-standalone-manage summary) {background:#171717!important;background-image:none!important;color:#f5f5f5!important;border-color:#303030!important}
html[data-theme="dark"] body.page-gallery-feed .h2,
body.dark.page-gallery-feed .h2 {background:#202020!important;background-image:none!important;color:#f5f5f5!important;border-color:#353535!important;box-shadow:none!important}
html[data-theme="dark"] body.page-gallery-feed.kruh-notif-drawer-open .kruh-feed-rail,
body.dark.page-gallery-feed.kruh-notif-drawer-open .kruh-feed-rail {background:#0b0f14!important}

html.kruh-gallery-lightbox-open,body.kruh-gallery-lightbox-open {overflow:hidden!important;overscroll-behavior:none!important}
/* IG217.105: temporarily hide the external Network UI, keeping its measured height. */
html.kruh-gallery-lightbox-open #fonzi-network-bar,
html.kruh-gallery-lightbox-open #fonzi-network-bar *,
html.kruh-gallery-lightbox-open .fonzi-network-submenu.fonzi-network-mobile-portal,
html.kruh-gallery-lightbox-open .fonzi-network-submenu.fonzi-network-mobile-portal * {
  visibility:hidden!important;opacity:0!important;pointer-events:none!important;
}

#galleryLightbox.gallery-lightbox {
  position:fixed!important;inset:0!important;top:0!important;
  width:100vw!important;height:100vh!important;height:100dvh!important;
  max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important;
  margin:0!important;padding:0!important;border:0!important;border-radius:0!important;
  overflow:hidden!important;transform:none!important;background:transparent!important;color:#f5f5f5!important;
  z-index:2147483647!important;
}
#galleryLightbox:not(.is-open) {display:none!important}
#galleryLightbox.is-open {display:block!important}
/* IG217.108: joined photo/comments panel matching the supplied Instagram reference. */
#galleryLightbox::backdrop {background:transparent!important}
#galleryLightbox .gallery-lightbox__backdrop {position:absolute!important;inset:0!important;width:100%!important;height:100%!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:rgba(0,0,0,.8)!important;backdrop-filter:none!important}
#galleryLightbox .gallery-lightbox__panel {
  --gallery-sidebar-width:380px;
  display:grid!important;position:absolute!important;inset:20px 72px!important;
  grid-template-columns:minmax(0,1fr) var(--gallery-sidebar-width)!important;grid-template-rows:minmax(0,1fr)!important;
  gap:0!important;width:min(1400px,calc(100vw - 144px),calc((100dvh - 40px) * var(--gallery-photo-ratio,.666667) + var(--gallery-sidebar-width)))!important;
  height:calc(100dvh - 40px)!important;min-height:0!important;max-height:none!important;
  margin:auto!important;padding:0!important;box-sizing:border-box!important;overflow:visible!important;align-items:stretch!important;
  background:#000!important;border:0!important;border-radius:3px!important;box-shadow:0 12px 48px rgba(0,0,0,.25)!important;transform:none!important;pointer-events:none!important;
}
#galleryLightbox .gallery-lightbox__panel > * {pointer-events:auto}
#galleryLightbox .gallery-lightbox__stage {display:grid!important;position:relative!important;grid-column:1!important;grid-row:1!important;order:0!important;width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;align-items:center!important;justify-items:center!important;background:#000!important;overflow:hidden!important;border-radius:3px 0 0 3px!important}
#galleryLightbox .gallery-lightbox__figure {display:block!important;position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important;margin:0!important;background:transparent!important;box-shadow:none!important;overflow:hidden!important;border-radius:0!important}
#galleryLightbox .gallery-lightbox__figure img {display:block!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
#galleryLightbox .gallery-lightbox__sidebar {display:flex!important;flex-direction:column!important;grid-column:2!important;grid-row:1!important;order:0!important;width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;box-sizing:border-box!important;padding:0!important;border:0!important;border-left:1px solid #303236!important;border-radius:0 3px 3px 0!important;overflow:hidden!important;background:#202225!important;background-image:none!important;box-shadow:none!important}
#galleryLightbox .gallery-lightbox__sidebar::before {display:none!important}
#galleryLightbox .gallery-lightbox__sidebar-head {padding:18px!important;border-bottom:1px solid #303236!important;max-height:35%!important;flex:0 0 auto!important;box-sizing:border-box!important;overflow:auto!important}
#galleryLightbox .gallery-lightbox__caption {font-size:16px!important;overflow-wrap:anywhere!important}
#galleryLightbox .gallery-lightbox__album {font-size:11px!important;color:#a8b6c7!important}
#galleryLightbox .gallery-lightbox__time {font-size:12px!important;color:#a8a8a8!important}
#galleryLightbox .gallery-lightbox__comments {flex:1 1 0!important;min-height:0!important;overflow:hidden!important;align-content:stretch!important;padding:0!important}
#galleryLightbox .gallery-lightbox-comments-card {min-height:0!important;height:100%!important;grid-template-rows:auto minmax(0,1fr)!important}
#galleryLightbox .gallery-lightbox-comments-card__head {padding:14px 18px!important;font-size:14px!important}
#galleryLightbox .gallery-lightbox-comments-card__body {min-height:0!important;min-width:0!important;grid-template-rows:minmax(0,1fr) auto!important;gap:0!important}
#galleryLightbox .gallery-lightbox-comments-card__list {min-height:0!important;padding:0 18px 14px!important;gap:18px!important;overflow:auto!important}
#galleryLightbox .gallery-comment {padding:0!important;background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;grid-template-columns:32px minmax(0,1fr)!important;gap:12px!important}
#galleryLightbox .gallery-comment__avatar {width:32px!important;height:32px!important;box-shadow:none!important}
#galleryLightbox .gallery-comment__meta {gap:6px!important}
#galleryLightbox .gallery-comment__meta strong {font-size:13px!important}
#galleryLightbox .gallery-comment__meta time {font-size:11px!important;color:#a8a8a8!important}
#galleryLightbox .gallery-comment__body {font-size:13px!important;color:#f5f5f5!important}
#galleryLightbox .gallery-comment-form {grid-template-columns:minmax(0,1fr) auto!important;min-width:0!important;margin:0!important;padding:12px 18px!important;gap:10px!important;border:0!important;border-top:1px solid #303236!important;border-radius:0!important;background:#202225!important;box-shadow:none!important;backdrop-filter:none!important}
#galleryLightbox .gallery-comment-form .inp {min-width:0!important;background:transparent!important;color:#f5f5f5!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:8px 0!important}
#galleryLightbox .gallery-comment-form .inp::placeholder {color:#a8a8a8!important;opacity:1!important}
#galleryLightbox .gallery-comment-form .btn {background:transparent!important;background-image:none!important;color:#5d9eff!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:8px 0!important}
#galleryLightbox .gallery-lightbox__close {position:fixed!important;top:12px!important;right:12px!important;width:44px!important;height:44px!important;z-index:6!important;font-size:32px!important;background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;backdrop-filter:none!important}
#galleryLightbox .gallery-lightbox__nav {position:fixed!important;align-self:center!important;top:50%!important;transform:translateY(-50%)!important;width:36px!important;height:36px!important;z-index:3!important;border:0!important;border-radius:50%!important;background:rgba(255,255,255,.85)!important;color:#151515!important;box-shadow:none!important;backdrop-filter:none!important;font-size:18px!important}
#galleryLightbox .gallery-lightbox__nav.is-prev {left:16px!important;right:auto!important}
#galleryLightbox .gallery-lightbox__nav.is-next {right:16px!important;left:auto!important}
@media(max-width:1100px) {#galleryLightbox .gallery-lightbox__panel {--gallery-sidebar-width:320px}}
@media(max-width:760px) {
  #galleryLightbox .gallery-lightbox__panel {inset:52px 12px 12px!important;width:calc(100vw - 24px)!important;height:calc(100dvh - 64px)!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,.8fr) minmax(0,1fr)!important}
  #galleryLightbox .gallery-lightbox__stage {grid-column:1!important;grid-row:1!important;border-radius:3px 3px 0 0!important}
  #galleryLightbox .gallery-lightbox__sidebar {grid-column:1!important;grid-row:2!important;border-left:0!important;border-top:1px solid #303236!important;border-radius:0 0 3px 3px!important}
  #galleryLightbox .gallery-lightbox__sidebar-head {padding:12px 14px!important}
  #galleryLightbox .gallery-lightbox-comments-card__head {padding:10px 14px!important}
  #galleryLightbox .gallery-lightbox-comments-card__list {padding:0 14px 12px!important}
  #galleryLightbox .gallery-comment-form {padding:10px 14px!important}
  #galleryLightbox .gallery-lightbox__nav {top:28%!important;width:32px!important;height:32px!important}
}

/* IG217.109: real comment likes and expandable reply threads. */
#galleryLightbox .gallery-lightbox__author {display:flex!important;align-items:center!important;gap:10px!important;margin-bottom:14px!important;color:#f5f5f5!important;text-decoration:none!important}
#galleryLightbox .gallery-lightbox__author img,#galleryLightbox .gallery-lightbox__author-avatar {width:32px!important;height:32px!important;object-fit:cover!important;border-radius:50%!important;flex:0 0 32px!important}
#galleryLightbox .gallery-lightbox__author-avatar {display:grid!important;place-items:center!important;background:#3559dc!important}
#galleryLightbox .gallery-lightbox__author strong {font-size:13px!important}
#galleryLightbox .gallery-lightbox__author small {display:block!important;color:#a8a8a8!important;font-size:11px!important}
#galleryLightbox .gallery-lightbox__sidebar,#galleryLightbox .gallery-lightbox-comments-card {gap:0!important}
@media(max-width:760px) {
  #galleryLightbox .gallery-lightbox__author {margin-bottom:6px!important}
  #galleryLightbox .gallery-lightbox__sidebar-head {padding:10px 14px!important}
  #galleryLightbox .gallery-lightbox__caption,#galleryLightbox .gallery-lightbox__time {margin-top:4px!important}
}
#galleryLightbox .gallery-comment--social {grid-template-columns:32px minmax(0,1fr) 20px!important}
#galleryLightbox .gallery-comment a {color:inherit!important;text-decoration:none!important}
#galleryLightbox .gallery-comment a:hover {text-decoration:underline!important}
#galleryLightbox .gallery-comment__body a {color:#87b9ff!important}
#galleryLightbox .gallery-comment__actions {display:flex!important;gap:10px!important;align-items:center!important;flex-wrap:wrap!important;color:#a8a8a8!important;font-size:11px!important;line-height:1.5!important}
#galleryLightbox .gallery-comment__actions button,#galleryLightbox .gallery-comment__thread button,#galleryLightbox .gallery-comments__more {padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;color:#a8a8a8!important;cursor:pointer!important;font:inherit!important;font-weight:600!important}
#galleryLightbox .gallery-comment__like {display:grid!important;place-items:center!important;padding:0!important;width:20px!important;height:24px!important;background:transparent!important;border:0!important;color:#f5f5f5!important;cursor:pointer!important;font-size:13px!important}
#galleryLightbox .gallery-comment__like[aria-pressed="true"] {color:#ff385c!important}
#galleryLightbox .gallery-comment__like:disabled {cursor:default!important;opacity:.6!important}
#galleryLightbox .gallery-comment__thread {margin-top:8px!important;min-width:0!important}
#galleryLightbox .gallery-comment__thread > button {font-size:12px!important;margin-bottom:12px!important}
#galleryLightbox .gallery-comment__thread > button::before {content:'';display:inline-block;width:24px;border-top:1px solid #777;margin-right:12px;vertical-align:middle}
#galleryLightbox .gallery-comment__replies {display:grid;gap:18px!important;min-width:0!important}
#galleryLightbox .gallery-comment__replies[hidden],#galleryLightbox [data-comment-replies][hidden] {display:none!important}
#galleryLightbox .gallery-comment__replies .gallery-comment--social {grid-template-columns:24px minmax(0,1fr) 20px!important;gap:8px!important}
#galleryLightbox .gallery-comment__replies .gallery-comment__avatar {width:24px!important;height:24px!important}
#galleryLightbox .gallery-comments__more {padding:10px 0!important;text-align:center!important;color:#87b9ff!important;font-size:12px!important}
#galleryLightbox .gallery-comment-form__reply {grid-column:1/-1!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;min-width:0!important;color:#a8a8a8!important;font-size:12px!important}
#galleryLightbox .gallery-comment-form[hidden] {display:none!important}
#galleryLightbox .gallery-comment-form__reply span {overflow-wrap:anywhere!important}
#galleryLightbox .gallery-comment-form__reply button {border:0!important;padding:4px 0!important;background:transparent!important;color:#87b9ff!important;cursor:pointer!important}
#galleryLightbox :where(.gallery-comment button,.gallery-comments__more,.gallery-comment a,.gallery-comment-form__reply button):focus-visible {outline:2px solid #87b9ff!important;outline-offset:3px!important}

/* IG217.110: clickable heart beside the like count in comment details. */
#galleryLightbox .gallery-comment__actions .gallery-comment__like-inline {display:inline-flex!important;align-items:center!important;gap:5px!important;white-space:normal!important;text-align:left!important}
#galleryLightbox .gallery-comment__like-inline i {font-size:11px!important;flex:0 0 auto!important}
#galleryLightbox .gallery-comment__actions .gallery-comment__like-inline[aria-pressed="true"] {color:#ff6682!important}
#galleryLightbox .gallery-comment__actions .gallery-comment__like-inline:disabled {cursor:default!important}

/* IG217.111: shared viewer keeps photo reactions/share below scrollable threads. */
#galleryLightbox .gallery-lightbox-comments-card__body {grid-template-rows:minmax(0,1fr) auto auto!important}
#galleryLightbox .gallery-lightbox__actions {padding:10px 18px!important;border-top:1px solid #303236!important;color:#f5f5f5!important;font-size:13px!important;font-weight:700!important}
#galleryLightbox .gallery-lightbox__action-buttons {display:flex!important;gap:18px!important;margin-bottom:8px!important}
#galleryLightbox .gallery-lightbox__action-buttons button {display:grid!important;place-items:center!important;width:26px!important;height:26px!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;color:#f5f5f5!important;font-size:24px!important}
#galleryLightbox .gallery-lightbox__action-buttons button.is-active {color:#ff5076!important}
#galleryLightbox .gallery-lightbox__action-buttons button:disabled {opacity:.4!important;cursor:default!important}
#galleryLightbox .gallery-lightbox__action-buttons button:focus-visible {outline:2px solid #5d9eff!important;outline-offset:3px!important}
@media(max-width:760px) {#galleryLightbox .gallery-lightbox__actions {padding:8px 14px!important}}
