.post-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.post-actions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 12px;
  color: #d8e4ed;
  background: transparent;
  border: 1px solid #345066;
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
}
.post-actions svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.post-actions .like-button[aria-pressed='true'] {
  color: #ff677b;
}
.like-button[aria-pressed='true'] svg {
  fill: #ff677b;
}
.post-actions button:disabled {
  opacity: 0.6;
}
.post-comments[hidden],
#feed .feed-grid > .post[hidden] {
  display: none !important;
}
.post-comments {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #2e4052;
}
.post-comments h4 {
  margin: 0 0 14px;
}
.comment-item {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #263748;
}
.comment-avatar {
  flex: 0 0 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #202227;
  color: #d7f5ff;
  font-weight: 800;
}
.comment-item p {
  margin: 5px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.comment-item small {
  color: #93a8b9;
}
.comment-form {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}
.comment-composer-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 14px;
}
.comment-composer-identity .comment-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
}
.comment-form input,
.comment-form textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid #345066;
  border-radius: 10px;
  background: #202227;
  color: white;
  padding: 11px;
  font: inherit;
}
.comment-form textarea {
  resize: vertical;
  min-height: 80px;
}
.comment-form button {
  justify-self: start;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #000;
  padding: 11px 16px;
  font: inherit;
  cursor: pointer;
}
.social-status {
  font-size: 14px;
  color: #aebfce;
  overflow-wrap: anywhere;
}
.all-posts-link {
  display: inline-block;
  margin: 20px 0 0;
  padding: 12px 18px;
  border: 1px solid #345066;
  border-radius: 12px;
  color: white;
  text-decoration: none;
  font-weight: 700;
}
.feed-grid > .post {
  align-self: start;
}
.archive-page {
  max-width: 1000px;
  padding: 24px;
  margin: auto;
}
.archive-page .feed-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr;
}
.archive-page .post {
  background: #202227;
  border: 1px solid #223041;
  border-radius: 22px;
  padding: 24px;
  min-width: 0;
}
.archive-page .post-head {
  display: flex;
  gap: 12px;
  align-items: center;
}
.archive-page .post-head small {
  display: block;
  color: #93a2b5;
}
.archive-page .post-logo {
  padding: 10px;
  background: white;
  color: #d71920;
  font-weight: 900;
  border-radius: 12px;
}
.archive-page .post-image,
.archive-page .uploaded-post-videos video {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 16px;
  border-radius: 14px;
}
.archive-page .uploaded-post-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.archive-page .post-actions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #223041;
}
.archive-page .post p {
  color: #c5d0db;
}
.archive-page .post a {
  color: #8de2ff;
}
.post[id] {
  scroll-margin-top: 90px;
}
.publication-dialog {
  background: #202227;
  color: #fff;
  border: 1px solid #405165;
  border-radius: 22px;
  padding: 24px;
  width: min(720px, calc(100% - 32px));
  max-height: 85vh;
  overflow: auto;
}
.publication-dialog::backdrop {
  background: #000b;
}
.publication-close {
  display: block;
  margin: 0 0 20px auto;
  background: #202227;
  color: white;
  border: 0;
  border-radius: 9px;
  padding: 10px 16px;
  cursor: pointer;
  font: inherit;
}
.publication-read {
  display: block;
  margin-top: 18px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #000;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.repost-url {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  background: #202227;
  color: white;
  border: 1px solid #345066;
  border-radius: 10px;
}
@media (max-width: 575.98px) {
  .archive-page {
    padding: 16px;
  }
  .archive-page .post {
    padding: 18px;
  }
  .post-actions {
    gap: 9px;
  }
}
/* Three fixed slots in the home feed; comments stay over the media. */
body:not([data-feed-archive]) #feed .feed-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-template-rows: 520px;
  grid-auto-rows: 520px;
  gap: 18px;
  height: 520px;
  min-width: 0;
  align-items: stretch;
}
body:not([data-feed-archive]) #feed .feed-grid > .post {
  display: flex;
  flex-direction: column;
  height: 520px;
  min-height: 0;
  max-height: 520px;
  padding: 18px;
  grid-row: auto !important;
  grid-column: auto !important;
  align-self: stretch;
  position: relative;
  overflow: hidden;
  gap: 12px;
}
body:not([data-feed-archive]) #feed .post > .post-head {
  flex: 0 0 auto;
  min-width: 0;
  margin: 0;
  gap: 10px;
}
body:not([data-feed-archive]) #feed .post > .post-head b {
  font-size: 14px;
}
body:not([data-feed-archive]) #feed .post > .post-head small {
  font-size: 12px;
}
body:not([data-feed-archive]) #feed .post > h3,
body:not([data-feed-archive]) #feed .post > p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 0 0 auto;
  max-height: 3em;
  margin: 0;
  line-height: 1.5;
}
body:not([data-feed-archive]) #feed .post > h3 {
  font-size: 18px;
}
body:not([data-feed-archive]) #feed .post > .kicker {
  font-size: 11px;
  flex: 0 0 auto;
}
body:not([data-feed-archive]) #feed .post > .post-actions {
  flex: 0 0 auto;
  margin: 0;
  padding-top: 10px;
  gap: 9px;
}
body:not([data-feed-archive]) #feed .post > .publication-read {
  flex: 0 0 auto;
  margin: 0;
  padding: 9px 12px;
  font-size: 14px;
}
.post-media-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #202227;
  isolation: isolate;
}
body:not([data-feed-archive]) #feed .post-media-stage {
  flex: 1 1 auto;
  min-height: 0;
}
.post-media-content {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
#feed .post .post-media-content > img.post-image,
#feed .post .post-media-content > video {
  display: block !important;
  flex: 0 0 100%;
  width: 100% !important;
  max-width: 100%;
  height: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  scroll-snap-align: start;
  margin: 0 !important;
  padding: 0;
  border-radius: 0;
  background: #202227;
}
.post .post-media-stage > .post-comments {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  margin: 0;
  border: 0;
  background: #202227dd;
  backdrop-filter: blur(3px);
  overflow: hidden;
  color: #fff;
}
.comment-overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
}
.comment-overlay-head h4 {
  font-size: 14px;
  margin: 0;
}
.comments-close {
  width: 32px;
  height: 32px;
  border: 1px solid #55728a;
  border-radius: 8px;
  background: #202227;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.post-comments .comment-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.post-comments .comment-form {
  margin: 0;
  flex: 0 0 auto;
  gap: 6px;
}
.post-comments .comment-form input {
  padding: 7px 10px;
  min-height: 34px;
  font-size: 14px;
}
.post-comments .comment-form textarea {
  padding: 7px 10px;
  min-height: 44px;
  height: 44px;
  resize: none;
  font-size: 14px;
}
.post-comments .comment-form button {
  padding: 7px 12px;
  font-size: 14px;
}
.post-comments .comment-item {
  padding: 8px 0;
  font-size: 14px;
  gap: 8px;
}
.post-comments .comment-item p {
  color: #fff;
}
.post-media-stage > .social-status {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  z-index: 4;
  margin: 0;
  padding: 6px 8px;
  background: #202227f5;
  border-radius: 8px;
  font-size: 12px;
  max-height: 60px;
  overflow: auto;
  pointer-events: none;
}
.post-media-stage > .social-status[hidden] {
  display: none;
}
.archive-page .post-media-stage {
  height: 440px;
  margin: 16px 0;
}
@media (max-width: 991.98px) {
  body:not([data-feed-archive]) #feed .feed-grid {
    gap: 12px;
  }
  body:not([data-feed-archive]) #feed .feed-grid > .post {
    padding: 12px;
  }
  .post-actions button {
    padding: 8px;
    gap: 5px;
  }
}
@media (max-width: 767.98px) {
  body:not([data-feed-archive]) #feed .feed-grid {
    grid-template-columns: none !important;
    grid-auto-columns: 88%;
    grid-auto-flow: column;
    grid-template-rows: 520px;
    height: 536px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding-bottom: 16px;
  }
  body:not([data-feed-archive]) #feed .feed-grid > .post {
    scroll-snap-align: start;
  }
  .archive-page .post-media-stage {
    height: 420px;
  }
}
.post-media-stage > .social-status {
  top: 48px;
  bottom: auto;
}
/* Featured latest post, with two compact posts alongside. */
body:not([data-feed-archive]) #feed .feed-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) !important;
  grid-template-rows: 420px 420px;
  grid-auto-rows: 420px;
  grid-auto-flow: row;
  height: 858px;
  overflow: visible;
  padding: 0;
}
body:not([data-feed-archive]) #feed .feed-grid > .post {
  height: 420px;
  max-height: 420px;
  padding: 18px;
  gap: 10px;
}
body:not([data-feed-archive]) #feed .feed-grid > .post[data-feed-slot='1'] {
  grid-column: 1 !important;
  grid-row: 1/3 !important;
  height: 858px;
  max-height: 858px;
}
body:not([data-feed-archive]) #feed .feed-grid > .post[data-feed-slot='2'] {
  grid-column: 2 !important;
  grid-row: 1 !important;
}
body:not([data-feed-archive]) #feed .feed-grid > .post[data-feed-slot='3'] {
  grid-column: 2 !important;
  grid-row: 2 !important;
}

