/* ============================================
   THREADTALK STYLES - Facebook-inspired, Hemline branded
   ============================================ */

:root {
  --tt-bg: #faf8f5;
  --tt-card: #ffffff;
  --tt-border: #ebe6e0;
  --tt-text: #1c1e21;
  --tt-muted: #65676b;
  --tt-accent: #991b1b;
  --tt-accent-hover: #7f1d1d;
  --tt-comment-bg: #f5f2ef;
}

/* ============================================
   PAGE BACKGROUND - Warm cream with subtle image
   ============================================ */
html.tt-page,
body.tt-page {
  overflow-x: hidden;
  max-width: 100vw;
}

body.tt-page {
  background: 
    linear-gradient(to bottom, rgba(250,248,245,0.95) 0%, rgba(250,248,245,0.85) 100%),
    url('../images/studio.jpeg') center 80%/cover no-repeat fixed !important;
  min-height: 100vh;
}

/* ============================================
   MAIN WRAPPER - Condensed
   ============================================ */
.tt-wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 12px;
}

/* ============================================
   HERO BANNER - Image at bottom
   ============================================ */
.tt-hero {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 12px;
  background: var(--tt-card);
}

.tt-hero-banner {
  height: 140px;
  background: 
    linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.4) 100%),
    url('../images/studio.jpeg') center 85%/cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 20px;
}

.tt-hero-banner h1 {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  font-family: system-ui, -apple-system, sans-serif;
}

.tt-hero-banner .sub {
  font-size: 14px;
  color: rgba(255,255,255,0.9);
  margin: 4px 0 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* ============================================
   COMPOSER - Clean Facebook style (no gap below)
   ============================================ */
.composer {
  background: var(--tt-card);
  padding: 12px 16px 8px;
  border-top: 1px solid var(--tt-border);
}

.composer-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.composer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(153, 27, 27, 0.2);
}

.composer-avatar svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

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

.composer-input-wrap {
  flex: 1;
}

.composer-title {
  flex: 1;
  min-width: 150px;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  background: var(--tt-bg);
  color: var(--tt-text);
  outline: none;
  transition: background 0.15s;
}

.composer-title:focus {
  background: #f0e6e6;
}

.composer-title::placeholder {
  color: var(--tt-muted);
  font-weight: 400;
}

/* Title row with inline category dropdown */
.composer-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.composer-category-inline {
  flex-shrink: 0;
}

.composer-category-inline select {
  padding: 10px 32px 10px 12px;
  border: 1px solid var(--tt-border);
  border-radius: 20px;
  background: var(--tt-bg);
  font-size: 13px;
  font-weight: 500;
  color: var(--tt-text);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2365676b'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 18px;
  transition: background 0.15s, border-color 0.15s;
}

.composer-category-inline select:focus {
  border-color: var(--tt-accent);
  background-color: #f0e6e6;
}

.composer-category-label {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--tt-border);
  border-radius: 20px;
  background: var(--tt-bg);
  font-size: 13px;
  font-weight: 500;
  color: var(--tt-text);
}

.composer-avatar-spacer {
  width: 40px;
  flex-shrink: 0;
}

/* Body row - full width textarea */
.composer-body-row {
  padding: 8px 12px 6px;
}

