/* ══════════════════════════════
   AUTH BAR
   ══════════════════════════════ */
.auth-bar {
  position: sticky;
  top: var(--nav-height);
  z-index: 50;
  background: var(--cream-dark);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--space-3) var(--space-6);
}
.auth-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.auth-guest,
.auth-user,
.auth-sent {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.auth-icon {
  width: 20px;
  height: 20px;
  color: var(--teal-600);
  flex-shrink: 0;
}
.auth-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--slate-dark);
}
.auth-form {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}
.auth-input {
  padding: 8px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  background: var(--white);
  width: 220px;
  transition: border-color var(--duration-fast);
}
.auth-input:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px var(--teal-100);
}
.auth-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-400), var(--teal-600));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  flex-shrink: 0;
}
.auth-welcome {
  font-size: var(--text-sm);
  color: var(--slate-dark);
}
.auth-sent span {
  font-size: var(--text-sm);
  color: var(--green-dark);
  font-weight: 500;
}

@media (max-width: 640px) {
  .auth-form {
    width: 100%;
    margin-left: 0;
    margin-top: var(--space-2);
  }
  .auth-input { flex: 1; width: auto; }
}

/* ══════════════════════════════
   FORUM HERO
   ══════════════════════════════ */
.forum-hero {
  padding: calc(var(--nav-height) + 60px + var(--space-10)) var(--space-6) var(--space-8);
  text-align: center;
}
.forum-hero h1 { margin-bottom: var(--space-3); }
.forum-hero-desc {
  font-size: var(--text-lg);
  color: var(--slate);
  max-width: 520px;
  margin: 0 auto;
}

/* ══════════════════════════════
   FORUM LAYOUT
   ══════════════════════════════ */
.forum-main {
  padding: 0 var(--space-6) var(--space-16);
}
.forum-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-8);
  max-width: var(--max-width);
  margin: 0 auto;
}

@media (max-width: 960px) {
  .forum-layout {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════
   CATEGORY PILLS
   ══════════════════════════════ */
.category-pills {
  display: flex;
  gap: var(--space-2);
  padding-bottom: var(--space-4);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.category-pills::-webkit-scrollbar { display: none; }

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--slate-dark);
  background: var(--gray-100);
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--duration-fast);
}
.cat-pill svg { width: 16px; height: 16px; flex-shrink: 0; }
.cat-pill:hover {
  background: var(--gray-200);
  color: var(--navy);
}
.cat-pill.active {
  background: var(--teal-600);
  color: var(--white);
  border-color: var(--teal-600);
}

/* ══════════════════════════════
   SEARCH BAR
   ══════════════════════════════ */
.forum-search {
  position: relative;
  margin-bottom: var(--space-3);
}
.forum-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--slate);
  pointer-events: none;
}
.forum-search-input {
  width: 100%;
  padding: 10px 40px 10px 40px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  color: var(--navy);
  background: var(--white);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.forum-search-input::placeholder {
  color: var(--slate);
  opacity: 0.7;
}
.forum-search-input:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px var(--teal-100);
}
.forum-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  color: var(--slate);
  transition: color var(--duration-fast), background var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.forum-search-clear svg {
  width: 16px;
  height: 16px;
}
.forum-search-clear:hover {
  color: var(--navy);
  background: var(--gray-100);
}

/* ══════════════════════════════
   CONTROLS BAR
   ══════════════════════════════ */
.controls-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.sort-dropdown {
  padding: 8px 32px 8px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--navy);
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color var(--duration-fast);
  flex-shrink: 0;
}
.sort-dropdown:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px var(--teal-100);
}
.controls-location {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}
.controls-location-icon {
  width: 16px;
  height: 16px;
  color: var(--slate);
  flex-shrink: 0;
}
.controls-select {
  padding: 6px 28px 6px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--navy);
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color var(--duration-fast);
  min-width: 100px;
}
.controls-select:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px var(--teal-100);
}
.controls-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.controls-new-post { flex-shrink: 0; }

@media (max-width: 640px) {
  .controls-bar { gap: var(--space-2); }
  .controls-location { margin-left: 0; width: 100%; }
  .controls-select { flex: 1; min-width: 0; }
}

/* ══════════════════════════════
   POST CARDS (Reddit-style)
   ══════════════════════════════ */
.post-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: var(--space-3);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  transition: box-shadow var(--duration-normal) var(--ease-out),
              border-color var(--duration-fast);
  cursor: pointer;
}
.post-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}

/* Pinned indicator */
.post-card.pinned {
  border-left: 3px solid var(--teal-500);
}

