/* ============================================================
   Shout — styles.css (unified: text + images + reactions + comments)
   ============================================================ */

:root {
  --bg: #0c0d0f;
  --panel: #111214;
  --panel2: #15171a;
  --text: #f5f6f7;
  --dim: #9aa3b2;
  --muted: #6b7280;
  --border: #2a2a2a;
  --line: #1e1e1e;
  --accent: #a78bfa;
  --accent2: #c4b5fd;
  --green: #34d399;
  --red: #f87171;
  --shadow: rgba(0, 0, 0, 0.35);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  --sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* --- Topbar --- */
.site-header { position: sticky; top: 0; z-index: 50; }
.topbar { background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-content {
  max-width: 720px; margin: 0 auto; padding: 0.75rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
}
.brand {
  font-family: var(--mono); font-size: 0.85rem; color: var(--dim);
  letter-spacing: 0.02em; white-space: nowrap;
}
.brand:hover { color: var(--text); }
.header-nav { display: flex; gap: 0.75rem; }
.nav-link {
  font-size: 0.8rem; color: var(--dim); padding: 0.25rem 0.5rem;
  border-radius: 4px; transition: color 0.15s;
}
.nav-link:hover { color: var(--accent); }

/* --- Layout --- */
.wrap { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; max-width: 960px; margin: 0 auto; padding: 1.5rem 1.25rem; width: 100%; }

.feed-layout { display: grid; grid-template-columns: 1fr 240px; gap: 1.5rem; }
@media (max-width: 768px) {
  .feed-layout { grid-template-columns: 1fr; }
  .feed-sidebar { display: none; }
}

/* --- Page Title --- */
.page-title {
  font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

/* --- Compose Box --- */
.compose-box, .comment-compose, .wall-compose {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem; margin-bottom: 1.25rem;
}
.compose-input {
  width: 100%; background: transparent; border: none; color: var(--text);
  font-family: var(--sans); font-size: 0.95rem; resize: none; outline: none;
  line-height: 1.5;
}
.compose-input::placeholder { color: var(--muted); }
.compose-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 0.75rem; margin-top: 0.5rem; padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}
.char-counter {
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
}
.char-counter.warn { color: #f59e0b; }
.char-counter.over { color: var(--red); }

/* --- Image Upload --- */
.image-upload-label {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.8rem; color: var(--dim); cursor: pointer; padding: 0.4rem 0.7rem;
  border-radius: 8px; border: none; background: transparent; transition: all 0.15s;
  margin-right: auto;
}
.image-upload-label:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.upload-icon { width: 16px; height: 16px; flex-shrink: 0; }

.image-preview {
  position: relative; max-width: 200px; margin-top: 0.75rem; display: none;
}
.image-preview.active { display: inline-block; }
.image-preview img { width: 100%; border-radius: 8px; }
.image-remove {
  position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.7);
  color: white; border: none; border-radius: 50%; width: 24px; height: 24px;
  cursor: pointer; font-size: 1rem; line-height: 1;
}

.optimize-prompt[hidden] { display: none; }
.optimize-prompt {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  margin-top: 0.5rem; padding: 0.6rem 0.75rem;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line);
  border-radius: 8px; font-size: 0.8rem; color: var(--dim);
}
.optimize-text { flex: 1; min-width: 150px; }
.optimize-text strong { color: var(--text); font-weight: 600; }
.optimize-actions { display: flex; gap: 0.5rem; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.75rem; }
.btn-ghost { background: transparent; color: var(--dim); border-color: transparent; }
.btn-ghost:hover { color: var(--text); border-color: var(--border); }

/* --- Buttons --- */
.btn {
  padding: 0.5rem 1rem; border-radius: 6px; border: 1px solid var(--border);
  font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.15s;
  font-family: var(--sans);
}
.btn-primary {
  background: var(--accent); color: #0c0d0f; border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent2); border-color: var(--accent2); }
.btn-secondary {
  background: transparent; color: var(--dim); border-color: var(--border);
}
.btn-secondary:hover { color: var(--text); border-color: var(--dim); }
.btn-block { display: block; width: 100%; text-align: center; }

/* --- Filter Tabs --- */
.filter-tabs {
  display: flex; gap: 0.25rem; margin-bottom: 1rem;
}
.filter-tab {
  font-size: 0.8rem; padding: 0.4rem 0.85rem; border-radius: 6px;
  background: transparent; border: 1px solid transparent;
  color: var(--dim); cursor: pointer; font-family: var(--sans); font-weight: 500;
  transition: all 0.15s;
}
.filter-tab:hover { color: var(--text); background: var(--panel); }
.filter-tab.active { color: var(--accent); background: var(--panel); border-color: var(--border); }

/* --- Profile Tabs --- */
.profile-tabs {
  display: flex; gap: 0.25rem; margin-bottom: 1rem;
}
.tab-btn {
  font-size: 0.85rem; padding: 0.5rem 1rem; border-radius: 8px;
  background: transparent; border: 1px solid transparent;
  color: var(--dim); cursor: pointer; font-family: var(--sans); font-weight: 500;
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--text); background: var(--panel); }
.tab-btn.active { color: var(--accent); background: var(--panel); border-color: var(--border); }

/* --- Shout Cards --- */
.shout-list { display: flex; flex-direction: column; }
.shout-card {
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--line);
  transition: background 0.1s;
}
.shout-card:hover { background: rgba(255,255,255,0.02); }
.shout-card--detail { border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; }
.shout-card--detail:hover { background: transparent; }
.shout-card--reshout { border-left: 2px solid var(--accent); padding-left: 0.85rem; }