.composer-input {
  width: 100%;
  border: 1px solid var(--tt-border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  background: var(--tt-bg);
  color: var(--tt-text);
  resize: none;
  outline: none;
  transition: background 0.15s, border-color 0.15s;
  min-height: 80px;
  line-height: 1.5;
}

.composer-input:focus {
  background: #f0e6e6;
}

.composer-input::placeholder {
  color: var(--tt-muted);
}

.composer-divider {
  height: 1px;
  background: var(--tt-border);
  margin: 6px 0;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.composer-tools {
  display: flex;
  gap: 2px;
}

.composer-tool {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--tt-muted);
  cursor: pointer;
  transition: background 0.15s;
}

.composer-tool:hover {
  background: var(--tt-bg);
}

.composer-tool svg {
  width: 18px;
  height: 18px;
}

.composer-tool.photo svg { fill: #45bd62; }
.composer-tool.video svg { fill: #f3425f; }
.composer-tool.category svg { fill: #f7b928; }

.composer-tool select {
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  outline: none;
  padding-right: 4px;
}

.composer-submit {
  padding: 8px 20px;
  border-radius: 6px;
  border: none;
  background: var(--tt-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.composer-submit:hover {
  background: var(--tt-accent-hover);
}

.composer-submit:disabled {
  background: #e4d4d4;
  color: #a89999;
  cursor: not-allowed;
}

.composer input[type="file"] { display: none; }

/* Media Preview for composer - no gap when empty */
.media-preview {
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.media-preview:empty,
.media-preview[hidden] {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
  height: 0 !important;
}

.media-preview img,
.media-preview video {
  max-height: 120px;
  border-radius: 8px;
  border: 1px solid var(--tt-border);
}

.media-preview-item {
  position: relative;
}

.media-preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--tt-accent);
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ============================================
   TOPIC PILLS - Clickable category links
   ============================================ */
.topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: linear-gradient(120deg, #3b1010, #991b1b);
  border-radius: 12px;
  border: 1px solid rgba(153,27,27,0.45);
}

.topic {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: rgba(254,243,199,0.95);
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #7f1d1d;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.topic::after {
  content: '→';
  font-size: 11px;
  opacity: 0.6;
  transition: transform 0.15s, opacity 0.15s;
}

.topic:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.topic:hover::after {
  transform: translateX(2px);
  opacity: 1;
}

.topic:active {
  transform: translateY(0);
}

.topic.active {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Mobile: 2 rows of 4 pills - matching index page style */
@media (max-width: 640px) {
  .tt-wrap {
    padding: 8px;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .topics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: 4px;
    column-gap: 4px;
    padding: 10px 8px;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
    max-width: 100%;
  }
  
  .topic {
    padding: 6px 4px;
    font-size: 10px;
    justify-content: center;
    text-align: center;
    min-width: 0;
    white-space: normal;
    line-height: 1.2;
  }
  
  .topic::after {
    display: none;
  }
}

/* ============================================
   SEARCH BAR - Friendly and clear
   ============================================ */
.tt-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 4px;
}

.tt-search-input {
  flex: 1;
  padding: 12px 16px;
  padding-left: 44px;
  border: 2px solid var(--tt-border);
  border-radius: 12px;
  background: var(--tt-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23991b1b'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") 14px center/20px no-repeat;
  font-size: 15px;
  color: var(--tt-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tt-search-input:focus {
  border-color: var(--tt-accent);
  box-shadow: 0 0 0 3px rgba(153,27,27,0.1);
}

.tt-search-input::placeholder {
  color: var(--tt-muted);
}

/* ============================================
   FEED HEADER
   ============================================ */
.feed-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--tt-muted);
  margin: 0 0 12px 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   POST CARDS - Clean white on cream
   ============================================ */
.cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--tt-card);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
}

/* Card Header - Condensed */
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px 0;
}

.card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(153, 27, 27, 0.2);
}

.card-avatar-link,
.comment-avatar-link {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: opacity 0.15s;
}

.card-avatar-link:hover,
.comment-avatar-link:hover {
  opacity: 0.8;
}

.card-avatar svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

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

.card-meta {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.card-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--tt-text);
  text-decoration: none;
}

.card-author:hover {
  text-decoration: underline;
}

.card-info {
  font-size: 12px;
  color: var(--tt-muted);
  margin-top: 1px;
}

.card-info a {
  color: var(--tt-accent);
  text-decoration: none;
  font-weight: 500;
}

.card-info a:hover {
  text-decoration: underline;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--tt-text);
  margin: 3px 0 0;
}

.card-menu {
  padding: 4px 8px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: var(--tt-muted);
  font-size: 16px;
  line-height: 1;
}

.card-menu:hover {
  background: var(--tt-bg);
}

/* Card Body - Tight */
.card-body {
  padding: 8px 14px 10px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--tt-text);
}

.card-body a {
  color: var(--tt-accent);
}

/* Card Media */
.card-media img,
.card-media video {
  width: 100%;
  display: block;
}

/* Reactions Summary */
.card-reactions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--tt-muted);
}

/* Action Bar - Like, Comment, Share */
.card-actions {
  display: flex;
  padding: 6px 12px;
  border-top: 1px solid var(--tt-border);
  gap: 4px;
}

/* Like wrapper with reaction picker */
.tt-like-wrapper {
  position: relative;
}