/* New post entrance animation */
.post-card.new-post {
  animation: slideInPost 0.4s var(--ease-out);
}
@keyframes slideInPost {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Vote Column */
.post-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding-top: var(--space-1);
}
.vote-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--slate-light);
  cursor: pointer;
  transition: all var(--duration-fast);
  background: none;
  border: none;
  padding: 0;
}
.vote-btn svg { width: 20px; height: 20px; }
.vote-btn:hover {
  background: var(--teal-100);
  color: var(--teal-600);
}
.vote-btn.active {
  background: var(--teal-100);
  color: var(--teal-600);
}
.vote-btn.active svg { fill: var(--teal-600); }
.vote-count {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--navy);
  line-height: 1;
}

/* Post Content */
.post-content { min-width: 0; }

/* Post Meta */
.post-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}

/* Post Flair Badges */
.post-flair {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}
.flair-lost     { background: var(--red-light); color: var(--coral-dark); }
.flair-sighting { background: var(--amber-light); color: var(--amber-dark); }
.flair-found    { background: var(--green-light); color: var(--green-dark); }
.flair-adoption { background: var(--purple-light); color: var(--purple-dark); }
.flair-question { background: var(--teal-100); color: var(--teal-700); }
.flair-tip      { background: var(--gray-100); color: var(--navy); }

.post-author {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--navy);
}
.meta-dot {
  width: 3px;
  height: 3px;
  background: var(--slate-light);
  border-radius: 50%;
  flex-shrink: 0;
}
.post-time {
  font-size: var(--text-xs);
  color: var(--slate);
}

/* Post Title */
.post-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--navy);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-2);
  transition: color var(--duration-fast);
}
.post-card:hover .post-title { color: var(--teal-600); }

/* Post Preview */
.post-preview {
  font-size: var(--text-sm);
  color: var(--slate-dark);
  line-height: var(--leading-loose);
  margin-bottom: var(--space-3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Post Actions (footer) */
.post-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.post-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  transition: all var(--duration-fast);
  background: none;
  border: none;
}
.post-action svg { width: 16px; height: 16px; }
.post-action:hover {
  background: var(--gray-100);
  color: var(--teal-600);
}

@media (max-width: 640px) {
  .post-card { grid-template-columns: 40px 1fr; }
  .vote-btn { width: 28px; height: 28px; }
  .vote-btn svg { width: 18px; height: 18px; }
  .post-title { font-size: var(--text-base); }
}

/* ══════════════════════════════
   EXTERNAL POST STYLES
   ══════════════════════════════ */

/* External post card — amber accent */
.post-card.external-post {
  border-left: 3px solid var(--amber);
  background: var(--cream);
}

/* Source badge in meta row */
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  background: var(--amber-light);
  color: var(--amber-dark);
}
.source-petfinder { background: #F0F4FF; color: #5046E4; }
.source-reddit_lostpets { background: #FFE8D6; color: #FF4500; }
.source-rss_npr { background: var(--green-light); color: var(--green-dark); }
.source-rescuegroups { background: #E8F5E9; color: #2E7D32; }
.source-socrata_animal_services { background: #E3F2FD; color: #1565C0; }
.source-rss_pawboost { background: #FFF3E0; color: #E65100; }
.source-rss_petfbi { background: #FCE4EC; color: #C62828; }

/* External source icon (replaces vote button on external posts) */
.external-source-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--amber-dark);
  background: var(--amber-light);
}
.external-source-icon svg { width: 18px; height: 18px; }

/* External image thumbnail (feed) */
.post-external-image {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius-md);
}
/* Mini poster in feed card */
.feed-poster-wrap { border-radius: var(--radius-md); overflow: hidden; }
.feed-poster.missing-poster { font-size: 0.85em; }
.feed-poster .poster-banner { padding: 6px 0; font-size: 14px; }
.feed-poster .poster-photo-wrap { max-height: 200px; }
.feed-poster .poster-photo { max-height: 200px; }
.feed-poster .poster-pet-name { font-size: 1.1rem; padding: 6px 12px 2px; }
.feed-poster .poster-details { padding: 0 12px 4px; font-size: 0.8em; }
.feed-poster .poster-last-seen { padding: 6px 12px; margin: 4px 12px 6px; }
.feed-poster .poster-branding { padding: 4px 0; font-size: 9px; }
/* Full uncropped image in modal */
.post-external-image.modal-image {
  max-height: 400px;
  object-fit: contain;
  background: var(--gray-100);
  border-radius: 12px;
  margin-bottom: var(--space-3);
}
/* Image wrap with badge overlay */
.post-image-wrap {
  position: relative;
  margin-bottom: var(--space-3);
  border-radius: var(--radius-md);
  overflow: hidden;
}
/* LOST/FOUND/SIGHTING badge on feed image */
.image-flair-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--white);
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* Stale indicator */
.stale-note {
  font-size: var(--text-xs);
  color: var(--slate-light);
  font-style: italic;
  margin-top: var(--space-1);
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}
.status-resolved { background: var(--green-light); color: var(--green-dark); }
.status-removed { background: var(--gray-200); color: var(--slate); }

/* External banner in post detail modal */
.external-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--amber-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  color: var(--amber-dark);
  flex-wrap: wrap;
}
.external-banner.resolved { background: var(--green-light); color: var(--green-dark); }
.external-banner.removed { background: var(--gray-100); color: var(--slate); }
.external-banner-link {
  margin-left: auto;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}
.external-banner-link:hover { text-decoration: underline; }

/* ══════════════════════════════
   SOURCE FILTER TOGGLE
   ══════════════════════════════ */
.source-filter {
  display: flex;
  gap: 2px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  padding: 2px;
}
.source-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--slate);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast);
  white-space: nowrap;
}
.source-btn:hover { color: var(--navy); }
.source-btn.active {
  background: var(--white);
  color: var(--teal-700);
  box-shadow: var(--shadow-sm);
}