.post > .post-comments {
  position: static;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 6px;
  margin: 0;
  padding: 8px 0 0;
  border-top: 1px solid #2e4052;
  background: transparent;
  color: white;
}
.post > .post-comments .comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}
.post > .post-comments .comment-composer-identity {
  grid-column: 1;
  grid-row: 1;
}
.post > .post-comments .comment-form textarea {
  grid-column: 1/-1;
  grid-row: 2;
  height: 48px;
  min-height: 48px;
}
.post > .post-comments .comment-form button {
  grid-column: 2;
  grid-row: 1;
  justify-self: stretch;
  padding: 7px 12px;
}
.live-comments {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  max-height: 48%;
  padding: 14px 12px 8px;
  background: linear-gradient(transparent, #202227d9);
  pointer-events: none;
  color: white;
}
.live-comments[hidden] {
  display: none;
}
.live-comments .comment-list {
  max-height: 100%;
  overflow: auto;
  pointer-events: auto;
  scrollbar-width: thin;
}
.live-comments .comment-item {
  padding: 5px 0;
  gap: 8px;
  border: 0;
  align-items: flex-start;
  font-size: 14px;
  text-shadow: 0 1px 3px #000;
}
.live-comments .comment-avatar {
  flex-basis: 28px;
  height: 28px;
  font-size: 13px;
  background: #202227e6;
}
.live-comments .comment-item p {
  margin: 1px 0;
  color: white !important;
  line-height: 1.35;
}
.live-comments .comment-item small {
  display: none;
}
.live-comments .comment-item b {
  color: white;
}
#feed .feed-more {
  margin-top: 12px !important;
  padding-top: 0 !important;
}
#feed .feed-more a {
  margin: 0 !important;
}
.archive-page .post > .post-comments {
  margin-top: 14px;
}
@media (max-width: 991.98px) and (min-width: 768px) {
  body:not([data-feed-archive]) #feed .feed-grid {
    gap: 12px;
    height: 852px;
  }
  body:not([data-feed-archive]) #feed .feed-grid > .post[data-feed-slot='1'] {
    height: 852px;
    max-height: 852px;
  }
}
@media (max-width: 767.98px) {
  body:not([data-feed-archive]) #feed .feed-grid {
    grid-template-columns: none !important;
    grid-template-rows: 560px;
    grid-auto-columns: 88%;
    grid-auto-flow: column;
    height: 576px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 16px;
  }
  body:not([data-feed-archive]) #feed .feed-grid > .post,
  body:not([data-feed-archive]) #feed .feed-grid > .post[data-feed-slot='1'] {
    grid-column: auto !important;
    grid-row: auto !important;
    height: 560px;
    max-height: 560px;
  }
  body:not([data-feed-archive]) #feed .feed-grid > .post[data-feed-slot='2'],
  body:not([data-feed-archive]) #feed .feed-grid > .post[data-feed-slot='3'] {
    grid-column: auto !important;
    grid-row: auto !important;
  }
}
.live-comments {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 48%;
  max-height: 180px;
  overflow: hidden;
}
.live-comments .comment-list {
  flex: 0 1 auto;
  min-height: 0;
}