.shout-author {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem;
}
.avatar-sm {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
}
.author-handle {
  font-size: 0.85rem; font-weight: 600; color: var(--text);
}
.author-handle:hover { color: var(--accent); text-decoration: underline; }
.reshout-label {
  font-size: 0.75rem; color: var(--muted); font-style: italic;
}
.shout-time {
  font-size: 0.75rem; color: var(--muted); font-family: var(--mono); margin-left: auto;
}

.shout-body {
  font-size: 0.92rem; line-height: 1.55; word-break: break-word;
  margin-bottom: 0.5rem;
}
.shout-body a { color: var(--accent); }
.shout-body a:hover { text-decoration: underline; }
.shout-body .mention { color: var(--accent); font-weight: 500; }
.shout-body .hashtag { color: var(--green); font-weight: 500; }
.shout-body p { margin-bottom: 0.5rem; }
.shout-body p:last-child { margin-bottom: 0; }

/* --- Post Image --- */
.post-image { margin: 0.75rem 0; }
.post-image img { max-width: 100%; border-radius: 10px; max-height: 500px; object-fit: cover; }

/* --- Reactions (desktop: picker. mobile: inline row) --- */
.post-reactions {
  position: relative; display: inline-flex; align-items: center; margin: 0.5rem 0;
}
.reaction-trigger {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--panel2); border: 1px solid var(--border); border-radius: 20px;
  padding: 0.45rem 0.85rem; min-height: 36px; cursor: pointer; font-size: 0.85rem;
  color: var(--dim); transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.reaction-trigger:hover { border-color: var(--accent2); color: var(--text); }
.reaction-trigger.active {
  border-color: var(--accent); background: rgba(167,139,250,0.28);
  color: var(--text); font-weight: 600;
}
.reaction-trigger .reaction-emoji { width: 20px; height: 20px; }
.reaction-trigger .reaction-label { font-size: 0.8rem; }
.reaction-trigger.active .reaction-label { display: none; }
.reaction-total-count { font-family: var(--mono); font-size: 0.75rem; }
.reaction-total-count:empty { display: none; }

/* Desktop floating picker */
.reaction-picker {
  position: absolute; bottom: calc(100% + 8px); left: 0;
  display: flex; gap: 0.3rem; padding: 0.4rem 0.5rem;
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: 28px; box-shadow: 0 6px 18px var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
  z-index: 10; white-space: nowrap;
}
.post-reactions.picker-below .reaction-picker {
  bottom: auto; top: calc(100% + 8px);
}
.post-reactions:hover .reaction-picker,
.post-reactions.open .reaction-picker {
  opacity: 1; visibility: visible; transform: translateY(0);
}
@media (hover: none) {
  .post-reactions:hover .reaction-picker { opacity: 0; visibility: hidden; transform: translateY(4px); }
  .post-reactions.open .reaction-picker { opacity: 1; visibility: visible; transform: translateY(0); }
}

.reaction-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem;
  min-width: 44px; min-height: 44px;
  background: transparent; border: 1px solid transparent; border-radius: 22px;
  padding: 0.35rem 0.6rem; cursor: pointer;
  transition: background 0.12s, transform 0.12s, border-color 0.12s;
}
.reaction-btn:hover { background: rgba(255,255,255,0.08); transform: scale(1.15); }
.reaction-btn.active {
  background: rgba(167,139,250,0.32); border-color: var(--accent);
}
.reaction-btn.just-reacted { animation: reactionPop 0.35s ease-out; }
@keyframes reactionPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.reaction-emoji {
  width: 22px; height: 22px; pointer-events: none;
  /* Desaturate Twemoji so the yellow-face Facebook look stops clashing
     with the editorial dark theme; hover/active pops back to full color. */
  filter: grayscale(1) brightness(1.35) contrast(0.95);
  opacity: 0.72;
  transition: opacity 0.12s, filter 0.12s;
}
.reaction-btn:hover .reaction-emoji,
.reaction-btn.active .reaction-emoji,
.reaction-trigger:hover .reaction-emoji,
.reaction-trigger.active .reaction-emoji { opacity: 1; filter: none; }
.reaction-count { font-family: var(--mono); font-size: 0.72rem; color: var(--dim); }
.reaction-btn.active .reaction-count { color: var(--text); font-weight: 600; }
.reaction-count:empty { display: none; }