/* ══════════════════════════════
   BOOKMARK BUTTON
   ══════════════════════════════ */
.bookmark-btn {
  color: var(--slate-light);
  transition: all var(--duration-fast);
}
.bookmark-btn:hover { color: var(--amber-dark); }
.bookmark-btn.active { color: var(--amber-dark); }
.bookmark-btn.active svg { fill: var(--amber-dark); }

/* View on source link */
.post-action.external-link {
  color: var(--teal-600);
  text-decoration: none;
}
.post-action.external-link:hover { background: var(--teal-100); }

/* ══════════════════════════════
   SOURCES SIDEBAR WIDGET
   ══════════════════════════════ */
.source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: var(--text-sm);
}
.source-item:last-child { border-bottom: none; }
.source-item-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.source-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}
.source-item-dot.disabled { background: var(--gray-300); }
.source-count {
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

@media (max-width: 640px) {
  .source-filter {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .source-filter::-webkit-scrollbar { display: none; }
}

/* (Location picker styles removed — now inline in controls-bar) */

/* ══════════════════════════════
   POST SKELETONS
   ══════════════════════════════ */
.post-skeleton {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: var(--space-3);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}
.skel-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.skel-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.skel-line {
  height: 14px;
  background: var(--gray-100);
  border-radius: 4px;
  animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ══════════════════════════════
   EMPTY STATE
   ══════════════════════════════ */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  background: var(--white);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-xl);
}
.empty-icon {
  width: 56px;
  height: 56px;
  color: var(--gray-300);
  margin: 0 auto var(--space-4);
}
.empty-state h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}
.empty-state p {
  font-size: var(--text-sm);
  color: var(--slate);
  margin-bottom: var(--space-6);
}

/* ══════════════════════════════
   LOAD MORE
   ══════════════════════════════ */
.load-more-wrap {
  text-align: center;
  padding: var(--space-6) 0;
}

/* ══════════════════════════════
   SIDEBAR
   ══════════════════════════════ */
.forum-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.sidebar-widget {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.widget-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--space-4) var(--space-5);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--navy);
}
.widget-header svg { width: 18px; height: 18px; color: var(--teal-600); flex-shrink: 0; }
.widget-body { padding: var(--space-5); }

.widget-desc {
  font-size: var(--text-sm);
  color: var(--slate);
  line-height: var(--leading-loose);
  margin-bottom: var(--space-4);
}

.widget-stats {
  display: flex;
  gap: var(--space-6);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: var(--space-3);
}
.widget-stat {
  display: flex;
  flex-direction: column;
}
.widget-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
}
.widget-stat-label {
  font-size: var(--text-xs);
  color: var(--slate);
}
.widget-created {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--slate);
}

/* Quick Actions */
.widget-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.widget-action-btn {
  width: 100%;
  justify-content: center;
}

/* Rules */
.rules-list {
  list-style: decimal;
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.rules-list li {
  font-size: var(--text-sm);
  color: var(--slate-dark);
  line-height: var(--leading-normal);
}
.rules-list li strong {
  color: var(--navy);
}

/* Trending Tags */
.trending-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.trending-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--gray-100);
  color: var(--teal-700);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  transition: all var(--duration-fast);
}
.trending-tag:hover {
  background: var(--teal-100);
  color: var(--teal-700);
}

