@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&display=swap');

:root {
  --primary: #FFCCBC;
  --primary-dark: #FF8A65;
  --primary-light: #FF5722;
  --primary-pale: #E64A19;
  --accent: #FBE9E7;
  --accent-light: #f4a261;
  --bg: #f0f4f0;
  --bg-card: #ffffff;
  --bg-elevated: #fafcfa;
  --text: #1a2e1a;
  --text-secondary: #5a6e5a;
  --text-muted: #8a9a8a;
  --border: #d4e4d4;
  --border-light: #e8f0e8;
  --shadow-sm: 0 1px 3px rgba(27, 67, 50, 0.06);
  --shadow-md: 0 4px 12px rgba(27, 67, 50, 0.08);
  --shadow-lg: 0 8px 30px rgba(27, 67, 50, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --events: #7b2cbf;
  --events-bg: #f3e8ff;
  --forsale: #0077b6;
  --forsale-bg: #e0f2fe;
  --services: #e76f51;
  --services-bg: #fff1ec;
  --general: #5a6e5a;
  --general-bg: #f0f4f0;
}

::selection {
  background: var(--primary-light);
  color: white;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== HEADER ===== */
.app-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(27, 67, 50, 0.2);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  font-size: 1.75rem;
  background: rgba(255, 255, 255, 0.15);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 300;
}

.btn-create {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(231, 111, 81, 0.3);
  white-space: nowrap;
}

.btn-create:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(231, 111, 81, 0.35);
}

.btn-icon {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ===== MAIN ===== */
.main-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* ===== SEARCH ===== */
.search-bar {
  position: relative;
  margin-bottom: 1rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.85rem 2.5rem 0.85rem 2.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

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

.search-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-pale);
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--border-light);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.15s;
}

.search-clear:hover {
  background: var(--border);
}

/* ===== CATEGORY FILTERS ===== */
.category-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.category-filters::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: var(--bg-card);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.cat-chip:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.cat-chip-active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.cat-chip-active:hover {
  color: white;
  border-color: var(--primary-dark);
}

.cat-emoji {
  font-size: 0.95rem;
}

.cat-count {
  background: rgba(0, 0, 0, 0.08);
  padding: 0.1rem 0.45rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}

.cat-chip-active .cat-count {
  background: rgba(255, 255, 255, 0.25);
}

/* ===== POSTS GRID ===== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
}

/* ===== POST CARD ===== */
.post-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeInUp 0.4s ease both;
}

.post-card:nth-child(1) { animation-delay: 0s; }
.post-card:nth-child(2) { animation-delay: 0.06s; }
.post-card:nth-child(3) { animation-delay: 0.12s; }
.post-card:nth-child(4) { animation-delay: 0.18s; }
.post-card:nth-child(5) { animation-delay: 0.24s; }
.post-card:nth-child(6) { animation-delay: 0.3s; }
.post-card:nth-child(7) { animation-delay: 0.36s; }
.post-card:nth-child(8) { animation-delay: 0.42s; }
.post-card:nth-child(n+9) { animation-delay: 0.48s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.post-pinned {
  border-color: var(--primary-light);
  background: linear-gradient(to bottom, var(--primary-pale), var(--bg-card) 40%);
}

.pin-ribbon {
  background: var(--primary);
  color: white;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 1rem;
  text-align: center;
  letter-spacing: 0.03em;
}

.post-image-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--border-light);
}

.post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-image {
  transform: scale(1.03);
}

.post-body {
  padding: 1rem 1.15rem 1.15rem;
}

.post-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.category-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  letter-spacing: 0.02em;
}

.badge-events {
  background: var(--events-bg);
  color: var(--events);
}

.badge-forsale {
  background: var(--forsale-bg);
  color: var(--forsale);
}

.badge-services {
  background: var(--services-bg);
  color: var(--services);
}

.badge-general {
  background: var(--general-bg);
  color: var(--general);
}