/* Mobile: inline row, no picker float */
@media (max-width: 600px) {
  .post-reactions { display: block; width: 100%; }
  .reaction-trigger { display: none; }
  .reaction-picker {
    position: static; opacity: 1; visibility: visible; transform: none;
    display: flex; flex-wrap: nowrap; justify-content: space-between;
    padding: 0.25rem 0; background: transparent; border: none;
    box-shadow: none; border-radius: 0; gap: 0.25rem;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .reaction-picker::-webkit-scrollbar { display: none; }
  .reaction-btn {
    flex: 1 1 0; background: var(--panel2); border: 1px solid var(--line);
  }
  .reaction-btn:hover { transform: none; }
  .reaction-btn.active { background: rgba(167,139,250,0.32); border-color: var(--accent); }
}

/* --- Shout Actions --- */
.shout-actions {
  display: flex; gap: 1.25rem; margin-top: 0.25rem;
}
.action-btn {
  display: flex; align-items: center; gap: 0.3rem;
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.8rem; font-family: var(--sans); padding: 0.15rem 0;
  transition: color 0.15s;
}
.action-btn:hover { color: var(--text); }
.action-btn.active .action-icon { color: var(--red); }
.reshout-btn.active .action-icon { color: var(--green); }
.action-icon { font-size: 1rem; }
.reply-btn .action-icon { font-size: 0.9rem; }
.comment-link { font-size: 0.8rem; color: var(--muted); }
.comment-link:hover { color: var(--accent); }

/* --- Reply Compose --- */
.reply-compose {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.85rem; margin: 1rem 0;
}

/* --- Replies Section --- */
.replies-section { margin-top: 1.5rem; }
.section-title {
  font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem;
  color: var(--dim);
}

/* --- Comments --- */
.comments-section { margin-top: 1rem; }
.comment-card {
  padding: 0.65rem 0; border-bottom: 1px solid var(--line);
  display: flex; gap: 0.5rem;
}
.comment-card--nested { margin-left: 2rem; }
.comment-card--nested-2 { margin-left: 4rem; }
.comment-author {
  font-size: 0.8rem; font-weight: 600; color: var(--text);
}
.comment-author:hover { color: var(--accent); }
.comment-body { font-size: 0.85rem; line-height: 1.5; color: var(--dim); }
.comment-body p { margin-bottom: 0.25rem; }
.comment-meta {
  font-size: 0.7rem; color: var(--muted); margin-top: 0.2rem;
  display: flex; gap: 0.75rem;
}

/* --- Profile Page --- */
.profile-page { max-width: none; }
.profile-cover {
  width: 100%; height: 180px; background-size: cover; background-position: center;
  border-radius: 10px 10px 0 0; background-color: var(--panel2);
}
.profile-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line);
}
.profile-info { display: flex; gap: 1rem; align-items: flex-start; }
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--bg); flex-shrink: 0;
}
.profile-handle {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em;
}
.profile-bio {
  color: var(--dim); font-size: 0.9rem; margin-top: 0.35rem;
}
.profile-stats {
  display: flex; gap: 1rem; margin-top: 0.5rem; font-size: 0.8rem;
}
.profile-stats .stat { color: var(--muted); }
.profile-stats .stat strong { color: var(--text); font-weight: 600; }
.profile-stats .stat:hover { color: var(--accent); }

/* --- Search Bar --- */
.search-bar { margin-bottom: 1rem; }
.search-input {
  width: 100%; background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.65rem 1rem; color: var(--text);
  font-family: var(--sans); font-size: 0.9rem; outline: none;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--accent); }