@media (max-width: 960px) {
  .forum-sidebar { order: 2; }
}

/* ══════════════════════════════
   MODALS (Post Detail + Compose)
   ══════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-10) var(--space-4);
  overflow-y: auto;
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-container {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s var(--ease-out);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 1;
}
.modal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--slate);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all var(--duration-fast);
}
.modal-back svg { width: 18px; height: 18px; }
.modal-back:hover { background: var(--gray-100); color: var(--navy); }
.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--slate);
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast);
}
.modal-close svg { width: 20px; height: 20px; }
.modal-close:hover { background: var(--gray-100); color: var(--navy); }

.modal-body { padding: 0; }
.modal-body-content { padding: var(--space-6); }

/* ── Post Detail Content ── */
.detail-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.detail-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.detail-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-400), var(--teal-600));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.detail-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--navy);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

.detail-body {
  font-size: var(--text-base);
  color: var(--slate-dark);
  line-height: var(--leading-loose);
  margin-bottom: var(--space-6);
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-stats {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: var(--space-6);
}
.detail-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  background: none;
  border: none;
  transition: all var(--duration-fast);
}
.detail-stat svg { width: 18px; height: 18px; }
.detail-stat:hover { background: var(--gray-100); color: var(--teal-600); }
.detail-stat.voted { color: var(--teal-600); }
.detail-stat.voted svg { fill: var(--teal-600); }

/* ── Comments Thread ── */
.comments-header {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--space-4);
}

.comment {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}
.comment + .comment {
  border-top: 1px solid var(--gray-100);
}

/* Depth indentation */
.comment.depth-1 { margin-left: 40px; padding-left: var(--space-4); border-left: 2px solid var(--gray-200); }
.comment.depth-2 { margin-left: 80px; padding-left: var(--space-4); border-left: 2px solid var(--gray-200); }
.comment.depth-3 { margin-left: 120px; padding-left: var(--space-4); border-left: 2px solid var(--gray-200); }

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-400), var(--teal-600));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}

.comment-content { min-width: 0; }
.comment-header-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
  flex-wrap: wrap;
}
.comment-author {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--navy);
}
.comment-badge {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}
.comment-badge.op { background: var(--teal-100); color: var(--teal-700); }
.comment-time {
  font-size: var(--text-xs);
  color: var(--slate-light);
}

.comment-body {
  font-size: var(--text-sm);
  color: var(--slate-dark);
  line-height: var(--leading-loose);
  margin-bottom: var(--space-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.comment-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color var(--duration-fast);
}
.comment-action:hover { color: var(--teal-600); }

/* Reply Input */
.comment-reply-form {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--gray-200);
}
.comment-reply-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background: var(--gray-50);
  transition: all var(--duration-fast);
  resize: none;
}
.comment-reply-input:focus {
  outline: none;
  border-color: var(--teal-500);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--teal-100);
}

@media (max-width: 640px) {
  .comment.depth-1 { margin-left: 20px; }
  .comment.depth-2 { margin-left: 40px; }
  .comment.depth-3 { margin-left: 60px; }
}

/* ══════════════════════════════
   COMPOSE MODAL
   ══════════════════════════════ */
.modal-compose { max-width: 600px; }
.compose-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--navy);
}
.compose-form { padding: var(--space-6); }
.compose-field {
  margin-bottom: var(--space-5);
}
.compose-field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--space-2);
}
.field-optional {
  font-weight: 400;
  color: var(--slate-light);
}
.field-required { color: var(--coral); }

.compose-select,
.compose-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background: var(--gray-50);
  color: var(--navy);
  transition: all var(--duration-fast);
}
.compose-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background: var(--gray-50);
  color: var(--navy);
  resize: vertical;
  min-height: 120px;
  transition: all var(--duration-fast);
}
.compose-select:focus,
.compose-input:focus,
.compose-textarea:focus {
  outline: none;
  border-color: var(--teal-500);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--teal-100);
}

/* Flair pills in compose */
.flair-pills {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.flair-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all var(--duration-fast);
  opacity: 0.5;
  border: 2px solid transparent;
}
.flair-pill:hover { opacity: 0.8; }
.flair-pill.selected { opacity: 1; border-color: currentColor; }

.compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--gray-100);
}

/* ══════════════════════════════
   TOAST
   ══════════════════════════════ */