/* Comment-specific like wrapper */
.comment-like-wrapper {
  display: inline-block;
}

.comment-react-picker {
  bottom: 100%;
  left: -10px;
}

.tt-react-picker {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 8px;
  padding: 6px 8px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  gap: 4px;
  z-index: 100;
}

.tt-like-wrapper.tt-picker-open .tt-react-picker {
  display: flex;
}

.tt-react-picker button {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tt-react-picker button:hover {
  transform: scale(1.3);
  background: #f3f4f6;
}

.card-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tt-muted);
  cursor: pointer;
  transition: background 0.15s;
}

.card-action:hover {
  background: var(--tt-bg);
}

.card-action.active {
  color: var(--tt-accent);
}

.card-action svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.card-action.share-btn {
  margin-left: auto;
  padding: 8px 14px;
  color: var(--tt-accent);
  position: relative;
}

.card-action.share-btn:hover {
  background: #fef7f7;
}

/* Share tooltip - appears next to button */
.share-tooltip {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 8px;
  padding: 6px 12px;
  background: #15803d;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  white-space: nowrap;
  animation: tooltipFade 1.5s ease-out forwards;
  z-index: 100;
}

.share-tooltip::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #15803d;
}

@keyframes tooltipFade {
  0% { opacity: 0; transform: translateY(-50%) translateX(10px); }
  15% { opacity: 1; transform: translateY(-50%) translateX(0); }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

/* ============================================
   COMMENTS SECTION - Tight spacing
   ============================================ */
.card-comments {
  padding: 8px 14px 10px;
  border-top: 1px solid var(--tt-border);
}

.view-comments {
  display: block;
  padding: 4px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tt-muted);
  background: none;
  border: none;
  cursor: pointer;
}

.view-comments:hover {
  text-decoration: underline;
}

/* Comments List */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Individual Comment - Condensed with consistent menu */
.comment,
.tt-comment {
  display: flex;
  gap: 6px;
  padding: 3px 0;
  position: relative;
}

.comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 1.5px solid rgba(153, 27, 27, 0.2);
}

.comment-avatar svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

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

.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-bubble {
  display: inline-block;
  background: var(--tt-comment-bg);
  border-radius: 14px;
  padding: 6px 10px;
  max-width: 100%;
  position: relative;
}

.comment-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--tt-text);
  text-decoration: none;
}

.comment-author:hover {
  text-decoration: underline;
}

.comment-text {
  font-size: 13px;
  color: var(--tt-text);
  margin-top: 1px;
  line-height: 1.3;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 1px 10px;
  font-size: 11px;
  color: var(--tt-muted);
}

.comment-meta button {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--tt-muted);
  cursor: pointer;
  padding: 0;
}

.comment-meta button:hover {
  text-decoration: underline;
}

.comment-meta button.active {
  color: var(--tt-accent);
}

/* ============================================
   COMMENT MENU - Consistent with main post menu
   ============================================ */
.tt-menu {
  position: relative;
}

.tt-menu-btn {
  padding: 4px 8px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: var(--tt-muted);
  font-size: 16px;
  line-height: 1;
}

.tt-menu-btn:hover {
  background: var(--tt-bg);
}

.tt-menu-pop {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--tt-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
  min-width: 120px;
  overflow: hidden;
}

.tt-menu-pop[hidden] {
  display: none;
}

.tt-menu-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--tt-text);
  cursor: pointer;
  transition: background 0.15s;
}

.tt-menu-item:hover {
  background: var(--tt-bg);
}

.tt-menu-item.danger {
  color: #dc2626;
}

.tt-menu-item.danger:hover {
  background: #fef2f2;
}

/* Comment bubble row - flex container for bubble + menu */
.comment-bubble-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

/* Comment-specific menu positioning */
.tt-menu-comment {
  position: relative;
  flex-shrink: 0;
}

.tt-menu-comment .tt-menu-btn {
  padding: 2px 6px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.15s;
}

/* Show menu button on hover for ALL comments including nested */
.tt-comment:hover .tt-menu-comment .tt-menu-btn,
.comment:hover .tt-menu-comment .tt-menu-btn,
.comment-bubble-row:hover .tt-menu-comment .tt-menu-btn {
  opacity: 1;
}

/* Reply box inside comments */
.tt-comment-reply-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 0;
}

.tt-comment-reply-box[hidden] {
  display: none;
}