.post-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.post-title {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.post-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-light);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pin-btn:hover, .pin-active {
  border-color: var(--primary-light);
  color: var(--primary);
  background: var(--primary-pale);
}

.delete-btn:hover {
  border-color: #fca5a5;
  color: #dc2626;
  background: #fef2f2;
}

/* ===== LOADING / EMPTY ===== */
.loading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
}

.skeleton-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.skeleton-line {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.skeleton-title {
  height: 20px;
  width: 70%;
}

.skeleton-body {
  height: 14px;
  width: 100%;
}

.skeleton-body-short {
  height: 14px;
  width: 55%;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.empty-title {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 46, 26, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.modal-close:hover {
  background: var(--border);
}

/* ===== FORM ===== */
.create-form {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.category-select-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.cat-select-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-select-btn:hover {
  border-color: var(--primary-light);
}

.cat-select-active {
  border-color: var(--primary);
  background: var(--primary-pale);
  color: var(--primary-dark);
}

.cat-select-emoji {
  font-size: 1.1rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-card);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-pale);
}

.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-card);
  outline: none;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-pale);
}

.image-upload-area {
  display: block;
  cursor: pointer;
}

.file-input-hidden {
  display: none;
}

.upload-placeholder {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: border-color 0.2s, background 0.2s;
}

.upload-placeholder:hover {
  border-color: var(--primary-light);
  background: var(--primary-pale);
}

.upload-icon {
  font-size: 1.75rem;
}

.upload-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.image-preview-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid var(--border);
}

.image-preview {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
}

.image-remove-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.65);
  color: white;
  border: none;
  padding: 0.3rem 0.65rem;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s;
}

.image-remove-btn:hover {
  background: rgba(220, 38, 38, 0.85);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 0.5rem;
}

.btn-cancel {
  padding: 0.7rem 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

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

.btn-submit {
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(45, 106, 79, 0.25);
}

.btn-submit:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(45, 106, 79, 0.3);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .header-inner {
    padding: 1rem;
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .brand-sub {
    display: none;
  }

  .btn-label {
    display: none;
  }

  .btn-create {
    padding: 0.65rem 0.85rem;
  }

  .main-content {
    padding: 1rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .category-select-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-content {
    max-height: 95vh;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .btn-cancel, .btn-submit {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 380px) {
  .cat-chip {
    padding: 0.4rem 0.65rem;
    font-size: 0.75rem;
  }
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to your Community Bulletin Board! This is where you can post and manage announcements for your neighborhood.", "view": "default", "highlight_selector": ".app-header", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Use the category filter chips to browse posts by type — Events, For Sale, Services, or General.", "view": "default", "highlight_selector": ".category-filters", "wait_for": "tap_to_continue"},
  {"step": 3, "narration": "Search for specific announcements using the search bar at the top.", "view": "default", "highlight_selector": ".search-bar", "wait_for": "tap_to_continue"},
  {"step": 4, "narration": "Tap 'New Post' to create an announcement. You can pick a category, write a title and details, and optionally add a photo.", "view": "default", "highlight_selector": ".btn-create", "wait_for": "user_interaction"},
  {"step": 5, "narration": "Each post has a Pin button to keep important announcements at the top, and a Delete button to remove old ones.", "view": "default", "highlight_selector": ".post-actions", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "Pinned posts always appear first with a green highlight so they stand out from regular posts.", "view": "default", "highlight_selector": ".post-pinned", "wait_for": "tap_to_continue"}
]
-->

.auth-gate-state {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.auth-gate-title {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.auth-gate-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.auth-google-btn {
  width: 100%;
  justify-content: center;
}

.auth-gate-cancel {
  width: 100%;
  justify-content: center;
}

.auth-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auth-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.auth-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border-light);
}

.auth-user-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-weight: 700;
}

.auth-user-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.auth-user-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

.auth-switch-btn {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .auth-user-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-switch-btn {
    width: 100%;
  }

  .auth-user-email {
    max-width: 100%;
  }
}

.reaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.25rem 0 0.85rem;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg-card);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.reaction-btn:hover {
  border-color: var(--primary-light);
  background: var(--primary-pale);
  color: var(--primary-dark);
}

.reaction-btn-active {
  border-color: var(--primary);
  background: var(--primary-pale);
  color: var(--primary-dark);
}

.reaction-emoji {
  font-size: 0.95rem;
}

.reaction-label {
  line-height: 1;
}

.reaction-count {
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reaction-btn-active .reaction-count {
  background: rgba(255, 255, 255, 0.45);
  color: var(--primary-dark);
}

@media (max-width: 380px) {
  .reaction-btn {
    padding: 0.32rem 0.55rem;
    font-size: 0.74rem;
  }

  .reaction-label {
    display: none;
  }
}

.board-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-bar {
  margin-bottom: 0.25rem;
}

.auth-user,
.auth-cta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0.9rem 1rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.auth-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.auth-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border-light);
  flex-shrink: 0;
}