/* .toast styles moved to base.css */

/* ══════════════════════════════
   CTA (same as home/store)
   ══════════════════════════════ */
/* CTA section styles moved to base.css */

/* ══════════════════════════════
   ANIMAL TYPE CARDS
   ══════════════════════════════ */
.post-card.external-dog  { border-left-color: var(--blue); }
.post-card.external-cat  { border-left-color: var(--purple); }
.post-card.external-bird { border-left-color: var(--green); }

.animal-type-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}
.animal-type-icon svg { width: 20px; height: 20px; }
.animal-type-icon.icon-dog  { background: var(--blue-light); color: var(--blue); }
.animal-type-icon.icon-cat  { background: var(--purple-light); color: var(--purple); }
.animal-type-icon.icon-bird { background: var(--green-light); color: var(--green); }
.animal-type-icon.icon-other { background: var(--amber-light); color: var(--amber-dark); }

/* Attribute Chips */
.attribute-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-2);
}
.attr-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--slate-dark);
  line-height: 1.2;
}
.attr-chip svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ══════════════════════════════
   MODAL HERO HEADER
   ══════════════════════════════ */
.modal-hero {
  padding: var(--space-6) var(--space-6) var(--space-5);
  background: linear-gradient(135deg, var(--teal-600), var(--teal-800, #115E59));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.modal-hero.external {
  background: linear-gradient(135deg, #B45309, #92400E);
}
.modal-hero.hero-lost {
  background: linear-gradient(135deg, #DC2626, #991B1B);
}
.modal-hero.hero-found {
  background: linear-gradient(135deg, #059669, #047857);
}
.modal-hero.hero-adoption {
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
}
/* Blurred photo background hero for app lost/found posts */
.modal-hero.hero-photo-bg {
  background: #1E293B;
}
.modal-hero.hero-photo-bg::before {
  content: '';
  position: absolute;
  inset: -20px;
  background-image: var(--hero-bg-image);
  background-size: cover;
  background-position: center;
  filter: blur(20px) brightness(0.5);
  z-index: 0;
}
.modal-hero.hero-photo-bg > * {
  position: relative;
  z-index: 1;
}
.modal-hero-badges {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}
.modal-hero-badges .post-flair,
.modal-hero-badges .source-badge {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
}
.modal-hero-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-3);
  color: var(--white);
}
.modal-hero-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.8);
}
.modal-hero-author .detail-avatar {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Info Card Grid */
.info-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.info-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-3);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
}
.info-card-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--slate);
}
.info-card-label svg { width: 12px; height: 12px; }
.info-card-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
}

@media (max-width: 640px) {
  .modal-hero { padding: var(--space-4) var(--space-4) var(--space-3); }
  .modal-hero-title { font-size: var(--text-xl); }
  .info-card-grid { grid-template-columns: 1fr 1fr; }
}

/* ══════════════════════════════
   MISSING PET POSTER CARD
   ══════════════════════════════ */
.missing-poster {
  max-width: 420px;
  margin: 0 auto var(--space-5);
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--gray-200);
}
.poster-banner {
  padding: 14px 20px;
  text-align: center;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.poster-photo-wrap {
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}
.poster-photo {
  width: 100%;
  max-height: 350px;
  object-fit: contain;
  display: block;
}
.poster-pet-name {
  text-align: center;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 16px 20px 4px;
}
.poster-details {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--slate);
  padding: 0 20px 12px;
}
.poster-last-seen {
  text-align: center;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--gray-200);
  margin: 0 20px;
}
.poster-last-seen-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate);
  margin-bottom: 6px;
}
.poster-last-seen-address {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
}
.poster-last-seen-date {
  font-size: var(--text-xs);
  color: var(--slate-light);
  margin-top: 4px;
}
.poster-branding {
  text-align: center;
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-light);
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  letter-spacing: 0.04em;
}

/* Download poster button in stats bar */
.poster-download-btn {
  color: var(--teal-600) !important;
}
.poster-download-btn:hover {
  background: var(--teal-100) !important;
  color: var(--teal-700) !important;
}

@media (max-width: 640px) {
  .missing-poster { margin-left: -8px; margin-right: -8px; border-radius: 12px; }
  .poster-banner { font-size: 18px; padding: 12px 16px; }
  .poster-pet-name { font-size: 22px; }
}

/* ══════════════════════════════
   REDUCED MOTION
   ══════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .post-card.new-post,
  .modal-overlay,
  .modal-container,
  .toast {
    animation: none;
  }
  .skel-line { animation: none; opacity: 0.5; }
}
