.feed-card {
  position: relative;
  width: 450px;
  height: 800px;
  margin: 0 auto 24px auto;
  border-radius: 24px;
  display: block;
  background: #1a1a2e;
  perspective: 1000px;
}

.feed-card__img {
  width: 450px;
  height: 800px;
  overflow: hidden;
  flex-shrink: 0;
  display: block;
}

.feed-card-gradient-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.50) 30%, rgba(0,0,0,0.25) 65%, rgba(0,0,0,0) 100%);
  z-index: 5;
  pointer-events: none;
}

.feed-card-bottom-left {
  position: absolute;
  bottom: 16px;
  left: 14px;
  right: 64px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feed-card-profile-header {
  display: flex;
  align-items: center;
}

.feed-card-profile-header__username {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-card-follow-btn {
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.85);
  border-radius: 999px;
  padding: 2px 10px;
  margin-left: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.feed-card-front__caption {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-card-action-bar {
  position: absolute;
  right: 12px;
  bottom: 70px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.feed-card-rail__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.feed-card-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.feed-card-btn[data-action="like"] { background: #e53935; }
.feed-card-btn[data-action="comment"] { background: #6D28D9; }
.feed-card-btn[data-action="share"] { background: #14B8A6; }
.feed-card-btn[data-action="more"] { background: #ffffff; }

.feed-card-flipper {
  width: 450px;
  height: 800px;
  position: relative;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.4s ease;
  -webkit-transition: -webkit-transform 0.4s ease;
}

.feed-card-flipper.is-flipped {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

.feed-card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 24px;
  overflow: hidden;
  transition: opacity 0.4s ease;
}

.feed-card-face--front {
  opacity: 1;
  z-index: 2;
}

.feed-card-face--back {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  opacity: 0;
  z-index: 1;
  background: linear-gradient(to top right, #6D28D9, #14B8A6);
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.feed-card-flipper.is-flipped .feed-card-face--front {
  opacity: 0;
  pointer-events: none;
}

.feed-card-flipper.is-flipped .feed-card-face--back {
  opacity: 1;
  pointer-events: auto;
}

.feed-card-back__caption {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  padding: 16px 16px 8px 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.feed-card-back__scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-card-back__stickers-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}

.feed-card-back__sticker-cell {
  width: 56px;
  height: 56px;
  cursor: pointer;
  flex-shrink: 0;
}

.feed-card-back__sticker-cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.feed-card-back__comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}

.feed-card-back__comment {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  line-height: 1.4;
}

.feed-card-back__comment strong {
  color: #fff;
  font-weight: 600;
}

.feed-card-back__input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.2);
}

.feed-card-back__input {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 20px;
  padding: 8px 14px;
  color: #fff;
  font-size: 14px;
  resize: none;
  outline: none;
  font-family: inherit;
}

.feed-card-back__input::placeholder {
  color: rgba(255,255,255,0.6);
}

.feed-card-back__send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.feed-card-like-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  z-index: 20;
  animation: feedLikeBurst 0.8s ease-out forwards;
}

.feed-card-like-burst svg {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 0 12px rgba(109, 40, 217, 0.6));
}

@keyframes feedLikeBurst {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  40%  { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  70%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0; }
}

/* ========== FEED PAGE LAYOUT ========== */

.feed-page-layout {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.feed-main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
  gap: 24px;
}

.feed-post-unit {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  max-width: 720px;
  flex-shrink: 0;
  margin: 0 auto;
}

.feed-comments-col {
  width: 450px;
  flex-shrink: 0;
  height: 800px;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1.5px solid var(--color-border);
  overflow: hidden;
  background: var(--color-canvas);
  min-width: 0;
}

/* ========== AD PANEL (copied from inbox.css) ========== */

.ad-panel {
  width: 220px;
  flex-shrink: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ad-panel-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-family: var(--font-display);
}

.ad-panel-placeholder {
  flex: 1;
  border: 1.5px dashed var(--color-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--color-text-muted);
  font-family: var(--font-display);
}

/* ========== INLINE COMMENTS COLUMN ========== */

.feed-comments-header {
  padding: 12px 14px 8px;
  border-bottom: 1.5px solid var(--color-border);
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.feed-comments-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--color-text-primary);
  font-family: var(--font-display);
  letter-spacing: 0.05em;
}

.feed-comments-meta {
  margin-top: 4px;
}

.feed-comments-likes {
  font-size: 16px;
  color: var(--color-text-muted);
  font-family: var(--font-display);
}

.feed-comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-comments-empty {
  font-size: 18px;
  color: var(--color-text-muted);
  font-family: var(--font-display);
}

.feed-comment-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.feed-comment-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-secondary);
  overflow: hidden;
}

.feed-comment-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary);
  font-family: var(--font-display);
}

