:root {
  --bg: #eef2ee;
  --panel: rgba(253, 250, 240, 0.88);
  --border: #c9d6c9;
  --text: #1f2b22;
  --muted: #5c6b5f;
  --brand: #2f6f4f;
  --brand-dark: #204d37;
  --accent: #c67a2e;
  --online: #1c8c6e;
  --river: #2d6a8f;
  --radius: 10px;
}

h1, h2, h3, h4, .brand, .topnav a, .section-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, #eef2ee 0%, #e6ede6 100%);
  color: var(--text);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  padding: 0 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 60;
}
.topbar-inner {
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 56px;
  padding: 0 24px;
}
.nav-group { display: flex; align-items: center; gap: 18px; }
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  position: relative;
}
.brand {
  color: #fff;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  justify-self: start;
}
.brand span { color: #ffd43b; }
.brand:hover { text-decoration: none; }

.topnav { display: flex; align-items: center; gap: 18px; }
.topnav a { color: #f1f3ff; font-weight: 600; padding: 6px 4px; border-bottom: 2px solid transparent; }
.topnav a:hover { color: #fff; text-decoration: none; }
.topnav a.active { color: #fff; border-bottom-color: #ffd43b; }
.logout-form { margin: 0; }
.logout-form button {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.logout-form button:hover { background: rgba(255,255,255,0.3); }

.page-wrap {
  max-width: 1300px;
  margin: 20px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 240px minmax(0, 680px) 240px;
  gap: 24px;
  align-items: start;
  justify-content: center;
}
@media (max-width: 1100px) {
  .page-wrap { grid-template-columns: 240px minmax(0, 680px); }
  .sidebar-right { display: none; }
}
@media (max-width: 800px) {
  .page-wrap { grid-template-columns: 1fr; }
}
.page-wrap.no-sidebar {
  grid-template-columns: 1fr;
  justify-items: center;
}

.sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; min-width: 0; }
.sidebar-right { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; min-width: 0; }
.widget {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.widget h3 {
  margin: 0 0 10px 0;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge {
  background: var(--online);
  color: #fff;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.75rem;
  font-weight: 700;
}

.top-friends-list, .online-list, .friend-grid { list-style: none; margin: 0; padding: 0; }
.top-friends-list li, .online-list li { margin-bottom: 8px; }
.top-friends-list a, .online-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.top-friends-list a:hover, .online-list a:hover { text-decoration: none; color: var(--brand); }

.avatar-sm { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); }
.avatar-md { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }
.avatar-lg { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; border: 2px solid var(--border); }

.dot-online {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--online);
  margin-left: auto;
  flex-shrink: 0;
}

.muted { color: var(--muted); font-size: 0.9rem; }

.content { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.compose textarea {
  width: 100%;
  min-height: 70px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
}
.compose-row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 10px; flex-wrap: wrap; }
.compose-row input[type=file] { font-size: 0.85rem; }

button, .btn {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}
button:active, .btn:active { transform: scale(0.97); }
button:hover, .btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn-secondary { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn-secondary:hover { background: #eef1ff; }
.btn-danger { background: #fff; color: #d6336c; border: 1px solid #d6336c; }
.btn-danger:hover { background: #fff0f4; }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: #d9600a; }

.post {
  display: flex;
  flex-direction: column;
}
.post-row { display: flex; gap: 12px; }
.post-body { flex: 1; min-width: 0; }
.post-header { display: flex; align-items: baseline; gap: 8px; }
.post-header .name { font-weight: 700; }
.post-header .time { color: var(--muted); font-size: 0.85rem; }
.post-content { margin: 6px 0; white-space: pre-wrap; word-break: break-word; }
.post-image { width: 100%; height: auto; border-radius: 8px; margin: 8px 0; border: 1px solid var(--border); }
.post-actions { display: flex; gap: 12px; }
.post-actions form { display: inline; }
.post-actions button.link-btn, .post-actions a.link-btn {
  background: none; border: none; color: var(--muted); font-weight: 600; cursor: pointer; padding: 0; font-size: 0.85rem;
}
.post-actions button.link-btn:hover { color: var(--brand); text-decoration: underline; }

.comments { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.comment { display: flex; gap: 8px; font-size: 0.92rem; }
.comment .name { font-weight: 700; margin-right: 4px; }
.comment-form { display: flex; gap: 8px; margin-top: 8px; }
.comment-form input[type=text] { flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: 20px; }
.comment-form button { border-radius: 20px; padding: 6px 14px; }

.friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.friend-tile {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  background: var(--panel);
}
.friend-tile img { margin-bottom: 6px; }
.friend-tile .name { font-weight: 700; display: block; margin-bottom: 6px; }
.friend-tile form { margin-top: 4px; }

.section-title { font-weight: 800; font-size: 1.1rem; margin: 6px 0 2px; }

form.auth-form {
  max-width: 380px;
  margin: 40px auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
form.auth-form h2 { margin: 0 0 8px; text-align: center; }
form.auth-form label { font-weight: 600; font-size: 0.9rem; }
form.auth-form input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 1rem;
}
.auth-error { background: #fff0f0; color: #c0392b; border: 1px solid #f5c6c6; padding: 8px 10px; border-radius: 7px; font-size: 0.9rem; }
.auth-switch { text-align: center; font-size: 0.9rem; margin-top: 4px; }

.profile-header { display: flex; gap: 18px; align-items: center; }
.profile-header .info h2 { margin: 0 0 4px; }
.profile-header .bio { color: var(--muted); margin: 4px 0 8px; }

.messages-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.messages-list li a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 8px; color: var(--text);
}
.messages-list li a:hover { background: #f7f0d8; text-decoration: none; }
.messages-list .preview { color: var(--muted); font-size: 0.88rem; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread-badge { background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 0.75rem; font-weight: 700; margin-left: auto; }

.thread { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 4px; }
.bubble { max-width: 70%; padding: 8px 12px; border-radius: 14px; }
.bubble.me { align-self: flex-end; background: var(--brand); color: #fff; }
.bubble.them { align-self: flex-start; background: #f7f0d8; }
.bubble .time { display: block; font-size: 0.7rem; opacity: 0.75; margin-top: 3px; }
.thread-form { display: flex; gap: 8px; margin-top: 12px; }
.thread-form input[type=text] { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 20px; }
.thread-form button { border-radius: 20px; }

.empty-state { color: var(--muted); text-align: center; padding: 30px 10px; }

.avatar-edit {
  position: relative;
  display: inline-block;
  width: 96px;
  height: 96px;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
}
.avatar-edit img { width: 100%; height: 100%; }
.avatar-edit-overlay {
  position: absolute;
  inset: auto 0 0 0;
  background: rgba(31, 43, 34, 0.75);
  color: #fff;
  font-size: 0.68rem;
  text-align: center;
  padding: 4px 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.avatar-edit:hover .avatar-edit-overlay { opacity: 1; }

.yt-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  margin: 8px 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}
.yt-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

.emoji-btn {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 20px;
  cursor: pointer;
  flex-shrink: 0;
}
.emoji-btn:hover { background: #f2f4f8; }
.emoji-panel-wrapper {
  position: absolute;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  z-index: 20;
  margin-top: 4px;
  max-width: 340px;
}
.emoji-panel-wrapper.emoji-panel-upward {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 4px;
}
.emoji-tabs { display: flex; gap: 6px; margin-bottom: 6px; }
.emoji-tab {
  background: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--muted);
}
.emoji-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.emoji-panel {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
  max-width: 320px;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
}
.emoji-option {
  background: none;
  border: none;
  font-size: 1.2rem;
  padding: 4px;
  cursor: pointer;
  border-radius: 6px;
  min-width: 0;
}
.emoji-option img {
  width: 20px;
  height: 20px;
  display: block;
  margin: 0 auto;
}
.emoji-option:hover { background: #eef1ff; }
.emoji-option-pnw img { width: 28px; height: 28px; object-fit: contain; }
.thread-form { position: relative; }

/* --- Site-wide rotating PNW background --- */
.site-background {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.14;
  z-index: -1;
  filter: saturate(0.9) blur(4px);
}

/* --- Per-profile background (fills whole page, more visible than the
   faint site-wide one - it replaces it while viewing that profile) --- */
.profile-page {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  --p-bg: var(--panel);
  --p-text: var(--text);
  --p-accent: var(--brand);
  --p-font: inherit;
}
.profile-page .card {
  background: var(--p-bg);
  color: var(--p-text);
  font-family: var(--p-font);
}
.profile-page .card a, .profile-page .name { color: var(--p-accent); }
.profile-page .card .muted { opacity: 0.75; }
.profile-bg-layer {
  opacity: 0.55;
  background-color: var(--bg);
}

/* --- Profile banner --- */
.profile-banner {
  width: 100%;
  height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.profile-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Relationship status --- */
.relationship-status {
  background: #fdf1e6;
  border: 1px solid #eecfa3;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 7px;
  display: inline-block;
  margin: 6px 0;
  font-size: 0.92rem;
}

/* --- Photo gallery --- */
.gallery-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.gallery-tabs a {
  padding: 6px 12px;
  border-radius: 20px;
  background: #f7f0d8;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
}
.gallery-tabs a:hover { background: #ede4c0; text-decoration: none; }
.gallery-tabs a.active { background: var(--brand); color: #fff; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.gallery-item {
  display: block;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Compact sidebar widgets (relationship status) --- */
.widget-compact { padding-bottom: 10px; }
.widget-compact h3 { margin-bottom: 6px; }
.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
}
.link-btn:hover { color: var(--brand); text-decoration: underline; }

/* --- Toast-style confirmation modal --- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 43, 34, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.confirm-box {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.confirm-message { margin: 0 0 16px; font-size: 0.95rem; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* --- Notification badges in nav --- */
.nav-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}

/* --- Likes --- */
.like-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0;
}
.like-btn.liked { color: #d6336c; }
.like-btn:hover { color: #d6336c; }
.comment-like-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0;
  margin-left: 6px;
}
.comment-like-btn.liked { color: #d6336c; }

/* --- Friend search --- */
.friend-search {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.friend-search input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
}

/* --- Custom minimal song player (uniform across upload/YouTube/SoundCloud) --- */
.song-widget {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 8px 12px;
  background: #f7f0d8;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.song-play-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  flex-shrink: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.song-play-btn:hover { background: var(--brand-dark); }
.song-title { font-weight: 600; font-size: 0.9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.song-volume { width: 70px; flex-shrink: 0; }
.song-player-mount { display: none; }

/* --- Relationship footnote on profile banner --- */
.relationship-footnote {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 6px 2px;
}

/* --- Chit Chat: friend dropdown --- */
.chitchat-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 68;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}
.chitchat-backdrop.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.18s ease;
}
.chitchat-dropdown {
  position: fixed;
  top: 56px;
  right: 20px;
  width: 300px;
  max-height: calc(100vh - 76px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 70;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(-12px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}
.chitchat-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.chitchat-dropdown-header {
  font-weight: 700;
  font-size: 1rem;
  padding: 10px 14px 4px;
}
.chitchat-friend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
}
.chitchat-friend-item:hover { background: #eef1ff; }
.chitchat-friend-item img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.chitchat-friend-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.chitchat-friend-name { font-weight: 600; font-size: 0.88rem; }
.chitchat-friend-preview {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chitchat-friend-time { font-size: 0.72rem; color: var(--muted); flex-shrink: 0; }
.chitchat-search {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.chitchat-friend-list { flex: 1; min-height: 0; overflow-y: auto; }

/* --- Chit Chat: popup stack --- */
.chitchat-stack {
  position: fixed;
  bottom: 0;
  right: 20px;
  display: flex;
  flex-direction: row-reverse;
  gap: 10px;
  z-index: 65;
}
.chitchat-popup {
  width: 290px;
  height: 340px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
  display: flex;
  overflow: hidden;
  flex-direction: column;
  animation: chitchatSlideUp 0.18s ease;
  transition: transform 0.2s ease, width 0.22s ease, height 0.22s ease, border-radius 0.22s ease, top 0.22s ease, left 0.22s ease, right 0.22s ease, bottom 0.22s ease;
}
.chitchat-popup.dragging { transition: none; }
.chitchat-popup.expanded {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  z-index: 200;
}
.chitchat-popup-header { cursor: grab; touch-action: none; }
.chitchat-popup.closing {
  animation: chitchatSlideDown 0.16s ease forwards;
}
@keyframes chitchatSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes chitchatSlideDown {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(100%); opacity: 0; }
}
.chitchat-popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--brand);
  color: #fff;
  border-radius: 10px 10px 0 0;
  font-weight: 600;
  font-size: 0.9rem;
}
.chitchat-popup-header img { width: 24px; height: 24px; border-radius: 5px; object-fit: cover; }
.chitchat-popup-header span { flex: 1; }
.chitchat-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.85;
}
.chitchat-close:hover { opacity: 1; }
.chitchat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chitchat-msg {
  max-width: 75%;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  word-break: break-word;
}
.chitchat-msg.mine { align-self: flex-end; background: var(--brand); color: #fff; }
.chitchat-msg.theirs { align-self: flex-start; background: #f7f0d8; }
.chitchat-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--border);
  position: relative;
}
.chitchat-input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 0.85rem;
}
.chitchat-send {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  font-size: 0.9rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 700px) {
  .chitchat-stack { right: 0; }
  .chitchat-popup { width: 90vw; max-width: 320px; }
  .chitchat-dropdown { right: 4px; width: calc(100vw - 8px); max-width: 320px; }
}

/* --- Site-wide footer --- */
.site-footer {
  text-align: center;
  padding: 20px 16px 30px;
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--brand); }

/* --- Temporary beta test banner (remove after the test week) --- */
.beta-banner {
  background: #fdf6e3;
  border-bottom: 1px solid #eecfa3;
  color: #6b4f1d;
  text-align: center;
  font-size: 0.85rem;
  padding: 8px 16px;
}
.beta-banner a { color: #8a5a12; font-weight: 600; }

/* --- Founders badge --- */
.btn-small { padding: 4px 10px; font-size: 0.78rem; }
.founder-badge {
  background: #2a2a2a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #e8c974;
  box-shadow: 0 0 8px rgba(232, 201, 116, 0.6);
  vertical-align: middle;
}
.founder-badge img { height: 20px; width: auto; }

/* --- Top Friends rank medals/ribbons --- */
.rank-icon { display: inline-flex; align-items: center; flex-shrink: 0; }

/* --- Right column widgets: Daily Quote, ASL Sign, My Activity --- */
.quote-text { font-style: italic; margin: 4px 0; font-size: 0.92rem; }
.quote-author { color: var(--muted); font-size: 0.82rem; margin: 0; text-align: right; }
details summary { cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary h3 { margin: 0; }
.activity-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.activity-list li a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text);
  padding: 6px 8px;
  border-radius: 6px;
}
.activity-list li a:hover { background: #f7f0d8; text-decoration: none; }
.activity-snippet { font-size: 0.85rem; }

/* --- Site-wide announcement posts --- */
.announcement-post { border: 2px solid var(--accent); }
.announcement-label { color: var(--accent); font-weight: 700; font-size: 0.8rem; margin-bottom: 6px; }
.announcement-content { margin-top: 10px; }

/* --- Snapshots bar (ephemeral 24hr photo/video) --- */
.snapshots-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  overflow-x: hidden;
}
.snapshots-list {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 10px 30px 14px;
  flex: 1;
  min-width: 0;
}
.snapshot-add-corner {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: 2px solid var(--panel);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.snapshot-add-corner:hover { background: var(--brand-dark); }
.snapshot-scroll-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text);
  flex-shrink: 0;
  z-index: 4;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.snapshot-fade {
  position: absolute;
  top: 0;
  bottom: 14px;
  width: 30px;
  pointer-events: none;
  z-index: 3;
}
.snapshot-fade-left { left: 30px; background: linear-gradient(90deg, var(--bg), transparent); }
.snapshot-fade-right { right: 30px; background: linear-gradient(270deg, var(--bg), transparent); }
.snapshots-label { margin: 0 0 2px 4px; font-size: 0.95rem; }
.snapshot-oval {
  flex-shrink: 0;
  width: 76px;
  text-align: center;
  cursor: pointer;
  position: relative;
  padding-top: 14px;
}
.snapshot-media-frame {
  width: 76px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent);
  background: var(--panel);
  position: relative;
}
.snapshot-media-frame img,
.snapshot-media-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.snapshot-persona-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--panel);
  background: var(--panel);
}
.snapshot-name {
  display: block;
  font-size: 0.72rem;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snapshot-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}
.snapshot-viewer-inner {
  position: relative;
  max-width: 90vw;
  text-align: center;
}
.snapshot-viewer-close {
  position: absolute;
  top: -36px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}
.snapshot-viewer-username {
  color: #fff;
  margin-top: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.snapshot-nav-arrow {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.snapshot-nav-arrow:hover { background: rgba(255,255,255,0.3); }
.snapshot-count-badge {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.snapshot-viewer-media-wrap { position: relative; display: inline-block; }
.snapshot-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 10px 14px;
  font-size: 0.9rem;
  text-align: center;
}

/* --- Report button (small, unobtrusive) --- */
.report-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  opacity: 0.55;
  vertical-align: middle;
}
.report-btn:hover { opacity: 1; }
.report-btn img { width: 14px; height: 14px; display: block; }
.report-btn-sent { opacity: 0.3; cursor: default; }

/* --- Admin note (Community Notes style) --- */
.admin-note {
  background: #f2f2f2;
  border-left: 3px solid var(--muted);
  padding: 6px 10px;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 8px 0;
  border-radius: 4px;
}

/* --- Side Quests dedicated page --- */
.side-quests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.side-quest-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
}
.side-quest-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}
.side-quest-card-body { padding: 10px; }

/* --- Top 5 Friends: dice-5 layout --- */
.top-friends-dice {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-areas:
    "tl . tr"
    ". c ."
    "bl . br";
  gap: 4px;
  margin: 0;
}
.top-friends-dice li { margin-bottom: 0; }
.top-friends-dice li.dice-c  { grid-area: c;  justify-self: center; }
.top-friends-dice li.dice-tl { grid-area: tl; }
.top-friends-dice li.dice-tr { grid-area: tr; justify-self: end; }
.top-friends-dice li.dice-bl { grid-area: bl; }
.top-friends-dice li.dice-br { grid-area: br; justify-self: end; }
.top-friends-dice a { flex-direction: column; text-align: center; gap: 2px; }
.top-friends-dice .rank-icon { position: absolute; margin-top: -10px; margin-left: 38px; }
.top-friends-dice a { position: relative; }
.top-friends-dice img.avatar-sm { width: 62px; height: 62px; }
.top-friends-dice span:last-child { font-size: 0.72rem; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Photo gallery lightbox (keeps music playing since page never navigates) --- */
.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 85;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 16px;
}
.photo-lightbox-inner {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 900px;
  width: 100%;
}
.photo-lightbox-close {
  background: none;
  border: none;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 14px;
  font-size: 0.95rem;
}

/* --- Tagging (using * instead of @) --- */
.tag-link { color: var(--brand); font-weight: 600; }
.tag-link:hover { text-decoration: underline; }

/* --- Hub icon in the logo --- */
.brand-icon { height: 18px; width: auto; vertical-align: middle; margin-left: 2px; }

/* --- Inline PNW custom emoji (rendered from :shortcode: text) --- */
.inline-emoji { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; margin: 0 1px; }

/* --- Profile page action buttons: consistent spacing + centering --- */
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

/* --- Mobile nav (placed last + extra specificity to guarantee it wins) --- */
@media (max-width: 700px) {
  .topbar .topbar-inner {
    grid-template-columns: 1fr auto;
    height: auto;
    padding: 10px 0;
    gap: 6px;
  }
  .topbar .brand { justify-self: start; font-size: 1.1rem; }
  .topbar .brand-icon { height: 16px; }
  .topbar .nav-group { gap: 6px; }
  .topbar .mobile-nav-toggle { display: block; }
  .topbar nav.topnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--brand-dark);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 16px 14px;
    z-index: 60;
  }
  .topbar nav.topnav.open { display: flex; }
  .topbar nav.topnav a, .topbar nav.topnav .logout-form button {
    padding: 12px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    width: 100%;
    text-align: left;
  }
  .topbar nav.topnav a.active { border-bottom-color: #ffd43b; }
  .topbar .logout-form { width: 100%; }
  .topbar .logout-form button { background: none; border: none; color: #f1f3ff; font-weight: 600; cursor: pointer; }
}

/* --- Mobile sidebar fix: scroll normally on every page instead of staying pinned --- */
@media (max-width: 800px) {
  .sidebar, .sidebar-right { position: static; }
}

/* --- Hamburger notification dot --- */
.hamburger-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--brand-dark);
}

/* --- Enlarge overlay for individual photos (keeps music playing) --- */
.photo-enlarge-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 95;
  align-items: center;
  justify-content: center;
}
.photo-enlarge-inner { position: relative; max-width: 92vw; max-height: 92vh; }
.photo-enlarge-inner img { max-width: 92vw; max-height: 92vh; display: block; border-radius: 6px; }
.photo-enlarge-close {
  position: absolute;
  top: -36px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

/* --- Multi-image posts: extra images beyond the first one --- */
.post-extra-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 6px;
  margin-top: 6px;
}
.post-extra-images img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
}

/* --- Notification center (lighthouse icon) --- */
.notif-wrapper { position: relative; }
.notif-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  position: relative;
}
.notif-dot {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 9px;
  height: 9px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--brand-dark);
}
.notif-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 280px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 70;
  margin-top: 6px;
  opacity: 0;
  transform: translateY(-6px);
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
  pointer-events: none;
}
.notif-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.notif-list { list-style: none; margin: 0; padding: 6px 0; }
.notif-list li { padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.notif-list li:last-child { border-bottom: none; }
.notif-time { display: block; font-size: 0.72rem; margin-top: 2px; }

/* --- Photo enlarge prev/next arrows --- */
.photo-enlarge-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.photo-enlarge-arrow:hover { background: rgba(255,255,255,0.3); }
.photo-enlarge-arrow-left { left: -50px; }
.photo-enlarge-arrow-right { right: -50px; }
@media (max-width: 700px) {
  .photo-enlarge-arrow-left { left: 4px; }
  .photo-enlarge-arrow-right { right: 4px; }
}

/* --- Admin user list: capped height with internal scroll --- */
.admin-user-scroll {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 6px;
}

/* --- Side Quests: desktop shows in right sidebar, mobile shows near top --- */
.side-quests-mobile-slot { display: none; }
@media (max-width: 800px) {
  .side-quests-desktop-slot { display: none; }
  .side-quests-mobile-slot { display: block; margin-bottom: 16px; }
}

/* --- Smoother transitions for dropdowns/popups/modals --- */
.notif-dropdown, .emoji-panel-wrapper, .chitchat-dropdown {
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.confirm-overlay, .photo-enlarge-overlay, .snapshot-viewer, .photo-lightbox {
  transition: opacity 0.15s ease;
}

/* --- Side Quest mini image carousel --- */
.sq-carousel { position: relative; width: 100%; height: 140px; overflow: hidden; cursor: pointer; }
.sq-carousel-img { width: 100%; height: 140px; object-fit: cover; display: block; }
.sq-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  border: none;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.sq-carousel-arrow:hover { background: rgba(0,0,0,0.6); }
.sq-carousel-prev { left: 6px; }
.sq-carousel-next { right: 6px; }
.sq-carousel-count {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 10px;
}

/* --- Chit Chat add-image button, sized to match the Snapshots + button --- */
.chitchat-add-image {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chitchat-add-image:hover { background: var(--brand-dark); }

/* --- Chit Chat inline YouTube embed --- */
.chitchat-yt-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  margin-top: 6px;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}
.chitchat-yt-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* --- Chit Chat compact link icon (hides raw URLs) --- */
.chitchat-link-icon { text-decoration: none; font-size: 1rem; }

/* --- Online widget avatars: match Top Friends dice sizing --- */
.online-list img.avatar-sm { width: 62px; height: 62px; }
.online-list { max-height: 300px; overflow-y: auto; padding-right: 4px; }

/* --- Persona "Edit" link (replaces the old nav Settings link) --- */
.persona-edit-link {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand);
}

/* --- Photo gallery delete button --- */
.gallery-item-wrap { position: relative; }
.gallery-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(214, 51, 108, 0.9);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.gallery-delete-btn:hover { background: #d6336c; }

/* --- Chit Chat message reactions --- */
.chitchat-msg { position: relative; }
.chitchat-reaction-hover {
  display: none;
  position: absolute;
  top: -30px;
  left: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  gap: 2px;
  z-index: 5;
}
.chitchat-msg.mine .chitchat-reaction-hover { left: auto; right: 0; }
.chitchat-msg:hover .chitchat-reaction-hover { display: flex; }
.chitchat-reaction-hover button {
  background: none;
  border: none;
  font-size: 1rem;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 50%;
}
.chitchat-reaction-hover button:hover { background: #eef1ff; }
.chitchat-reactions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.chitchat-reactions span {
  background: #f0f0f0;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 0.8rem;
}

/* --- Chit Chat message images: fit within the chat box --- */
.chitchat-msg-image {
  display: block;
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  margin-top: 6px;
  object-fit: cover;
}

/* --- Squad list & People You Might Know: capped height with internal scroll --- */
.squad-list-scroll {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 6px;
}
.suggestions-scroll {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 6px;
}

/* --- Persona page Friends widget: 3x3 grid, scrollable beyond that --- */
.persona-friends-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}
.persona-friend-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  text-decoration: none;
  min-width: 0;
}
.persona-friend-tile img.avatar-sm { width: 62px; height: 62px; }
.persona-friend-tile span {
  font-size: 0.72rem;
  color: var(--text);
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Squad remove button: small X icon instead of a big Remove button --- */
.squad-remove-x {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.squad-remove-x:hover { background: #fdeaea; color: #d6336c; border-color: #f3c2c2; }

/* --- Top 5 Friends picker: dice-pattern layout matching the display widget --- */
.top5-picker-dice {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-areas:
    "tl . tr"
    ". c ."
    "bl . br"
    "save save save";
  gap: 16px 24px;
  max-width: 420px;
  margin: 8px auto 0;
  align-items: center;
  justify-items: center;
}
.top5-picker-dice label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
}
.top5-picker-dice select {
  width: 120px;
  padding: 5px 7px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}
.top5-picker-dice .dice-c { grid-area: c; }
.top5-picker-dice .dice-tl { grid-area: tl; }
.top5-picker-dice .dice-tr { grid-area: tr; }
.top5-picker-dice .dice-bl { grid-area: bl; }
.top5-picker-dice .dice-br { grid-area: br; }
.top5-picker-save {
  grid-area: save;
  justify-self: center;
  margin-top: 6px;
  font-size: 0.9rem;
  padding: 7px 14px;
}

/* --- Top 5 picker search-filter input --- */
.top5-search-wrap { position: relative; width: 120px; }
.top5-search-input {
  width: 120px;
  padding: 5px 7px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}
.top5-search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 160px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 30;
  margin-top: 2px;
}
.top5-search-item {
  padding: 6px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
}
.top5-search-item:hover { background: #eef1ff; }
.top5-search-none { color: var(--muted); font-style: italic; }
.top5-search-empty { padding: 6px 8px; font-size: 0.8rem; color: var(--muted); }

/* --- Smooth pinecone status update fade --- */
.pinecone-fade-in { opacity: 0; transition: opacity 0.2s ease; }
.pinecone-fade-in.pinecone-fade-in-active { opacity: 1; }
#pinecone-count, #pinecone-label, #pinecone-icon { transition: opacity 0.15s ease; }

/* --- Per-item "new" dot in the notification dropdown --- */
.notif-item-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}

/* --- Snapshot viewer edit button --- */
.snapshot-edit-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 4px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}
.snapshot-edit-btn:hover { background: rgba(0,0,0,0.7); }

/* --- Top 5 picker: stack into a single column on narrow mobile screens --- */
@media (max-width: 480px) {
  .top5-picker-dice {
    grid-template-columns: 1fr;
    grid-template-areas:
      "tl"
      "tr"
      "c"
      "bl"
      "br"
      "save";
    max-width: 100%;
    gap: 10px;
  }
}

/* --- Hub comment reactions --- */
.comment-reactable { position: relative; }
.comment-reaction-hover {
  display: none;
  position: absolute;
  top: -30px;
  left: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  gap: 2px;
  z-index: 5;
}
.comment-reactable:hover .comment-reaction-hover { display: flex; }
.comment-react-btn {
  background: none;
  border: none;
  font-size: 1rem;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 50%;
}
.comment-react-btn:hover { background: #eef1ff; }
.comment-reactions-display {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.comment-reactions-display span {
  background: #f0f0f0;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 0.78rem;
}

/* --- Chit Chat edited message label --- */
.chitchat-edited-label { font-size: 0.72rem; color: var(--muted); font-style: italic; }

/* --- Song player progress bar with Bigfoot-bike handle --- */
.song-controls-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.song-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.song-time-current, .song-time-total {
  font-size: 0.7rem;
  color: var(--muted);
  min-width: 30px;
  text-align: center;
}
.song-progress-track {
  position: relative;
  flex: 1;
  height: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.song-progress-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
}
.song-progress-fill {
  position: absolute;
  left: 0;
  height: 4px;
  background: var(--brand);
  border-radius: 4px;
  width: 0%;
  pointer-events: none;
}
.song-progress-handle {
  position: absolute;
  left: 0%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.song-progress-handle img { width: 100%; height: 100%; display: block; }

/* --- Media editor (before-you-post photo/video editor) --- */
.media-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.media-editor-box {
  background: var(--panel);
  border-radius: 12px;
  padding: 16px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.media-editor-canvas-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
  min-height: 200px;
}
.media-editor-canvas, .media-editor-video { max-width: 100%; max-height: 60vh; display: block; }
.media-editor-crop-box {
  position: absolute;
  border: 2px dashed #fff;
  cursor: move;
  box-shadow: 0 0 0 2000px rgba(0,0,0,0.4);
}
.media-editor-stickers-layer { position: absolute; inset: 0; pointer-events: none; }
.media-editor-sticker {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: grab;
  pointer-events: auto;
  user-select: none;
}
.media-editor-controls { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.media-editor-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.media-editor-row label { font-size: 0.8rem; display: flex; align-items: center; gap: 4px; }
.media-editor-actions { justify-content: space-between; margin-top: 6px; }
.media-editor-sticker-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.me-sticker-choice {
  font-size: 1.4rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
}

/* --- Chevron vertical centering fix: the glyph itself isn't optically
   centered within its own font metrics even when the button is, so give
   it its own element with a small nudge --- */
.chevron-glyph {
  display: inline-block;
  transform: translateY(-1px);
  line-height: 1;
}

/* --- Notification dropdown "Mark all as read" row --- */
.notif-mark-all-row { padding: 6px 14px; border-bottom: 1px solid var(--border); text-align: right; }
.notif-mark-all-row .link-btn { font-size: 0.78rem; }

/* --- Header profile picture + dropdown (replaces bare Logout button) --- */
.header-profile-menu { position: relative; margin-left: 8px; }
.header-profile-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.header-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #ffd43b;
  object-fit: cover;
}
.header-profile-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  min-width: 150px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(-6px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
}
.header-profile-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.header-profile-dropdown a, .header-profile-dropdown .logout-form button {
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  text-align: left;
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
}
.header-profile-dropdown a:hover, .header-profile-dropdown .logout-form button:hover { background: #eef1ff; }
.header-profile-dropdown .logout-form { margin: 0; }
