/* ==========================================
   PLEADING SANITY — SURVIVOR SOCIAL
   Auth, profiles, community, posts & feed.
   Loaded after site.css on social pages. Nav
   account styles live in site.css.
============================================ */

/* ─── AVATARS ─── */
.ps-avatar {
  --size: 40px;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--size); height: var(--size); border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(0, 255, 240, 0.35), rgba(255, 0, 255, 0.25) 70%, #0d1b2a);
  border: 1px solid rgba(0, 255, 240, 0.45); color: #eafffd;
  font-size: calc(var(--size) * 0.5); font-weight: 800; line-height: 1; overflow: hidden;
}
.ps-avatar.sm { --size: 34px; }
.ps-avatar.lg { --size: 96px; }

/* ─── MOOD BADGES ─── */
.mood { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; border: 1px solid; white-space: nowrap; }
.mood-low { color: #b9d4ff; border-color: rgba(120, 160, 255, 0.55); background: rgba(120, 160, 255, 0.1); }
.mood-anxious { color: #ffe08a; border-color: rgba(255, 215, 0, 0.5); background: rgba(255, 215, 0, 0.08); }
.mood-rising { color: #8ffff7; border-color: rgba(0, 255, 240, 0.5); background: rgba(0, 255, 240, 0.08); }
.mood-fierce { color: #ffb3ff; border-color: rgba(255, 0, 255, 0.55); background: rgba(255, 0, 255, 0.1); }

/* ─── LAYOUT & PANELS ─── */
.social-main { max-width: 760px; margin: 0 auto; padding: 1.5rem 1rem 3rem; width: 100%; }
.social-main.wide { max-width: 1040px; }
.social-head { text-align: center; padding: 2rem 0 1.25rem; }
.social-head h1 {
  margin: 0 0 0.5rem; font-size: clamp(1.9rem, 5vw, 2.8rem); line-height: 1.15;
  background: linear-gradient(135deg, #00fff0, #ff00ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.social-head p { color: #b9faff; margin: 0 auto; max-width: 56ch; }
.panel {
  background: linear-gradient(135deg, rgba(0, 255, 240, 0.06), rgba(255, 0, 255, 0.04));
  border: 1px solid rgba(0, 255, 240, 0.18); border-radius: 20px; padding: 1.5rem; margin: 0 0 1.25rem;
}
.panel h2 { margin: 0 0 0.75rem; font-size: 1.25rem; color: #00fff0; }
.panel-auth { max-width: 460px; margin: 0 auto; }
.muted { color: #a9c7d1; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden, [hidden] { display: none !important; }

/* ─── FORMS ─── */
.field { display: block; margin: 0 0 1rem; }
.field > span, .field legend { display: block; margin: 0 0 6px; font-weight: 700; color: #eafffd; font-size: 0.95rem; }
.field small { display: block; margin-top: 4px; color: #a9c7d1; font-size: 0.85rem; }
.field fieldset { border: 0; margin: 0; padding: 0; }
.input, .field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="search"], .field input[type="url"], .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 14px;
  border: 1.5px solid rgba(0, 255, 240, 0.25); background: rgba(255, 255, 255, 0.05);
  color: #eafffd; font: inherit; font-size: 1rem; transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.field select option { background: #0d1b2a; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #00fff0; box-shadow: 0 0 0 3px rgba(0, 255, 240, 0.25); }
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: #8fb3bf; }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: #00fff0; flex: none; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 1.5px solid #00fff0; background: rgba(0, 255, 240, 0.1);
  color: #eafffd; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; text-decoration: none;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.sbtn:hover { background: rgba(0, 255, 240, 0.2); color: #fff; text-decoration: none; }
.sbtn:focus-visible { outline: 3px solid #00fff0; outline-offset: 2px; }
.sbtn.primary { background: linear-gradient(135deg, #00fff0, #ff00ff); color: #000103; border-color: transparent; box-shadow: 0 0 20px rgba(0, 255, 240, 0.25); }
.sbtn.primary:hover { color: #000103; box-shadow: 0 0 28px rgba(255, 0, 255, 0.35); }
.sbtn.ghost { border-color: rgba(0, 255, 240, 0.35); background: transparent; }
.sbtn.danger { border-color: #ff6b8b; color: #ffc2d0; background: rgba(255, 60, 100, 0.08); }
.sbtn.danger:hover { background: #ff6b8b; color: #000103; }
.sbtn.small { min-height: 44px; padding: 0 14px; font-size: 0.9rem; }
.sbtn.block { width: 100%; }
.sbtn[disabled], .sbtn[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.linkish { background: none; border: 0; padding: 0; color: #00fff0; font: inherit; cursor: pointer; text-decoration: underline; min-height: 44px; }

.notice { padding: 12px 16px; border-radius: 14px; margin: 0 0 1rem; border: 1px solid; font-size: 0.95rem; }
.notice.ok { color: #c8fff9; border-color: rgba(0, 255, 240, 0.45); background: rgba(0, 255, 240, 0.08); }
.notice.err { color: #ffd0dc; border-color: rgba(255, 90, 130, 0.6); background: rgba(255, 60, 100, 0.1); }
.notice.info { color: #ffe9a8; border-color: rgba(255, 215, 0, 0.45); background: rgba(255, 215, 0, 0.07); }
.divider { display: flex; align-items: center; gap: 12px; color: #a9c7d1; margin: 1.25rem 0; font-size: 0.9rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid rgba(0, 255, 240, 0.2); }

/* Emoji avatar picker & chip pickers */
.picker { display: flex; flex-wrap: wrap; gap: 8px; }
.picker button, .chip {
  min-width: 48px; min-height: 48px; padding: 0 12px; border-radius: 14px; font: inherit; cursor: pointer;
  border: 1.5px solid rgba(0, 255, 240, 0.25); background: rgba(255, 255, 255, 0.04); color: #eafffd;
}
.picker button { font-size: 1.5rem; }
.chip { min-height: 44px; border-radius: 999px; font-size: 0.9rem; font-weight: 600; }
.picker button[aria-pressed="true"], .chip[aria-pressed="true"] { border-color: #00fff0; background: rgba(0, 255, 240, 0.18); box-shadow: 0 0 12px rgba(0, 255, 240, 0.3); }
.picker button:focus-visible, .chip:focus-visible { outline: 3px solid #00fff0; outline-offset: 2px; }

/* ─── TABS ─── */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 1.25rem; }
.tabs button { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(0, 255, 240, 0.3); background: transparent; color: #eafffd; font: inherit; font-weight: 700; cursor: pointer; }
.tabs button[aria-selected="true"], .tabs button[aria-pressed="true"] { background: #00fff0; color: #000103; border-color: #00fff0; }
.tabs button:focus-visible { outline: 3px solid #00fff0; outline-offset: 2px; }

/* ─── PEOPLE CARDS ─── */
.people { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.person { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; border: 1px solid rgba(0, 255, 240, 0.18); background: rgba(0, 255, 240, 0.04); }
.person-body { flex: 1; min-width: 0; }
.person-name { color: #eafffd; font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.person-name:hover { color: #00fff0; }
.person-meta { color: #a9c7d1; font-size: 0.85rem; }
.person-bio { color: #c9e9ef; font-size: 0.9rem; margin: 4px 0 8px; overflow-wrap: anywhere; }
.tagline { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.tagline span, .tagline a { font-size: 0.8rem; padding: 2px 10px; border-radius: 999px; border: 1px solid rgba(0, 255, 240, 0.25); color: #b9faff; text-decoration: none; }
.tagline a:hover { border-color: #ff00ff; color: #ffb3ff; }

/* ─── PROFILE ─── */
.profile-top { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile-top h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.2rem); color: #eafffd; }
.profile-stats { display: flex; gap: 18px; flex-wrap: wrap; margin: 8px 0; color: #b9faff; font-size: 0.95rem; }
.profile-stats strong { color: #00fff0; }
.story-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; color: #d9f7fb; }

/* ─── POSTS ─── */
.post { position: relative; background: linear-gradient(135deg, rgba(0, 255, 240, 0.06), rgba(255, 0, 255, 0.04)); border: 1px solid rgba(0, 255, 240, 0.16); border-radius: 20px; padding: 18px; margin: 0 0 18px; }
.post-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.post-author { font-weight: 800; color: #eafffd; text-decoration: none; }
.post-author:hover { color: #00fff0; }
.post-time { color: #a9c7d1; font-size: 0.82rem; }
.post h3 { margin: 4px 0 8px; font-size: 1.2rem; color: #00fff0; overflow-wrap: anywhere; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; color: #e2fbfd; line-height: 1.75; }
.post-body.clamp { display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.post-media { margin: 12px 0; border-radius: 14px; overflow: hidden; border: 1px solid rgba(0, 255, 240, 0.18); background: #000103; }
.post-media iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.post-media img { display: block; width: 100%; height: auto; max-height: 640px; object-fit: contain; }
.post-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 12px; border-top: 1px solid rgba(0, 255, 240, 0.1); padding-top: 10px; }
.post-actions button, .post-actions a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid transparent; background: none; color: #b9faff; font: inherit; font-size: 0.9rem; cursor: pointer; text-decoration: none; }
.post-actions button:hover, .post-actions a:hover { border-color: rgba(0, 255, 240, 0.35); color: #fff; }
.post-actions button:focus-visible { outline: 3px solid #00fff0; outline-offset: 2px; }
.post-actions .liked { color: #ff7ad9; }
.post-actions .report { margin-left: auto; color: #a9c7d1; }

/* Content warning — click to reveal */
.cw-wrap { position: relative; }
.cw-wrap.veiled .cw-content { filter: blur(14px); user-select: none; pointer-events: none; max-height: 160px; overflow: hidden; }
.cw-cover { display: none; }
.cw-wrap.veiled .cw-cover {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-align: center; padding: 16px; border-radius: 14px; background: rgba(0, 1, 3, 0.7); border: 1px dashed rgba(255, 215, 0, 0.5);
}
.cw-cover strong { color: #ffe08a; }
.cw-cover p { margin: 0; color: #d9f7fb; font-size: 0.9rem; }

/* Crisis support strip */
.crisis-strip { margin: 12px 0 0; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255, 0, 255, 0.5); background: rgba(255, 0, 255, 0.08); color: #ffe6ff; font-size: 0.92rem; line-height: 1.6; }
.crisis-strip a { color: #ffb3ff; font-weight: 800; }
.tw-banner { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 800; color: #ffe08a; border: 1px solid rgba(255, 215, 0, 0.5); background: rgba(255, 215, 0, 0.08); }

/* Comments */
.comments { margin-top: 10px; padding-top: 6px; }
.comment { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(0, 255, 240, 0.08); }
.comment-body { flex: 1; min-width: 0; }
.comment-body p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: #e2fbfd; }
.comment-form { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.comment-form textarea { flex: 1; min-height: 48px; max-height: 200px; resize: vertical; padding: 12px 14px; border-radius: 14px; border: 1.5px solid rgba(0, 255, 240, 0.25); background: rgba(255, 255, 255, 0.05); color: #eafffd; font: inherit; }
.comment-form textarea:focus { outline: none; border-color: #00fff0; box-shadow: 0 0 0 3px rgba(0, 255, 240, 0.25); }

/* Post composer */
.kind-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 1rem; }
.kind-tabs button { min-height: 56px; border-radius: 14px; border: 1.5px solid rgba(0, 255, 240, 0.25); background: rgba(255, 255, 255, 0.04); color: #eafffd; font: inherit; font-weight: 700; cursor: pointer; }
.kind-tabs button[aria-pressed="true"] { border-color: #00fff0; background: rgba(0, 255, 240, 0.16); }
.kind-tabs button:focus-visible { outline: 3px solid #00fff0; outline-offset: 2px; }
.ai-box { border: 1px dashed rgba(255, 0, 255, 0.5); background: rgba(255, 0, 255, 0.05); border-radius: 16px; padding: 16px; margin: 0 0 1rem; }
.ai-box h2 { color: #ffb3ff; }
.preview-img { max-width: 100%; max-height: 320px; border-radius: 12px; display: block; margin-top: 10px; }

/* Dialog */
.ps-dialog { max-width: min(92vw, 480px); padding: 0; border: 1px solid rgba(0, 255, 240, 0.35); border-radius: 18px; background: #06101c; color: #eafffd; }
.ps-dialog::backdrop { background: rgba(0, 1, 3, 0.75); }
.ps-dialog form { padding: 1.5rem; }
.ps-dialog h2 { margin: 0 0 0.75rem; color: #00fff0; font-size: 1.2rem; }

.empty { text-align: center; padding: 2rem 1rem; color: #a9c7d1; }
.skeleton { height: 120px; border-radius: 20px; margin-bottom: 18px; background: linear-gradient(90deg, rgba(0, 255, 240, 0.04), rgba(0, 255, 240, 0.1), rgba(0, 255, 240, 0.04)); background-size: 200% 100%; animation: psShimmer 1.4s infinite linear; }
@keyframes psShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ─── PROFILE: Cosmic Player & Saved (own profile only) ─── */
.pp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0.5rem 0 1rem; }
.pp-stats > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border: 1px solid rgba(0, 255, 240, 0.25); border-radius: 14px; background: rgba(0, 255, 240, 0.05); text-align: center; }
.pp-stats strong { color: #00fff0; font-size: 1.15rem; }
.pp-stats span { color: #a9c7d1; font-size: 0.8rem; }
.pp-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.pp-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #00fff0, #ff00ff); box-shadow: 0 0 12px rgba(0, 255, 240, 0.5); }
.pp-badges { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 1rem 0; list-style: none; }
.pp-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid rgba(255, 0, 255, 0.45); border-radius: 999px; background: rgba(255, 0, 255, 0.08); font-size: 0.85rem; font-weight: 600; }
.pp-saved { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; }
.pp-saved li > a, .pp-saved li > span { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(0, 255, 240, 0.18); color: #eafffd; text-decoration: none; }
.pp-saved li > a:hover, .pp-saved li > a:focus-visible { border-color: #00fff0; background: rgba(0, 255, 240, 0.06); }
@media (max-width: 520px) { .pp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