.feed-comment-text {
  font-size: 16px;
  color: var(--color-text-secondary);
  font-family: var(--font-display);
  margin-top: 1px;
}

.feed-comments-bottom-zone {
  border-top: 1.5px solid #ffffff;
  flex-shrink: 0;
}

.feed-comments-input-row {
  padding: 10px 14px;
}

.feed-comments-input-box {
  position: relative;
  border: 2.5px solid var(--color-border);
  border-radius: 12px;
  padding: 14px 60px 14px 14px;
  background: var(--color-canvas);
  display: flex;
  align-items: flex-end;
}

.feed-comments-input-box:focus-within {
  border-color: #6D28D9;
}

.feed-comments-action-bar {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-top: 1.5px solid #ffffff;
}

.feed-comments-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--color-text-secondary);
  flex: 1;
}

.feed-comments-action-btn:hover {
  background: var(--color-canvas-subtle);
}

.feed-comments-action-btn svg {
  stroke: currentColor;
  width: 23px;
  height: 23px;
}

.feed-comments-action-btn span {
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-display);
}

.feed-comments-action-btn.liked svg {
  stroke: #e53e3e;
  fill: #e53e3e;
}

.feed-comments-input {
  flex: 1;
  font-size: 16px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  line-height: 1.5;
  max-height: 120px;
  overflow-y: auto;
  width: 100%;
  color: var(--color-text-primary);
  font-family: var(--font-display);
}

.feed-comments-send-btn {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 48px;
  height: 42px;
  border-radius: 10px;
  background: #6D28D9;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feed-comments-send-btn:hover {
  opacity: 0.85;
}

.feed-comments-char-count {
  display: none;
  font-size: 11px;
  color: var(--color-text-muted);
  position: absolute;
  bottom: 54px;
  right: 8px;
  pointer-events: none;
  font-family: var(--font-display);
}

.feed-comments-char-count.visible {
  display: block;
}

.feed-comments-char-count.danger {
  color: var(--color-error);
}

.feed-comments-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.feed-comments-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-comments-follow-btn {
  margin-left: auto;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid #6D28D9;
  background: transparent;
  color: #6D28D9;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  flex-shrink: 0;
}

.feed-comments-follow-btn.following {
  background: #6D28D9;
  color: #fff;
}

.feed-share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 24px;
}

.feed-share-modal {
  background: var(--color-canvas);
  border-radius: 16px;
  padding: 8px;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.feed-share-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
  font-family: var(--font-display);
  text-align: center;
  padding: 8px 0 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feed-share-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: none;
  background: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-text-primary);
  width: 100%;
  text-align: left;
}

.feed-share-btn:hover {
  background: var(--color-canvas-subtle);
}

.feed-share-cancel {
  margin-top: 4px;
  width: 100%;
  padding: 14px;
  border: none;
  background: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text-muted);
}

.feed-share-cancel:hover {
  background: var(--color-canvas-subtle);
}

.feed-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: #18181b;
  color: #fff;
  font-size: 14px;
  font-family: var(--font-display);
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  z-index: 10000;
  pointer-events: none;
}

.feed-send-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feed-send-modal {
  background: var(--color-canvas);
  border-radius: 16px;
  display: flex;
  overflow: hidden;
  width: 680px;
  max-width: 95vw;
  height: 480px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}