.live-comments {
  background: linear-gradient(transparent, #202227bf);
  border-radius: 0 0 10px 0;
}

/* Fixed comment column, readable over every photo and video. */
.post-media-content {
  scrollbar-width: none;
}
.post-media-content::-webkit-scrollbar {
  display: none;
}
.live-comments {
  padding: 8px 4px 8px 8px;
  background: #202227e6;
  max-height: none;
  border-radius: 10px 0 0 0;
  pointer-events: auto;
}
.live-comments .comment-list {
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  scrollbar-width: auto;
  scrollbar-color: #a8c0d4 #1c2a38;
  overscroll-behavior: contain;
  padding-right: 4px;
  outline-offset: -2px;
}
.live-comments .comment-list::-webkit-scrollbar {
  width: 9px;
  height: 0;
}
.live-comments .comment-list::-webkit-scrollbar-track {
  background: #202227;
  border-radius: 8px;
}
.live-comments .comment-list::-webkit-scrollbar-thumb {
  background: #202227;
  border: 2px solid #1c2a38;
  border-radius: 8px;
  min-height: 24px;
}
.live-comments .comment-list::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
.live-comments .comment-item > div {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.live-comments .comment-item,
.live-comments .comment-item b,
.live-comments .comment-item p {
  color: #fff !important;
  white-space: normal;
  overflow-wrap: anywhere;
}
.live-comments .comment-item p {
  white-space: pre-wrap;
}
.live-comments .comment-item {
  animation: comment-rise 0.18s ease-out;
}
.post-media-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #0008;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.15s;
}
.post-media-stage:has(.live-comments:hover)::after,
.post-media-stage:has(.live-comments:focus-within)::after,
.comment-writing > .post-media-stage::after {
  opacity: 1;
}
@keyframes comment-rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .live-comments .comment-item {
    animation: none;
  }
  .post-media-stage::after {
    transition: none;
  }
}