.tt-comment-reply-box .reply-avatar {
  width: 24px;
  height: 24px;
}

.tt-comment-reply-box .tt-comment-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--tt-border);
  border-radius: 18px;
  font-size: 13px;
  background: var(--tt-bg);
  outline: none;
}

.tt-comment-reply-box .tt-comment-input:focus {
  border-color: var(--tt-accent);
}

.tt-comment-reply-box .comment-send {
  padding: 6px 14px;
  border: none;
  border-radius: 18px;
  background: var(--tt-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tt-comment-reply-box .comment-send:hover {
  background: #7f1d1d;
}

/* Nested comments */
.comment.nested,
.tt-comment.nested {
  margin-left: 30px;
  overflow: visible;
}

.comment.nested-deep,
.tt-comment.nested-deep {
  margin-left: 46px;
  overflow: visible;
}

/* Ensure comment content and bubble don't clip the menu */
.comment-content,
.comment-bubble {
  overflow: visible;
}

/* Comment Input Row */
.comment-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 0;
}

.comment-input {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 18px;
  background: var(--tt-comment-bg);
  font-size: 13px;
  outline: none;
  transition: background 0.15s;
}

.comment-input:focus {
  background: #ebe6e0;
}

.comment-input::placeholder {
  color: var(--tt-muted);
}

.comment-tools {
  display: flex;
  gap: 0;
}

.comment-tool {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.comment-tool:hover {
  background: var(--tt-comment-bg);
}

.comment-tool svg {
  width: 16px;
  height: 16px;
}

.comment-tool.photo svg { fill: #45bd62; }
.comment-tool.video svg { fill: #f3425f; }

.comment-send {
  padding: 6px 12px;
  border: none;
  border-radius: 16px;
  background: var(--tt-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.comment-send:hover {
  background: var(--tt-accent-hover);
}

/* ============================================
   REACTION CHIPS (for both posts and comments)
   ============================================ */
.tt-react-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tt-react-summary-comment {
  margin-left: auto;
}

.tt-react-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  background: var(--tt-comment-bg);
  border-radius: 999px;
  font-size: 11px;
}

.tt-react-emoji {
  font-size: 12px;
}

.tt-react-count {
  font-weight: 600;
  color: var(--tt-muted);
}

/* ============================================
   EMPTY STATE
   ============================================ */
#emptyState {
  text-align: center;
  padding: 40px 20px;
  background: var(--tt-card);
  border-radius: 10px;
  color: var(--tt-muted);
  font-size: 15px;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #1c1e21;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 200;
}

.toast.show {
  opacity: 1;
}

/* ============================================
   IMAGE ZOOM MODAL
   ============================================ */
#tt-zoom-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

#tt-zoom-modal.show {
  opacity: 1;
  visibility: visible;
}

#tt-zoom-modal .tt-zoom-backdrop {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

#tt-zoom-modal .tt-zoom-inner {
  position: relative;
  z-index: 1;
}

#tt-zoom-modal .tt-zoom-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#tt-zoom-modal .tt-zoom-close:hover {
  background: rgba(255,255,255,0.3);
}

#tt-zoom-modal .tt-zoom-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

/* ============================================
   LINK PREVIEW CARDS
   ============================================ */
.tt-link-preview-wrap {
  padding: 0 14px 10px;
}

.tt-link-card {
  display: flex;
  border: 1px solid var(--tt-border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.tt-link-card:hover {
  background: var(--tt-bg);
}

.tt-link-thumb {
  width: 120px;
  min-height: 80px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.tt-link-meta {
  flex: 1;
  padding: 10px 12px;
  min-width: 0;
}

.tt-link-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--tt-text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tt-link-host {
  font-size: 11px;
  color: var(--tt-muted);
  margin-top: 4px;
}

/* ============================================
   YOUTUBE EMBED
   ============================================ */
.tt-youtube-embed {
  padding: 0 14px 10px;
  max-width: 480px;
}

.tt-youtube-embed iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: none;
}

/* ============================================
   TIKTOK EMBED
   ============================================ */
.tt-tiktok-embed {
  padding: 0 14px 10px;
  display: flex;
  justify-content: center;
}

.tt-tiktok-embed iframe {
  border: none;
  border-radius: 12px;
  max-width: 325px;
  width: 100%;
  height: 580px;
}

/* TikTok preview card (for photo posts) */
.tt-tiktok-card .tt-tiktok-thumb {
  background: linear-gradient(135deg, #00f2ea 0%, #ff0050 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  min-height: 80px;
}

.tt-tiktok-card .tt-tiktok-thumb svg {
  width: 40px;
  height: 40px;
  color: white;
}

/* ============================================
   POST MEDIA STYLES
   ============================================ */
.post-media-wrap {
  margin: 8px 0;
  text-align: center;
}

.post-img {
  max-width: 200px;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: cover;
  cursor: zoom-in;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.post-img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.post-media-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  max-width: 400px;
  margin: 0 auto;
}

.post-media-grid .post-img-multi {
  width: 100%;
  height: 150px;
  object-fit: cover;
  cursor: zoom-in;
}

.post-video {
  width: 100%;
  max-height: 500px;
  border-radius: 8px;
}

.tt-comment-media {
  margin: 6px 0;
}

.tt-comment-media .post-img {
  max-height: 200px;
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */
.back-to-top-pill {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: #991b1b;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(153, 27, 27, 0.4);
  z-index: 99999;
  display: none;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s, background 0.2s;
}

.back-to-top-pill:hover {
  transform: scale(1.05);
  background: #7f1d1d;
}

.back-to-top-pill svg {
  flex-shrink: 0;
}

/* ============================================
   UTILITIES
   ============================================ */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .tt-wrap {
    padding: 8px;
  }
  
  .tt-hero-banner {
    height: 120px;
    padding: 12px 16px;
  }
  
  .tt-hero-banner h1 {
    font-size: 22px;
  }
  
  .composer-tool span {
    display: none;
  }
  
  .topics {
    gap: 6px;
  }
  
  .topic {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .card-header {
    padding: 10px 12px 0;
  }
  
  .card-body {
    padding: 6px 12px 8px;
  }
  
  .card-comments {
    padding: 6px 12px 8px;
  }
  
  /* Mobile images - small thumbnails, tap to zoom */
  .post-img {
    max-width: 120px;
    max-height: 120px;
  }
  
  .post-media-grid .post-img-multi {
    height: 100px;
  }
  
  .tt-comment-media .post-img {
    max-width: 80px;
    max-height: 80px;
  }
}

/* ============================================
   EDIT POST STYLES - Facebook-style
   ============================================ */
.tt-edit-container {
  background: #fff;
  border-radius: 8px;
}

.tt-edit-area {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: none;
  font: inherit;
  font-size: 15px;
  resize: none;
  outline: none;
  border-bottom: 1px solid var(--tt-border);
}

.tt-edit-current-media {
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tt-edit-media-item {
  position: relative;
  display: inline-block;
}

.tt-edit-media-item img,
.tt-edit-media-item video {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  object-fit: cover;
}

.tt-edit-remove-media,
.tt-edit-remove-new-media {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.tt-edit-remove-media:hover,
.tt-edit-remove-new-media:hover {
  background: rgba(0, 0, 0, 0.8);
}

.tt-edit-link-preview-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f5f5f5;
  border-radius: 8px;
  margin: 8px 12px;
  font-size: 14px;
  color: #666;
}

.tt-edit-remove-link-preview {
  background: none;
  border: none;
  color: var(--tt-accent);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
}

.tt-edit-remove-link-preview:hover {
  text-decoration: underline;
}

.tt-edit-new-media {
  padding: 0 12px;
}

.tt-edit-new-media-preview {
  margin-bottom: 8px;
}

.tt-edit-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-top: 1px solid var(--tt-border);
}

.tt-edit-add-media {
  display: flex;
  gap: 4px;
}

.tt-edit-add-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: #65676b;
  transition: background 0.15s;
}

.tt-edit-add-btn:hover {
  background: #f0f0f0;
}

.tt-edit-buttons {
  display: flex;
  gap: 8px;
}

.tt-edit-cancel-btn,
.tt-edit-save-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.tt-edit-cancel-btn {
  background: #e4e6eb;
  color: #050505;
}

.tt-edit-cancel-btn:hover {
  background: #d8dadf;
}

.tt-edit-save-btn {
  background: var(--tt-accent);
  color: white;
}

.tt-edit-save-btn:hover {
  background: var(--tt-accent-hover);
}

.tt-edit-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