/* --- Sidebar --- */
.sidebar-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem; margin-bottom: 1rem;
}
.sidebar-title {
  font-size: 0.85rem; font-weight: 700; color: var(--dim); margin-bottom: 0.65rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.sidebar-handle {
  font-size: 0.95rem; font-weight: 600; color: var(--accent);
  display: block; margin-bottom: 0.5rem;
}
.sidebar-handle:hover { text-decoration: underline; }
.sidebar-stats {
  display: flex; flex-direction: column; gap: 0.2rem;
  font-size: 0.8rem; color: var(--muted);
}
.trending-list { display: flex; flex-direction: column; gap: 0.4rem; }
.trending-tag {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.85rem;
}
.trending-tag a { color: var(--green); font-weight: 500; }
.trending-tag a:hover { text-decoration: underline; }
.trending-tag .tag-count { color: var(--muted); font-size: 0.75rem; font-family: var(--mono); }

/* --- Setup Page --- */
.setup-page { max-width: 480px; margin: 0 auto; }
.setup-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.5rem;
}
.form-label {
  display: block; font-size: 0.85rem; font-weight: 600; color: var(--dim);
  margin-bottom: 0.35rem; margin-top: 1rem;
}
.form-label:first-child { margin-top: 0; }
.form-input {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.6rem 0.85rem; color: var(--text);
  font-family: var(--sans); font-size: 0.9rem; outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--accent); }
textarea.form-input { resize: vertical; }
.form-hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }
.form-error {
  font-size: 0.8rem; color: var(--red); margin-top: 0.75rem;
  padding: 0.5rem; background: rgba(248,113,113,0.1); border-radius: 4px;
}

/* --- Avatar edit --- */
.avatar-edit-row {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem;
}
.avatar-edit-preview {
  width: 88px; height: 88px; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--accent); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); transition: opacity 0.2s;
}
.avatar-edit-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-edit-placeholder {
  width: 100%; height: 100%; background: var(--accent); color: #0c0d0f;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700;
}
.avatar-edit-preview--loading { opacity: 0.4; }
.avatar-edit-controls {
  display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start;
}
.avatar-edit-btn { cursor: pointer; margin: 0; }
.avatar-edit-controls .form-hint { margin-top: 0; }

/* --- Load More --- */
.load-more-wrap { text-align: center; padding: 1rem 0; }

/* --- Empty / Loading States --- */
.loading, .empty-state {
  text-align: center; padding: 2rem; color: var(--muted); font-size: 0.9rem;
}

/* --- Error Page --- */
.error-page { text-align: center; padding: 3rem 1rem; }
.error-page .page-title { font-size: 3rem; color: var(--muted); }
.error-page p { color: var(--dim); margin: 0.5rem 0 1.5rem; }

/* ============================================================
   LAIR PROFILE (merged from Lair)
   ============================================================ */

.lair-profile {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden;
  background-image: var(--lair-bg-image, none);
  background-size: cover; background-position: center;
}

.lair-header {
  display: flex; align-items: flex-start; gap: 1rem; padding: 1.5rem;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 100%);
  border-bottom: 1px solid var(--line);
}

.lair-avatar {
  width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--accent); flex-shrink: 0;
}
.lair-avatar--placeholder {
  background: var(--accent); color: #0c0d0f; display: flex;
  align-items: center; justify-content: center; font-size: 2rem; font-weight: 700;
}