.post-calendar {
  padding: 18px;
  border: 1px solid #345066;
  border-radius: 14px;
  margin-bottom: 20px;
  background: #202227;
}
.post-calendar label {
  display: block;
  font-weight: 700;
  margin-bottom: 10px;
}
.post-calendar-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.post-calendar input,
.post-calendar button {
  color: #fff;
  background: #202227;
  border: 1px solid #456078;
  border-radius: 9px;
  padding: 10px;
  font: inherit;
  min-height: 44px;
}
.post-calendar input {
  color-scheme: dark;
  max-width: 100%;
}
.post-calendar button {
  cursor: pointer;
}
.post-days {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 4px;
}
.post-days button {
  white-space: nowrap;
}
.post-days button[aria-pressed='true'] {
  background: #d92834;
  border-color: #ff6972;
}
.date-status {
  margin: 10px 0 0;
  color: #c9d9e7;
}

/* Compact rows: text, circular avatar, then the author's name. */
.live-comments {
  padding: 8px 4px 8px 10px;
  background: #202227a6;
  border-radius: 8px 0 0 8px;
}
.live-comments .comment-list {
  max-height: 164px;
}
.live-comments .comment-item {
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.live-comments .comment-item > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}
.live-comments .comment-item > .comment-identity {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 46%;
}
.live-comments .comment-identity .comment-avatar {
  flex: 0 0 32px;
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 50%;
  overflow: hidden;
}
.live-comments .comment-identity b {
  min-width: 0;
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.live-comments .comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Each comment has its own background; the container stays transparent. */
.live-comments {
  background: transparent;
  padding: 0 3px 0 8px;
  border-radius: 0;
}
.live-comments .comment-list {
  background: transparent;
}
.live-comments .comment-item {
  background: #202227bd;
  border-radius: 10px;
  padding: 9px 7px 9px 12px;
  margin: 6px 0;
}
.live-comments .comment-identity {
  justify-content: flex-end;
}

/* Let the card grow while composing, preserving the post and its media. */
body:not([data-feed-archive]) #feed .feed-grid:has(.comment-writing) {
  height: auto;
  grid-template-rows: minmax(420px, auto) minmax(420px, auto);
  grid-auto-rows: minmax(420px, auto);
}
body:not([data-feed-archive]) #feed .feed-grid > .post.comment-writing {
  height: auto;
  max-height: none;
  min-height: 640px;
}
body:not([data-feed-archive]) #feed .feed-grid:has(.comment-writing) > .post[data-feed-slot='1'] {
  height: auto;
  max-height: none;
  min-height: 858px;
}
body:not([data-feed-archive]) #feed .post.comment-writing > .post-media-stage {
  flex: 1 0 260px;
  min-height: 260px;
}
body:not([data-feed-archive]) #feed .post.comment-writing > h3,
body:not([data-feed-archive]) #feed .post.comment-writing > p {
  display: block;
  max-height: none;
  overflow: visible;
  -webkit-line-clamp: unset;
}
.post.comment-writing > .post-media-stage::after {
  opacity: 0;
}
@media (max-width: 767.98px) {
  body:not([data-feed-archive]) #feed .feed-grid:has(.comment-writing) {
    height: auto;
    grid-template-rows: minmax(640px, auto);
    grid-auto-rows: auto;
    overflow-y: visible;
  }
  body:not([data-feed-archive]) #feed .feed-grid:has(.comment-writing) > .post[data-feed-slot='1'] {
    min-height: 640px;
  }
}
/* The right comment column occupies the actual photo/video height, on all feeds. */
.post-media-stage .live-comments {
  justify-content: flex-end;
  max-height: 100%;
  padding: 8px 4px 8px 8px;
  background: transparent;
  box-sizing: border-box;
}
.post-media-stage .live-comments .comment-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}
.post-media-stage .live-comments .comment-item {
  flex-shrink: 0;
}
/* New comments enter at the bottom; previous comments move upward. */
.post-media-stage .live-comments .comment-list {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.post-media-stage .live-comments .comment-list > .comment-item:first-child {
  margin-top: auto;
}
.post-media-stage .live-comments .comment-list > .comment-item {
  flex: 0 0 auto;
}
/* Opening either right-hand card covers its neighbour without changing feed height. */
@media (min-width: 768px) {
  body:not([data-feed-archive]) #feed .feed-grid {
    position: relative;
  }
  body:not([data-feed-archive]) #feed .feed-grid:has(.comment-writing) {
    height: 858px;
    grid-template-rows: 420px 420px;
    grid-auto-rows: 420px;
  }
  body:not([data-feed-archive]) #feed .feed-grid > .post[data-feed-slot='2'].comment-writing,
  body:not([data-feed-archive]) #feed .feed-grid > .post[data-feed-slot='3'].comment-writing {
    grid-column: 2 !important;
    grid-row: 1/3 !important;
    position: relative;
    z-index: 15;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    background: #202227 !important;
    box-shadow: 0 0 0 1px #20222744;
  }
  body:not([data-feed-archive]) #feed .post.comment-covered {
    pointer-events: none;
  }
}

/* Keep complete author names readable beside the avatar on every feed card. */
.post-media-stage .live-comments .comment-item > .comment-identity {
  flex: 0 0 auto;
  max-width: none;
  min-width: max-content;
  flex-wrap: nowrap;
}
.post-media-stage .live-comments .comment-identity b {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  flex: none;
  max-width: none;
}
.post-media-stage .live-comments .comment-item > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