.feed-send-preview {
  width: 240px;
  flex-shrink: 0;
  background: var(--color-canvas-inset);
  overflow: hidden;
}

.feed-send-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-send-picker {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 12px;
  min-width: 0;
}

.feed-send-picker-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  font-family: var(--font-display);
}

.feed-send-search {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  font-size: 14px;
  font-family: var(--font-display);
  color: var(--color-text-primary);
  background: var(--color-canvas-subtle);
  outline: none;
}

.feed-send-search:focus {
  border-color: #6D28D9;
}

.feed-send-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feed-send-empty {
  font-size: 13px;
  color: var(--color-text-muted);
  font-family: var(--font-display);
  padding: 12px 0;
}

.feed-send-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.feed-send-row:hover {
  background: var(--color-canvas-subtle);
}

.feed-send-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-secondary);
  overflow: hidden;
}

.feed-send-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  font-family: var(--font-display);
}

.feed-send-btn {
  padding: 6px 16px;
  border-radius: 999px;
  border: none;
  background: #6D28D9;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  flex-shrink: 0;
}

.feed-send-btn:hover {
  opacity: 0.85;
}

.feed-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.feed-sticker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feed-sticker-modal {
  background: var(--color-canvas);
  border-radius: 16px;
  width: 480px;
  max-width: 95vw;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}

.feed-sticker-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1.5px solid var(--color-border);
  flex-shrink: 0;
}

.feed-sticker-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary);
  font-family: var(--font-display);
}

.feed-sticker-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 6px;
}

.feed-sticker-modal-close:hover {
  background: var(--color-canvas-subtle);
}

.feed-sticker-modal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 20px;
  overflow-y: auto;
}

.feed-sticker-modal-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-canvas-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  transition: transform 0.15s;
}

.feed-sticker-modal-cell:hover {
  transform: scale(1.05);
}

.feed-sticker-modal-cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.feed-sticker-modal-loading,
.feed-sticker-modal-empty {
  font-size: 14px;
  color: var(--color-text-muted);
  font-family: var(--font-display);
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 0;
}

.feed-comments-header-body {
  flex: 1;
  min-width: 0;
}

.feed-comments-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.feed-comments-timestamp {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-left: auto;
}

.feed-comments-caption-wrap {
  position: relative;
  margin-top: 5px;
}

.feed-comments-caption {
  font-size: 14px;
  color: var(--color-text-secondary);
  font-family: var(--font-display);
  line-height: 1.5;
  word-break: break-word;
}

.feed-comments-caption-wrap.is-collapsed .feed-comments-caption {
  max-height: 3em;
  overflow: hidden;
}

.feed-comments-caption-toggle {
  font-size: 13px;
  color: #6D28D9;
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
  display: block;
  margin-top: 2px;
}

.feed-comments-caption-wrap.is-collapsed .feed-comments-caption-toggle {
  position: absolute;
  bottom: 0;
  right: 0;
  background: linear-gradient(to right, transparent, var(--color-canvas) 30%);
  padding-left: 24px;
  margin-top: 0;
}

@media (max-width: 768px) {
  .feed-page-layout {
    flex-direction: column !important;
    min-height: unset !important;
    height: auto !important;
    overflow: visible !important;
  }

  .feed-main {
    padding: 12px 0 !important;
    padding-top: 0 !important;
    gap: 16px !important;
    overflow-y: visible !important;
    min-height: unset !important;
  }

  .feed-post-unit {
    flex-direction: column !important;
    max-width: 100% !important;
    gap: 0 !important;
    padding: 0 !important;
  }

  .feed-card {
    width: 93vw !important;
    max-width: 93vw !important;
    height: auto !important;
    margin: 0 auto !important;
    margin-bottom: 12px !important;
  }

  .feed-card-flipper {
    width: 93vw !important;
    max-width: 93vw !important;
    height: auto !important;
    aspect-ratio: 9/16 !important;
  }

  .feed-card__img {
    width: 93vw !important;
    height: auto !important;
    aspect-ratio: 9/16 !important;
  }

  .feed-comments-col {
    display: none !important;
  }

  .ad-panel {
    display: none !important;
  }
}