.lair-identity { flex: 1; }
.lair-display-name { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.lair-handle { font-size: 0.8rem; color: var(--dim); font-family: var(--mono); }
.lair-tagline {
  font-style: italic; color: var(--accent2); font-size: 0.9rem; margin-top: 0.25rem;
}
.lair-mood {
  font-size: 0.8rem; color: var(--dim); margin-top: 0.15rem;
}
.lair-header-actions { flex-shrink: 0; }

/* --- Two-column body --- */
.lair-body {
  display: grid; grid-template-columns: 240px 1fr; gap: 1rem;
  padding: 1.5rem;
}
@media (max-width: 768px) {
  .lair-body { grid-template-columns: 1fr; }
}
.lair-layout-wide .lair-body { grid-template-columns: 1fr; }
.lair-layout-two-column .lair-body { grid-template-columns: 1fr 1fr; }

/* --- Widgets --- */
.lair-widget {
  background: rgba(0,0,0,0.3); border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem; margin-bottom: 1rem;
}
.widget-title {
  font-size: 0.8rem; font-weight: 700; color: var(--accent); margin-bottom: 0.65rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* --- Visitor Counter --- */
.lair-visitor-counter {
  text-align: center; padding: 0.75rem;
  background: linear-gradient(135deg, #1a0520, #0d1117); border-color: var(--accent);
}
.counter-label { display: block; font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.counter-value {
  display: block; font-size: 1.5rem; font-weight: 800; color: var(--accent);
  font-family: var(--mono); letter-spacing: 0.05em;
}

/* --- Top Friends Grid --- */
.top-friends-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem;
}
.top-friend { text-align: center; }
.top-friend-avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--line); margin: 0 auto 0.2rem; display: block;
}
.top-friend-avatar--placeholder {
  background: var(--panel2); color: var(--dim); display: flex;
  align-items: center; justify-content: center; font-size: 0.9rem; font-weight: 600;
}
.top-friend-name {
  font-size: 0.65rem; color: var(--dim); display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.top-friend:hover .top-friend-name { color: var(--accent); }

/* --- Song Widget --- */
.lair-song { background: linear-gradient(135deg, #1a0520, #0f0818); }
.song-display { display: flex; align-items: center; gap: 0.5rem; }
.song-icon { font-size: 1.5rem; color: var(--accent); }
.song-title { font-size: 0.85rem; color: var(--text); font-weight: 500; }

/* --- Bio Widget --- */
.bio-content { font-size: 0.9rem; line-height: 1.65; color: var(--dim); }
.bio-content a { color: var(--accent); }
.bio-content p { margin-bottom: 0.5rem; }

/* --- Guestbook --- */
.guestbook-sign {
  display: flex; gap: 0.5rem; margin-bottom: 0.75rem; align-items: flex-start;
}
.guestbook-sign textarea { flex: 1; }
.guestbook-entry {
  padding: 0.5rem 0; border-bottom: 1px solid var(--line);
}
.guestbook-author {
  font-size: 0.8rem; font-weight: 600; color: var(--accent);
}
.guestbook-author:hover { text-decoration: underline; }
.guestbook-body { font-size: 0.85rem; color: var(--dim); margin-top: 0.15rem; }

/* --- Bling Container --- */
.lair-bling-container { margin-bottom: 1rem; }

/* --- Stats Bar --- */
.lair-stats-bar {
  display: flex; gap: 1.5rem; padding: 0.75rem 1.5rem;
  background: rgba(0,0,0,0.4); font-size: 0.75rem; color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ============================================================
   EDIT PAGE (from Lair)
   ============================================================ */

.edit-page { max-width: 640px; margin: 0 auto; }
.edit-tabs {
  display: flex; gap: 0.25rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.edit-panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.5rem;
}
.mood-row { display: flex; gap: 0.5rem; }

/* --- Theme Swatches --- */
.theme-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.theme-swatch {
  padding: 0.5rem 1rem; border-radius: 8px; border: 2px solid var(--border);
  background: var(--panel2); color: var(--dim); cursor: pointer;
  font-size: 0.8rem; font-weight: 600; font-family: var(--sans);
  transition: all 0.15s; text-transform: capitalize;
}
.theme-swatch:hover { border-color: var(--accent); color: var(--text); }
.theme-swatch.active { border-color: var(--accent); color: var(--accent); background: rgba(167,139,250,0.1); }
.theme-swatch--neon { border-color: #39ff14; color: #39ff14; }
.theme-swatch--grunge { border-color: #8b7355; color: #8b7355; }
.theme-swatch--pastel { border-color: #ffb3d9; color: #ffb3d9; }
.theme-swatch--emo { border-color: #cc0000; color: #cc0000; }
.theme-swatch--scene { border-color: #ff00ff; color: #ff00ff; }
.theme-swatch--retro { border-color: #00ff00; color: #00ff00; }
.theme-swatch--minimal { border-color: #888; color: #888; }

.layout-options { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.layout-option {
  padding: 0.45rem 0.85rem; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--dim); cursor: pointer;
  font-size: 0.8rem; font-family: var(--sans);
}
.layout-option:hover { border-color: var(--accent); color: var(--text); }
.layout-option.active { border-color: var(--accent); color: var(--accent); }

.css-editor {
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.4;
  background: #080809; border-color: var(--border);
}

/* --- Bling List (edit page) --- */
.bling-list { margin-bottom: 0.75rem; }
.bling-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem; background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; margin-bottom: 0.35rem;
}
.bling-item-name { font-size: 0.85rem; font-weight: 500; }
.bling-add { display: flex; gap: 0.5rem; }

/* ============================================================
   BLING ANIMATIONS (from Lair)
   ============================================================ */

.bling-glitter {
  font-size: 1.2rem; font-weight: 800; text-align: center;
  background: linear-gradient(90deg, var(--accent), #ffd700, var(--accent2), #ffd700, var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: bling-shimmer 3s linear infinite;
}
@keyframes bling-shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.bling-marquee {
  overflow: hidden; white-space: nowrap; padding: 0.5rem 0;
  font-size: 0.85rem; color: var(--accent);
}
.bling-marquee-inner {
  display: inline-block;
  animation: bling-scroll 12s linear infinite;
}
@keyframes bling-scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.bling-counter {
  text-align: center; padding: 0.5rem;
  background: #000; border: 2px inset #333; border-radius: 4px;
  font-family: var(--mono); color: #00ff00; font-size: 0.9rem;
}

.bling-now-playing {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem; background: rgba(0,0,0,0.5); border-radius: 8px;
}
.bling-np-bars {
  display: flex; gap: 2px; align-items: flex-end; height: 16px;
}
.bling-np-bar {
  width: 3px; background: var(--accent); border-radius: 1px;
  animation: bling-bar-bounce 0.8s ease-in-out infinite alternate;
}
.bling-np-bar:nth-child(2) { animation-delay: 0.2s; }
.bling-np-bar:nth-child(3) { animation-delay: 0.4s; }
@keyframes bling-bar-bounce {
  0% { height: 4px; }
  100% { height: 16px; }
}

/* --- Toast --- */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
  background: var(--panel2); color: var(--text); padding: 0.6rem 1.2rem;
  border-radius: 8px; font-size: 0.85rem; border: 1px solid var(--border);
  z-index: 999; pointer-events: none;
}

/* --- Post Menu --- */
.post-menu-wrap { position: relative; margin-left: auto; }
.post-menu-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 1.2rem; padding: 0 0.3rem; line-height: 1;
}
.post-menu-btn:hover { color: var(--text); }
.post-menu {
  position: absolute; right: 0; top: 100%; z-index: 50;
  background: #1a1b1e; border: 1px solid var(--border); border-radius: 8px;
  min-width: 150px; box-shadow: 0 4px 16px rgba(0,0,0,0.5); overflow: hidden;
}
.post-menu-item {
  display: block; width: 100%; text-align: left; padding: 0.5rem 0.8rem;
  background: none; border: none; color: var(--dim); font-size: 0.85rem; cursor: pointer;
}
.post-menu-item:hover { background: var(--border); color: var(--text); }
.post-menu-item--danger { color: #e55; }
.post-menu-item--danger:hover { background: #e5533a; color: #fff; }
.vis-badge { font-size: 0.75rem; margin-left: 0.3rem; }
.vis-select {
  background: var(--card); color: var(--dim); border: 1px solid var(--border);
  border-radius: 4px; padding: 0.2rem 0.4rem; font-size: 0.8rem; cursor: pointer;
}
.edit-textarea {
  width: 100%; min-height: 60px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem;
  font-family: inherit; font-size: 0.9rem; resize: vertical;
}
.edit-actions { display: flex; gap: 0.4rem; margin-top: 0.4rem; }

/* --- Location --- */
.shout-location {
  font-size: 0.8rem; color: var(--muted); margin: -0.2rem 0 0.3rem;
  padding-left: 0.1rem;
}
.location-pin { font-size: 0.75rem; }

/* --- Import Modal --- */
.sidebar-desc { font-size: 0.82rem; color: var(--muted); margin: 0 0 0.6rem; }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  width: 100%; max-width: 460px; box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 1rem; }
.modal-close {
  background: none; border: none; color: var(--muted); font-size: 1.4rem;
  cursor: pointer; line-height: 1; padding: 0;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.2rem; }
.modal-body p { margin: 0 0 0.8rem; font-size: 0.9rem; color: var(--dim); }
.import-steps {
  margin: 0 0 1rem; padding-left: 1.4rem; font-size: 0.85rem; color: var(--dim);
  line-height: 1.7;
}
.import-file-label {
  display: block; padding: 0.7rem 1rem; border: 2px dashed var(--border);
  border-radius: 8px; text-align: center; cursor: pointer; margin-bottom: 0.8rem;
  font-size: 0.88rem; color: var(--muted); transition: border-color 0.2s;
}
.import-file-label:hover { border-color: var(--accent); color: var(--text); }
.import-spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 1rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.import-status { text-align: center; }
.import-result-text { text-align: center; font-size: 0.95rem; color: var(--text); }

/* --- Footer --- */
.fineprint {
  text-align: center; padding: 1.5rem 1rem; font-size: 0.75rem;
  color: var(--muted); border-top: 1px solid var(--line); margin-top: auto;
}
.fineprint a { color: var(--dim); }
.fineprint a:hover { color: var(--accent); text-decoration: underline; }

/* ============================================================
   FOLLOW LIST PAGE
   ============================================================ */
.follow-list-page {
  max-width: 600px; margin: 0 auto; padding: 1rem;
}
.follow-list-header { margin-bottom: 1rem; }
.follow-list-header .back-link {
  color: var(--dim); font-size: 0.85rem; text-decoration: none;
}
.follow-list-header .back-link:hover { color: var(--accent); }
.follow-list-header h1 {
  font-size: 1.4rem; margin: 0.5rem 0;
}
.follow-tabs {
  display: flex; gap: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem;
}
.follow-tabs .tab-link {
  color: var(--dim); text-decoration: none; font-size: 0.9rem; padding-bottom: 0.25rem;
  border-bottom: 2px solid transparent;
}
.follow-tabs .tab-link.active {
  color: var(--fg); border-bottom-color: var(--accent);
}
.follow-tabs .tab-link:hover { color: var(--fg); }
.follow-card {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0;
  border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.follow-card:hover { background: var(--hover); border-radius: 8px; padding-left: 0.5rem; padding-right: 0.5rem; }
.follow-avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.follow-avatar--placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 1.1rem;
}
.follow-info { display: flex; flex-direction: column; min-width: 0; }
.follow-name { font-weight: 600; color: var(--fg); }
.follow-handle { font-size: 0.85rem; color: var(--dim); }


/* ═════════════════════════════════════════════════════════════════════════
   Bot-account styling — per-source visual treatments
   Applied via data-source-app="<handle>" on .shout-card. Lets archival
   content (quotes, recipes, speeches, etc.) render with typography that
   matches the content type instead of the default micro-post density.
   ═════════════════════════════════════════════════════════════════════════ */

.shout-card--bot {
  padding: 1.25rem 1rem;
}
.shout-card--bot .shout-body {
  font-size: 1rem;
  line-height: 1.6;
}
.shout-card--bot .shout-body > h1:first-child,
.shout-card--bot .shout-body > h2:first-child {
  margin-top: 0;
}
/* The trailing hashtag paragraph on every bot post becomes a quiet pill row */
.shout-card--bot .shout-body > p:last-child:has(a.hashtag),
.shout-card--bot .shout-body > p:last-child {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.75rem;
  line-height: 1.4;
}
.shout-card--bot .shout-body > p:last-child a.hashtag,
.shout-card--bot .shout-body > p:last-child .hashtag {
  color: var(--muted);
  font-weight: 400;
  opacity: 0.75;
}
.shout-card--bot .shout-body > p:last-child a.hashtag:hover {
  color: var(--accent);
  opacity: 1;
}

/* ── @quote ─────────────────────────────────────────────────────────── */
[data-source-app="quote"] {
  border-left: 3px solid #c4b5fd;
  background: linear-gradient(180deg, rgba(196,181,253,0.04), transparent 40%);
}
[data-source-app="quote"] .shout-body {
  font-family: Georgia, "Source Serif 4", "Source Serif Pro", Cambria, serif;
  font-size: 1.18rem;
  line-height: 1.55;
  letter-spacing: 0.005em;
}
[data-source-app="quote"] .shout-body blockquote {
  border-left: none;
  margin: 0.25rem 0 0.6rem;
  padding: 0.25rem 0 0.25rem 2.25rem;
  font-style: italic;
  color: var(--text);
  position: relative;
}
[data-source-app="quote"] .shout-body blockquote::before {
  content: "“";
  position: absolute;
  left: 0.15rem;
  top: -0.9rem;
  font-size: 3.2rem;
  line-height: 1;
  color: rgba(196,181,253,0.45);
  font-family: Georgia, serif;
}
[data-source-app="quote"] .shout-body blockquote p { margin-bottom: 0.35rem; }
[data-source-app="quote"] .shout-body blockquote p:last-child {
  /* attribution line (— Name) */
  font-style: normal;
  font-size: 0.92rem;
  color: var(--dim);
  margin-top: 0.6rem;
}
[data-source-app="quote"] .shout-body > p {
  /* context paragraph */
  font-size: 0.88rem;
  color: var(--dim);
  font-style: italic;
}

/* ── @speech ────────────────────────────────────────────────────────── */
[data-source-app="speech"] {
  border-left: 3px solid #b7a378;
}
[data-source-app="speech"] .shout-body h1 {
  font-family: Georgia, "Source Serif 4", serif;
  font-size: 1.5rem;
  line-height: 1.2;
  margin: 0 0 0.4rem;
  font-weight: 700;
}
[data-source-app="speech"] .shout-body > p:nth-child(2) {
  /* "Speaker · Date · Location" byline */
  color: var(--dim);
  font-size: 0.88rem;
  margin-bottom: 1rem;
  letter-spacing: 0.01em;
}
[data-source-app="speech"] .shout-body blockquote {
  font-family: Georgia, "Source Serif 4", serif;
  font-size: 1.08rem;
  line-height: 1.55;
  font-style: italic;
  border-left: 2px solid #b7a378;
  padding: 0.4rem 0 0.4rem 1rem;
  margin: 0.75rem 0;
  color: var(--text);
}
[data-source-app="speech"] .shout-body > p strong {
  /* "Context." "Impact." section labels */
  color: #b7a378;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
}

/* ── @recipes ───────────────────────────────────────────────────────── */
[data-source-app="recipes"] {
  border-left: 3px solid #86c77a;
}
[data-source-app="recipes"] .shout-body h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.25;
}
[data-source-app="recipes"] .shout-body > p strong {
  /* **Cuisine:** **Prep:** etc. */
  color: var(--text);
  font-weight: 600;
}
[data-source-app="recipes"] .shout-body > p:has(strong) {
  /* meta line (· separated) */
  background: rgba(134,199,122,0.07);
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
  color: var(--dim);
  margin: 0.5rem 0;
  display: inline-block;
  line-height: 1.6;
}
[data-source-app="recipes"] .shout-body a[href*="/recipes/"] {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.3rem 0.7rem;
  background: rgba(134,199,122,0.14);
  border: 1px solid rgba(134,199,122,0.28);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #a7d79c;
  text-decoration: none;
}
[data-source-app="recipes"] .shout-body a[href*="/recipes/"]:hover {
  background: rgba(134,199,122,0.22);
  text-decoration: none;
}

/* ── @art, @photography, @loc — image-first placard style ──────────── */
[data-source-app="art"],
[data-source-app="photography"],
[data-source-app="loc"] {
  border-left: 3px solid #d4a373;
}
[data-source-app="art"] .shout-body h1,
[data-source-app="photography"] .shout-body h1,
[data-source-app="loc"] .shout-body h1 {
  font-family: Georgia, "Source Serif 4", serif;
  font-size: 1.15rem;
  font-weight: 600;
  font-style: italic;
  margin: 0 0 0.4rem;
  color: var(--text);
}
[data-source-app="art"] .shout-body > p em,
[data-source-app="photography"] .shout-body > p em,
[data-source-app="loc"] .shout-body > p em {
  /* attribution line */
  font-size: 0.85rem;
  color: var(--dim);
  font-style: normal;
}
[data-source-app="art"] .shout-body > p,
[data-source-app="photography"] .shout-body > p,
[data-source-app="loc"] .shout-body > p {
  font-size: 0.9rem;
  color: var(--dim);
  line-height: 1.55;
}

/* ── @history ───────────────────────────────────────────────────────── */
[data-source-app="history"] {
  border-left: 3px solid #7a9cc4;
}
[data-source-app="history"] .shout-body h1 {
  font-family: Georgia, "Source Serif 4", serif;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 0.8rem;
  color: var(--text);
}
[data-source-app="history"] .shout-body p strong {
  /* "Events" "Born today" "Died today" section labels */
  display: block;
  color: #7a9cc4;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin: 1rem 0 0.2rem;
  font-weight: 600;
}
[data-source-app="history"] .shout-body ul {
  margin: 0 0 0.5rem;
  padding-left: 1.15rem;
  list-style-type: none;
}
[data-source-app="history"] .shout-body ul li {
  position: relative;
  padding: 0.2rem 0;
  font-size: 0.92rem;
  line-height: 1.5;
}
[data-source-app="history"] .shout-body ul li::before {
  content: "›";
  position: absolute;
  left: -1rem;
  color: #7a9cc4;
  font-weight: 700;
}
[data-source-app="history"] .shout-body ul li a {
  color: #7a9cc4;
  opacity: 0.7;
  font-size: 0.82rem;
  text-decoration: none;
  margin-left: 0.3rem;
}
[data-source-app="history"] .shout-body ul li a:hover { opacity: 1; }

/* ── @policy ────────────────────────────────────────────────────────── */
[data-source-app="policy"] {
  border-left: 3px solid #c47a9c;
}
[data-source-app="policy"] .shout-body h1 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.4rem;
}
[data-source-app="policy"] .shout-body > p:nth-child(2) strong {
  /* Source name — first meta bold */
  display: inline-block;
  background: rgba(196,122,156,0.12);
  color: #e0a8c1;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
[data-source-app="policy"] .shout-body > p:nth-child(3) {
  /* Excerpt */
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.55;
}

/* ── @movies ────────────────────────────────────────────────────────── */
[data-source-app="movies"] {
  border-left: 3px solid #d4843f;
}
[data-source-app="movies"] .shout-body h1 {
  font-family: Georgia, "Source Serif 4", serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
  line-height: 1.2;
}
[data-source-app="movies"] .shout-body > p:nth-child(2) {
  /* "Release: · Director: · Runtime: · Genres: " meta */
  font-size: 0.82rem;
  color: #d4843f;
  margin-bottom: 0.8rem;
  font-family: var(--mono);
  letter-spacing: 0.01em;
}
[data-source-app="movies"] .shout-body > p:nth-child(3) {
  /* Synopsis */
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text);
}