.auth-welcome {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.auth-email,
.auth-hint,
.board-gate-note {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-logout {
  padding: 0.6rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-logout:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.auth-status {
  padding: 0.9rem 1rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.presence-panel {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(82, 183, 136, 0.08), rgba(255, 255, 255, 0.92));
}

.presence-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.presence-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.15);
}

.presence-users {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.presence-user {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
}

.presence-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.post-with-reactions {
  display: flex;
  flex-direction: column;
}

.board-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.board-create-btn {
  width: fit-content;
}

.btn-google {
  background: #4285f4;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.28);
}

.btn-google:hover {
  background: #5a95f5;
}

.auth-gate-state {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.auth-gate-title {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.auth-gate-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.auth-google-btn {
  width: 100%;
  justify-content: center;
}

.auth-gate-cancel {
  width: 100%;
  justify-content: center;
}

.auth-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auth-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.auth-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border-light);
}

.auth-user-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-weight: 700;
}

.auth-user-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.auth-user-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

.auth-switch-btn {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .auth-user-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-switch-btn {
    width: 100%;
  }

  .auth-user-email {
    max-width: 100%;
  }

  .auth-user,
  .auth-cta,
  .presence-panel,
  .auth-status {
    padding: 0.85rem;
  }

  .board-actions-row {
    align-items: flex-start;
  }
}

.richtext-composer {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.richtext-toolbar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.richtext-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.55rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  font: inherit;
}

.richtext-tool-btn:hover {
  border-color: var(--primary-light);
  background: var(--primary-pale);
  color: var(--primary-dark);
}

.richtext-textarea {
  min-height: 140px;
}

.richtext-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rich-text-content {
  white-space: normal;
  word-break: break-word;
}

.rich-text-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rich-text-content strong {
  font-weight: 700;
}

.rich-text-content em {
  font-style: italic;
}

.rich-text-content br {
  content: '';
}

.share-control {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.share-feedback {
  font-size: 0.85rem;
  color: var(--muted-text, #6b7280);
  white-space: nowrap;
}

.featured-posts {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
}

.featured-posts-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.featured-posts-title {
  margin: 0;
  font-size: 1.1rem;
}

.featured-posts-subtitle {
  margin: 0;
  color: rgba(0, 0, 0, 0.6);
  font-size: 0.95rem;
}

.featured-posts-list {
  display: grid;
  gap: 1rem;
}

.featured-post-card {
  padding: 1rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.featured-post-badge {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #ffe08a;
  color: #5b3b00;
  font-size: 0.78rem;
  font-weight: 700;
}

.featured-post-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.featured-post-preview {
  margin: 0 0 0.75rem;
  color: rgba(0, 0, 0, 0.75);
}

.reaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.reaction-btn {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #f7f7f7;
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

.featured-post-actions {
  margin-top: 0.85rem;
  display: flex;
  justify-content: flex-end;
}
