/* public/feed.css — Pherson 2.13.0
   ---------------------------------------------------------------------------
   THE FEED — the picture board that now sits behind the Home tab.

   Same rules as hub.css: everything is namespaced .pf-* and lives in its own
   file, so it can't collide with style.css or hub.css. It borrows the warm
   palette hub.css already declares (--ph-warm*, --ph-purple*) rather than
   inventing a second one, so Home and Feed feel like the same daylight app.

   The grid is CSS columns, not flex or grid-auto-rows. Real masonry with no
   JavaScript measuring pass and no reflow jank while pictures stream in — the
   only cost is that cards read top-to-bottom per column, which is how every
   picture board behaves anyway.
   --------------------------------------------------------------------------- */

:root {
  --pf-bg:       #f4efe9;
  --pf-surface:  #ffffff;
  --pf-ink:      #221d2e;
  --pf-ink-2:    #5d5670;
  --pf-mute:     #8b8399;
  --pf-line:     rgba(34, 29, 46, .09);
  --pf-dark:     #1b1622;
  --pf-radius:   18px;
  --pf-gap:      12px;
}

/* ===========================================================================
   SCREEN
   =========================================================================== */
.pf-feed {
  background: var(--pf-bg);
  color: var(--pf-ink);
}
.pf-wrap { max-width: 720px; margin: 0 auto; padding: 0 14px; }

/* --------------------------------------------------------------- header */
.pf-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 26px 0 4px;
}
.pf-title {
  margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -.03em;
  color: var(--pf-ink); line-height: 1.05;
}
.pf-sub { margin: 6px 0 0; font-size: 13px; color: var(--pf-mute); }
.pf-head-actions { display: flex; gap: 8px; flex: 0 0 auto; padding-top: 4px; }
.pf-ico {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 0; color: var(--pf-ink-2);
  transition: background .16s, color .16s;
}
.pf-ico:hover { background: rgba(34, 29, 46, .06); color: var(--pf-ink); }
.pf-ico svg { width: 21px; height: 21px; }
.pf-ico .pf-dot {
  position: absolute; margin: -16px 0 0 15px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--ph-purple-2, #8b5cf6);
}

/* ------------------------------------------------------------ tab strip */
.pf-tabrow { display: flex; align-items: center; gap: 10px; padding: 14px 0 16px; }
.pf-tabs {
  flex: 1; display: flex; align-items: center; gap: 4px; padding: 5px;
  background: rgba(255, 255, 255, .74); border: 1px solid var(--pf-line);
  border-radius: 100px;
}
.pf-tab {
  flex: 1; padding: 9px 6px; border: 0; border-radius: 100px; cursor: pointer;
  background: transparent; color: var(--pf-mute);
  font: inherit; font-size: 13.5px; font-weight: 600; white-space: nowrap;
  transition: background .18s, color .18s;
}
.pf-tab.is-on {
  background: #ece3fb; color: var(--ph-purple-2, #8b5cf6); font-weight: 700;
}
.pf-filter {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(255, 255, 255, .74); border: 1px solid var(--pf-line);
  color: var(--pf-ink-2);
}
.pf-filter.is-on { background: #ece3fb; border-color: transparent; color: var(--ph-purple-2, #8b5cf6); }
.pf-filter svg { width: 19px; height: 19px; }

/* Character chips — the "hashtag but not a hashtag" row. */
.pf-chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 0 0 14px;
  scrollbar-width: none;
}
.pf-chips::-webkit-scrollbar { display: none; }
.pf-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px 7px 7px; border-radius: 100px; cursor: pointer;
  background: var(--pf-surface); border: 1px solid var(--pf-line);
  color: var(--pf-ink-2); font: inherit; font-size: 13px; font-weight: 600;
}
.pf-chip.no-av { padding-left: 13px; }
.pf-chip.is-on {
  background: var(--pf-dark); border-color: var(--pf-dark); color: #fff;
}
.pf-chip img {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover; display: block;
}

/* ===========================================================================
   THE BOARD
   =========================================================================== */
.pf-grid { column-count: 2; column-gap: var(--pf-gap); padding-bottom: 8px; }
@media (min-width: 620px) { .pf-grid { column-count: 3; } }

.pf-card {
  break-inside: avoid; -webkit-column-break-inside: avoid;
  margin: 0 0 var(--pf-gap); border-radius: var(--pf-radius);
  overflow: hidden; position: relative; cursor: pointer;
  background: var(--pf-surface);
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease;
}
.pf-card:active { transform: scale(.985); }
.pf-card.has-img { background: var(--pf-dark); }

.pf-shot { display: block; width: 100%; height: auto; object-fit: cover; background: #e6ded4; }
/* Reserve the box before the bytes arrive so the column doesn't jump. */
.pf-shot[data-ar] { aspect-ratio: var(--ar); }

/* ---------------------------------------------------------------- caption
   The only thing that shows at rest. Sits on the picture, bottom-left, over a
   scrim just dark enough to keep white text legible on a pale photo without
   greying out the image itself. */
.pf-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 34px 14px 13px;
  background: linear-gradient(to top,
    rgba(8, 6, 12, .82) 0%, rgba(8, 6, 12, .55) 45%, rgba(8, 6, 12, 0) 100%);
  pointer-events: none;
}
.pf-cap p {
  margin: 0; color: #fff; font-size: 14.5px; font-weight: 600; line-height: 1.32;
  letter-spacing: -.005em; overflow-wrap: anywhere;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .45);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* A post with no picture is all caption, so it becomes the card itself. */
.pf-card.no-img { border: 1px solid var(--pf-line); }
.pf-card.no-img .pf-cap {
  position: static; padding: 16px 15px; background: none;
}
.pf-card.no-img .pf-cap p {
  color: var(--pf-ink); text-shadow: none; font-size: 15px;
  font-weight: 600; -webkit-line-clamp: 8;
}
.pf-card.no-img.tone-1 { background: #fdfbf8; }
.pf-card.no-img.tone-2 { background: #f6f1fb; }
.pf-card.no-img.tone-3 { background: #fbf3ee; }

/* ------------------------------------------------------------------ hover
   The tag and the \u22ef menu are not part of the picture — they appear when a
   pointer is over the card and vanish again. Guarded behind (hover: hover) so
   a phone, which can't hover, never gets stuck showing them: on touch these
   same actions live in the post sheet instead. */
.pf-hover {
  position: absolute; top: 9px; left: 9px; right: 9px; z-index: 3;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  opacity: 0; pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease;
}
@media (hover: hover) and (pointer: fine) {
  .pf-card:hover .pf-hover { opacity: 1; transform: none; pointer-events: auto; }
  .pf-card:hover::before {
    content: ''; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(to bottom, rgba(8, 6, 12, .38), rgba(8, 6, 12, 0) 42%);
    pointer-events: none;
  }
  .pf-card:hover { transform: translateY(-2px); }
}
/* Keyboard users get the same affordances without a mouse. */
.pf-card:focus-within .pf-hover { opacity: 1; transform: none; pointer-events: auto; }

.pf-tag {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 76%; padding: 6px 11px; border-radius: 100px;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 0; cursor: pointer; font: inherit;
  font-size: 11.5px; font-weight: 700; color: var(--pf-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .5);
}
.pf-tag i {
  width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto;
  background: var(--ph-purple-2, #8b5cf6);
}
.pf-tag.is-general i { background: #d9b26a; }
.pf-more {
  flex: 0 0 auto;
  width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .93); color: var(--pf-ink);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .5);
}
.pf-more svg { width: 15px; height: 15px; }

/* --------------------------------------------------------- states */
.pf-empty {
  padding: 60px 24px; text-align: center; color: var(--pf-mute); font-size: 13.5px;
}
.pf-empty b { display: block; color: var(--pf-ink); font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.pf-empty button {
  margin-top: 18px; padding: 11px 22px; border-radius: 100px; border: 0; cursor: pointer;
  background: var(--ph-purple-2, #8b5cf6); color: #fff; font: inherit; font-weight: 700; font-size: 14px;
}
.pf-skel {
  break-inside: avoid; margin: 0 0 var(--pf-gap); border-radius: var(--pf-radius);
  background: linear-gradient(100deg, #ece4da 30%, #f6f0e8 50%, #ece4da 70%);
  background-size: 200% 100%; animation: pf-sh 1.3s linear infinite;
}
@keyframes pf-sh { to { background-position: -200% 0; } }
.pf-more-wrap { padding: 6px 0 22px; text-align: center; }
.pf-loadmore {
  padding: 11px 26px; border-radius: 100px; cursor: pointer;
  background: var(--pf-surface); border: 1px solid var(--pf-line);
  color: var(--pf-ink-2); font: inherit; font-size: 13.5px; font-weight: 600;
}

/* ===========================================================================
   SHEETS — composer and post detail
   =========================================================================== */
.pf-sheet {
  position: fixed; inset: 0; z-index: 1400; display: none;
  background: rgba(16, 12, 24, .55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.pf-sheet.is-on { display: block; }
.pf-sheet-card {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(560px, 100%); max-height: 92vh; overflow-y: auto;
  background: var(--pf-bg); color: var(--pf-ink);
  border-radius: 24px 24px 0 0;
  padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
  animation: pf-up .26s cubic-bezier(.22, 1, .36, 1);
}
@keyframes pf-up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.pf-sheet-card::-webkit-scrollbar { width: 0; }

.pf-sheet-head {
  position: sticky; top: 0; z-index: 3; background: var(--pf-bg);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 0 12px; margin-bottom: 4px;
}
.pf-sheet-head h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.pf-x {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(34, 29, 46, .07); color: var(--pf-ink);
}
.pf-x svg { width: 17px; height: 17px; }
.pf-post-btn {
  padding: 9px 20px; border-radius: 100px; border: 0; cursor: pointer;
  background: var(--ph-purple-2, #8b5cf6); color: #fff;
  font: inherit; font-size: 14px; font-weight: 700;
}
.pf-post-btn:disabled { opacity: .45; cursor: default; }

/* ------------------------------------------------------------- composer */
.pf-drop {
  position: relative; border-radius: var(--pf-radius); overflow: hidden;
  border: 1.5px dashed rgba(34, 29, 46, .2); background: var(--pf-surface);
  min-height: 190px; display: grid; place-items: center; cursor: pointer;
  text-align: center; padding: 26px 18px; color: var(--pf-mute);
}
.pf-drop.has-img { border-style: solid; border-color: transparent; padding: 0; min-height: 0; }
.pf-drop svg { width: 30px; height: 30px; margin-bottom: 10px; color: var(--ph-purple-2, #8b5cf6); }
.pf-drop b { display: block; color: var(--pf-ink); font-size: 14.5px; font-weight: 700; margin-bottom: 4px; }
.pf-drop span { font-size: 12.5px; }
.pf-drop img { display: block; width: 100%; height: auto; }
.pf-drop-x {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: rgba(10, 8, 14, .62); color: #fff;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pf-drop-x svg { width: 15px; height: 15px; margin: 0; color: #fff; }

.pf-field { margin-top: 14px; }
.pf-label {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--pf-mute); margin-bottom: 9px;
}
.pf-area {
  width: 100%; min-height: 84px; resize: vertical; padding: 13px 14px;
  border-radius: 14px; border: 1px solid var(--pf-line); background: var(--pf-surface);
  color: var(--pf-ink); font: inherit; font-size: 14.5px; line-height: 1.45;
}
.pf-area:focus { outline: 2px solid rgba(139, 92, 246, .35); outline-offset: 0; }
.pf-count { text-align: right; font-size: 11.5px; color: var(--pf-mute); margin-top: 6px; }

.pf-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-pick {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 8px; border-radius: 100px; cursor: pointer;
  background: var(--pf-surface); border: 1.5px solid var(--pf-line);
  color: var(--pf-ink-2); font: inherit; font-size: 13px; font-weight: 600;
}
.pf-pick.no-av { padding-left: 14px; }
.pf-pick img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.pf-pick.is-on {
  border-color: var(--ph-purple-2, #8b5cf6); background: #f1eafd;
  color: var(--ph-purple-2, #8b5cf6);
}
.pf-pick-note { font-size: 12px; color: var(--pf-mute); margin: 10px 0 0; line-height: 1.45; }
.pf-groups { margin-top: 12px; }
.pf-group-lab { font-size: 11.5px; font-weight: 700; color: var(--pf-mute); margin: 14px 0 8px; }
.pf-err {
  margin-top: 12px; padding: 10px 13px; border-radius: 12px;
  background: #fdecef; color: #b32844; font-size: 13px; font-weight: 600;
}
.pf-err[hidden] { display: none; }

/* ---------------------------------------------------------------- detail */
.pf-detail-shot {
  display: block; width: 100%; height: auto; border-radius: var(--pf-radius);
  background: #e6ded4;
}
.pf-detail-text { margin: 14px 0 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.pf-detail-by { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; }
.pf-detail-by .pf-av, .pf-detail-by .pf-av-f { width: 34px; height: 34px; font-size: 13px; }
.pf-detail-by .pf-name { font-size: 14px; }
.pf-detail-by .pf-when { font-size: 11.5px; }
.pf-detail-by { padding-bottom: 14px; border-bottom: 1px solid var(--pf-line); }
/* In the sheet the tag is always visible — this is the screen where context
   is the point, so it doesn't hide behind a hover. */
.pf-detail-by .pf-tag {
  margin-left: auto; opacity: 1; box-shadow: none;
  background: #efe9fa; max-width: 46%;
}

/* ------------------------------------------------------------ reach (admin)
   Only rendered when the server sent view numbers, which it does for admins
   only. Nobody else's markup contains it. */
.pf-reach {
  margin: 14px 0 4px; padding: 12px 14px; border-radius: 14px;
  background: #efe9fa; border: 1px solid rgba(139, 92, 246, .18);
}
.pf-reach-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-reach-lab {
  font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ph-purple-2, #8b5cf6);
}
.pf-reach-num { font-size: 13px; font-weight: 600; color: var(--pf-ink-2); }
.pf-reach-btn {
  margin-left: auto; padding: 6px 13px; border-radius: 100px; cursor: pointer;
  background: var(--ph-purple-2, #8b5cf6); border: 0; color: #fff;
  font: inherit; font-size: 12px; font-weight: 700;
}
.pf-viewers { margin-top: 10px; border-top: 1px solid rgba(139, 92, 246, .18); }
.pf-viewer { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.pf-viewer .pf-av, .pf-viewer .pf-av-f { width: 28px; height: 28px; font-size: 12px; }
.pf-handle { font-weight: 500; color: var(--pf-mute); }

.pf-cmts { border-top: 1px solid var(--pf-line); padding-top: 4px; }
.pf-cmt { display: flex; gap: 10px; padding: 12px 0; }
.pf-cmt .pf-av, .pf-cmt .pf-av-f { width: 30px; height: 30px; font-size: 12px; }
.pf-cmt-body { min-width: 0; flex: 1; }
.pf-cmt-top { display: flex; align-items: baseline; gap: 8px; }
.pf-cmt-name { font-size: 13px; font-weight: 700; }
.pf-cmt-when { font-size: 11px; color: var(--pf-mute); }
.pf-cmt-text { font-size: 13.5px; line-height: 1.45; margin-top: 3px; overflow-wrap: anywhere; }
.pf-cmt-del {
  background: none; border: 0; cursor: pointer; padding: 2px;
  color: var(--pf-mute); font: inherit; font-size: 11.5px;
}
.pf-cmt-none { padding: 20px 0 24px; text-align: center; color: var(--pf-mute); font-size: 13px; }

.pf-cmt-bar {
  position: sticky; bottom: 0; z-index: 3; display: flex; gap: 9px;
  align-items: flex-end;                 /* send button hugs the bottom as it grows */
  padding: 12px 0 6px; background: var(--pf-bg);
  border-top: 1px solid var(--pf-line);
}
/* A textarea, not an input, so a long reply doesn't scroll sideways through a
   one-line slot. JS grows it to a ceiling; after that it scrolls. The pill
   radius softens to a rounded box as soon as it's more than one line. */
.pf-cmt-in {
  flex: 1; min-width: 0; padding: 11px 16px; border-radius: 20px;
  border: 1px solid var(--pf-line); background: var(--pf-surface);
  color: var(--pf-ink); font: inherit; font-size: 14px; line-height: 1.4;
  resize: none; overflow-y: auto; max-height: 132px;
  font-family: inherit;
}
.pf-cmt-in::-webkit-scrollbar { width: 0; }
.pf-cmt-in:focus { outline: 2px solid rgba(139, 92, 246, .3); }
.pf-cmt-send {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: var(--ph-purple-2, #8b5cf6);
}
.pf-cmt-send:disabled { opacity: .4; }
.pf-cmt-send svg { width: 19px; height: 19px; }

/* --------------------------------------------------------------- menu */
.pf-menu {
  position: fixed; inset: 0; z-index: 1500; display: none;
  background: rgba(16, 12, 24, .4);
}
.pf-menu.is-on { display: block; }
.pf-menu-card {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(460px, 100%);
  padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 14px);
  background: var(--pf-bg); border-radius: 22px 22px 0 0;
  animation: pf-up .22s cubic-bezier(.22, 1, .36, 1);
}
.pf-menu-item {
  display: block; width: 100%; text-align: left; padding: 15px 14px;
  border: 0; border-radius: 14px; cursor: pointer; background: transparent;
  color: var(--pf-ink); font: inherit; font-size: 15px; font-weight: 600;
}
.pf-menu-item:hover { background: rgba(34, 29, 46, .05); }
.pf-menu-item.danger { color: #d1305a; }

/* ===========================================================================
   ADMIN PANELS — Feed + Surveys, inside the Users view.
   The Users view is a LIGHT surface (white cards, #2c2350 ink), not the dark
   app chrome. Written to match .admin-fold above it, so both panels read as
   part of the same page instead of pale text on white.
   =========================================================================== */
:root {
  --ad-ink:    #2c2350;
  --ad-mute:   #8a83a8;
  --ad-line:   rgba(20, 14, 45, .12);
  --ad-card:   #fff;
  --ad-accent: #8b6cff;
  --ad-soft:   rgba(139, 108, 255, .08);
}

.feedadmin-panel, .surveyadmin-panel { max-width: 860px; color: var(--ad-ink); }
.feedadmin-panel[hidden], .surveyadmin-panel[hidden] { display: none; }

/* ------------------------------------------------------------ shared bits */
.fa-sec-title, .sv-sec {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 20px 0 12px; font-size: 14px; font-weight: 800; color: var(--ad-ink);
}
.fa-sec-note { font-size: 12px; font-weight: 500; color: var(--ad-mute); }
.sv-none, .fa-vload, .fa-empty { padding: 16px 0; color: var(--ad-mute); font-size: 13px; }

.fa-btn, .sv-btn {
  padding: 8px 15px; border-radius: 100px; cursor: pointer;
  background: var(--ad-card); border: 1px solid var(--ad-line);
  color: #4b4370; font: inherit; font-size: 12.5px; font-weight: 700;
}
.fa-btn:hover, .sv-btn:hover { background: var(--ad-soft); border-color: var(--ad-accent); color: var(--ad-ink); }
.fa-btn:disabled, .sv-btn:disabled { opacity: .5; cursor: default; }
.sv-go { background: var(--ad-accent); border-color: transparent; color: #fff; }
.sv-go:hover { background: #7a58f5; border-color: transparent; color: #fff; }
.fa-danger, .sv-danger { color: #cf2b55; border-color: rgba(207, 43, 85, .28); }
.fa-danger:hover, .sv-danger:hover { background: rgba(207, 43, 85, .08); border-color: #cf2b55; color: #a81f43; }
.sv-ghost { width: 100%; margin-top: 10px; border-style: dashed; }
.sv-sm { margin-left: auto; padding: 7px 14px; }
.sv-wide { width: 100%; padding: 13px; font-size: 15px; }

/* ===================================================== FEED: the five chips */
.fa-mainrow { display: flex; flex-wrap: wrap; gap: 8px; }
.fa-main {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px 7px 7px; border-radius: 100px; cursor: pointer;
  background: var(--ad-card); border: 1.5px solid var(--ad-line);
  color: #4b4370; font: inherit; font-size: 13px; font-weight: 600;
  transition: border-color .15s, background .15s, color .15s;
}
.fa-main:hover { border-color: var(--ad-accent); color: var(--ad-ink); }
.fa-main img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.fa-main i { font-style: normal; font-size: 11px; color: var(--ad-mute); }
.fa-main.is-on { background: var(--ad-soft); border-color: var(--ad-accent); color: #5b34d6; }
.fa-main.is-on i { color: #7f5ce8; }
.fa-main:disabled { opacity: .55; cursor: default; }
.fa-mainerr, .sv-err, .sv-uerr {
  margin-top: 10px; padding: 9px 12px; border-radius: 10px;
  background: rgba(207, 43, 85, .09); color: #a81f43;
  font-size: 12.5px; font-weight: 600;
}
.fa-mainerr[hidden], .sv-err[hidden], .sv-uerr[hidden] { display: none; }

/* ---------------------------------------------------------- FEED: posts */
.fa-post {
  display: flex; gap: 13px; padding: 14px 0; border-top: 1px solid var(--ad-line);
}
.fa-thumb {
  flex: 0 0 74px; width: 74px; height: 74px; border-radius: 12px; overflow: hidden;
  background: #f1eef8; display: grid; place-items: center;
  color: #a49cc4; font-size: 15px; font-weight: 700;
}
.fa-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fa-body { min-width: 0; flex: 1; }
.fa-cap { font-size: 13.5px; line-height: 1.4; color: var(--ad-ink); font-weight: 500; overflow-wrap: anywhere; }
.fa-cap i { color: var(--ad-mute); }
.fa-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: 7px; font-size: 11.5px; color: var(--ad-mute);
}
.fa-av { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.fa-av-f {
  display: grid; place-items: center; font-size: 9.5px; font-weight: 700;
  background: #e7dcfb; color: #5b34d6;
}
.fa-who b { font-weight: 600; color: #a49cc4; }
.fa-dot { color: #c7c1da; }
.fa-tag {
  margin-left: auto; padding: 3px 9px; border-radius: 100px;
  background: var(--ad-soft); color: #5b34d6; font-size: 11px; font-weight: 700;
}
.fa-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 9px; font-size: 12px; color: var(--ad-mute); }
.fa-stats b { color: var(--ad-ink); font-weight: 800; }
.fa-acts { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }

.fa-viewers:empty { display: none; }
.fa-viewers {
  margin-top: 11px; padding: 10px 12px; border-radius: 12px;
  background: #faf8ff; border: 1px solid var(--ad-line);
}
.fa-vhead {
  font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ad-accent); margin-bottom: 8px;
}
.fa-viewer {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 6px 0; font-size: 12.5px; color: #4b4370;
}
.fa-vwhen { margin-left: auto; font-size: 11px; color: var(--ad-mute); }

/* ================================================== SURVEYS: admin builder */
.sv-in {
  width: 100%; margin-bottom: 10px; padding: 10px 13px; border-radius: 10px;
  background: var(--ad-card); border: 1px solid var(--ad-line);
  color: var(--ad-ink); font: inherit; font-size: 13.5px; line-height: 1.45;
  resize: vertical; font-family: inherit;
}
.sv-in::placeholder { color: #a9a2c2; }
.sv-in:focus { outline: 2px solid rgba(139, 108, 255, .4); border-color: transparent; }
.sv-num { max-width: 140px; }
.sv-lab {
  display: block; font-size: 11px; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ad-mute); margin: 14px 0 7px;
}
.sv-hint { margin: -4px 0 6px; font-size: 11.5px; color: var(--ad-mute); line-height: 1.45; }

.sv-build {
  padding: 16px; border-radius: 14px; margin-bottom: 18px;
  background: #faf8ff; border: 1px solid rgba(139, 108, 255, .3);
}
.sv-build-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 800; color: var(--ad-ink); margin-bottom: 6px;
}
.sv-build-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.sv-build-foot .sv-err { flex: 1; margin-top: 0; }
.sv-x {
  width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; flex: 0 0 auto;
  background: rgba(20, 14, 45, .07); color: #4b4370;
}
.sv-x:hover { background: rgba(20, 14, 45, .14); color: var(--ad-ink); }
.sv-x svg { width: 14px; height: 14px; }

.sv-q {
  padding: 12px; border-radius: 11px; margin-bottom: 10px;
  background: var(--ad-card); border: 1px solid var(--ad-line);
}
.sv-q-top { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.sv-q-n {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--ad-accent); color: #fff;
  font-size: 11px; font-weight: 800;
}
.sv-sel {
  flex: 1; padding: 7px 11px; border-radius: 8px; cursor: pointer;
  background: var(--ad-card); border: 1px solid var(--ad-line);
  color: var(--ad-ink); font: inherit; font-size: 12.5px;
}
.sv-q .sv-in { margin-bottom: 8px; }
.sv-chk { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: #4b4370; }
.sv-chk input { width: 15px; height: 15px; accent-color: var(--ad-accent); cursor: pointer; }

/* -------------------------------------------------- SURVEYS: the campaign */
.sv-camp {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 0; border-top: 1px solid var(--ad-line);
}
.sv-camp-main { flex: 1; min-width: 220px; }
.sv-camp-title { font-size: 13.5px; font-weight: 800; color: var(--ad-ink); }
.sv-camp-sub { margin-top: 4px; font-size: 11.5px; color: var(--ad-mute); }
.sv-pill {
  display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 100px;
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  background: rgba(20, 14, 45, .07); color: var(--ad-mute);
}
.sv-pill.on, .sv-pill.approved { background: rgba(22, 163, 74, .12); color: #15803d; }
.sv-pill.pending { background: rgba(202, 138, 4, .14); color: #a16207; }
.sv-pill.rejected { background: rgba(207, 43, 85, .12); color: #a81f43; }

/* ------------------------------------------------ SURVEYS: the submissions */
.sv-tabs { display: flex; gap: 5px; margin-left: auto; flex-wrap: wrap; }
.sv-tab {
  padding: 6px 13px; border-radius: 100px; cursor: pointer;
  background: var(--ad-card); border: 1px solid var(--ad-line);
  color: #6b6390; font: inherit; font-size: 12px; font-weight: 700;
}
.sv-tab:hover { border-color: var(--ad-accent); color: var(--ad-ink); }
.sv-tab.on { background: var(--ad-accent); border-color: transparent; color: #fff; }

.sv-sub { padding: 14px 0; border-top: 1px solid var(--ad-line); }
.sv-sub-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.sv-who { font-size: 13.5px; font-weight: 800; color: var(--ad-ink); }
.sv-who b { font-weight: 600; color: #a49cc4; }
.sv-when { font-size: 11.5px; color: var(--ad-mute); }
.sv-sub-camp { margin-top: 3px; font-size: 11.5px; color: var(--ad-mute); }
.sv-qa { margin: 11px 0 0; }
.sv-qa-row { padding: 8px 0; border-bottom: 1px solid var(--ad-line); }
.sv-qa-q { font-size: 12px; font-weight: 700; color: var(--ad-mute); }
.sv-qa-a { margin-top: 4px; font-size: 13.5px; color: var(--ad-ink); line-height: 1.45; overflow-wrap: anywhere; }
.sv-ans-t { white-space: pre-wrap; }
.sv-blank { color: #a9a2c2; font-size: 12.5px; }
.sv-chip {
  display: inline-block; margin: 2px 5px 2px 0; padding: 3px 10px; border-radius: 100px;
  background: var(--ad-soft); color: #5b34d6; font-size: 12px; font-weight: 700;
}
.sv-review { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.sv-note { flex: 1; min-width: 200px; margin-bottom: 0; }
.sv-verdict { margin-top: 10px; font-size: 12.5px; color: var(--ad-mute); }

/* ===========================================================================
   SURVEYS — the user-facing modal. This one really is on the app's own
   surface, and when a survey is owed it cannot be dismissed.
   =========================================================================== */
.sv-modal {
  position: fixed; inset: 0; z-index: 1600; display: none;
  background: rgba(14, 10, 22, .72);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 20px; overflow-y: auto;
}
.sv-modal.is-on { display: grid; place-items: center; }
.sv-card {
  width: min(520px, 100%); max-height: 88vh; overflow-y: auto;
  padding: 22px; border-radius: 20px;
  background: #f4efe9; color: #221d2e;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
}
.sv-card-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
  font-size: 19px; font-weight: 800;
}
.sv-card-head .sv-x { background: rgba(34, 29, 46, .08); color: #221d2e; }
.sv-card-head .sv-x:hover { background: rgba(34, 29, 46, .16); }
.sv-card-head b { flex: 1; }
.sv-reward {
  padding: 5px 12px; border-radius: 100px; background: #e7dcfb;
  color: #6d3ee0; font-size: 12.5px; font-weight: 800; white-space: nowrap;
}
.sv-intro {
  margin: 0 0 18px; padding: 12px 14px; border-radius: 12px;
  background: #fdf6e6; border: 1px solid #efdcb0;
  font-size: 13.5px; line-height: 1.5; color: #6b5a2e; font-weight: 600;
}
.sv-uq { margin-bottom: 18px; }
.sv-uq-p { font-size: 14.5px; font-weight: 700; margin-bottom: 9px; line-height: 1.35; }
.sv-uq-p em {
  font-style: normal; font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: #b4456b; margin-left: 6px;
}
.sv-card .sv-in { background: #fff; border: 1px solid rgba(34, 29, 46, .12); color: #221d2e; }
.sv-uopts { display: flex; flex-direction: column; gap: 7px; }
.sv-uopt {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 11px 14px; border-radius: 12px;
  background: #fff; border: 1.5px solid rgba(34, 29, 46, .1); font-size: 14px;
}
.sv-uopt:has(input:checked) { border-color: #8b5cf6; background: #f3ecfe; }
.sv-uopt input { width: 17px; height: 17px; accent-color: #8b5cf6; cursor: pointer; }
.sv-card .sv-btn { border-color: rgba(34, 29, 46, .14); color: #4b4370; background: #fff; }
.sv-card .sv-go { background: #8b5cf6; border-color: transparent; color: #fff; }
.sv-fine { margin: 10px 0 0; text-align: center; font-size: 11.5px; color: #8b8399; }
.sv-pick {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 14px 16px; margin-bottom: 9px; border-radius: 14px;
  background: #fff; border: 1.5px solid rgba(34, 29, 46, .1); font: inherit;
}
.sv-pick:hover { border-color: #8b5cf6; }
.sv-pick-t { display: block; font-size: 15px; font-weight: 700; color: #221d2e; }
.sv-pick-s { display: block; margin-top: 3px; font-size: 12.5px; color: #8b8399; }

/* A survey that must be answered has no way out: no X, no backdrop click, no
   Escape (all three are handled in surveys.js). The lock class also stops the
   page behind it scrolling, so there's nothing to fiddle with while it's up. */
body.sv-locked { overflow: hidden !important; }
.sv-modal.is-locked { background: rgba(14, 10, 22, .88); }
.sv-modal.is-locked .sv-card { box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .8); }

/* ------------------------------------------------------------- the verdict */
.sv-verdict-card { text-align: center; padding: 28px 24px; }
.sv-vmark {
  width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center; font-size: 27px; font-weight: 700; color: #fff;
}
.sv-vmark.good { background: linear-gradient(140deg, #22c55e, #4ade80); }
.sv-vmark.bad { background: linear-gradient(140deg, #f43f5e, #fb7185); }
.sv-vmark.sent { background: linear-gradient(140deg, #8b5cf6, #c084fc); }
.sv-vtitle { display: block; font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.sv-vtext { margin: 0 0 20px; font-size: 14px; line-height: 1.55; color: #5d5670; }
.sv-vnote {
  display: inline-block; margin-top: 8px; padding: 8px 13px; border-radius: 10px;
  background: #fdecef; color: #b32844; font-size: 13px; font-weight: 600;
}

/* ------------------------------------------- SURVEYS 2.13.4: list + detail */
/* Every survey is called the same thing now, so the list is read by shape —
   size, worth, age, and how much is waiting — not by name. */
.sv-camp-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 4px; cursor: pointer; background: none; border: 0;
  border-top: 1px solid var(--ad-line); font: inherit;
}
.sv-camp-btn:hover { background: var(--ad-soft); }
.sv-camp-n {
  flex: 0 0 auto; min-width: 30px; font-size: 12px; font-weight: 800;
  color: #a49cc4;
}
.sv-camp-btn .sv-camp-main { display: block; flex: 1; min-width: 0; }
.sv-camp-btn .sv-camp-title { display: block; }
.sv-camp-btn .sv-camp-sub { display: block; }
.sv-chev { flex: 0 0 auto; font-size: 22px; color: #b9b2cc; line-height: 1; }
.sv-badge {
  flex: 0 0 auto; padding: 4px 11px; border-radius: 100px;
  background: rgba(202, 138, 4, .16); color: #92600a;
  font-size: 11.5px; font-weight: 800; white-space: nowrap;
}
.sv-pill.cta { background: var(--ad-soft); color: #5b34d6; }
.sv-pill.paused { background: rgba(100, 116, 139, .16); color: #475569; }
.sv-pill.closed { background: rgba(20, 14, 45, .09); color: #6b6390; }

.sv-back {
  display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 14px;
  padding: 7px 14px; border-radius: 100px; cursor: pointer;
  background: var(--ad-card); border: 1px solid var(--ad-line);
  color: #4b4370; font: inherit; font-size: 12.5px; font-weight: 700;
}
.sv-back:hover { border-color: var(--ad-accent); color: var(--ad-ink); }

.sv-detail-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--ad-line);
}
.sv-dh-title { font-size: 15px; font-weight: 800; color: var(--ad-ink); }
.sv-dh-sub { margin-top: 4px; font-size: 11.5px; color: var(--ad-mute); }
.sv-dh-acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* Three states, shown as what they are rather than a mystery toggle. */
.sv-states {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px 0; border-bottom: 1px solid var(--ad-line);
}
.sv-state {
  padding: 7px 15px; border-radius: 100px; cursor: pointer;
  background: var(--ad-card); border: 1.5px solid var(--ad-line);
  color: #6b6390; font: inherit; font-size: 12.5px; font-weight: 700;
}
.sv-state:hover { border-color: var(--ad-accent); color: var(--ad-ink); }
.sv-state.on { background: var(--ad-accent); border-color: transparent; color: #fff; }
.sv-state-note { flex: 1; min-width: 180px; font-size: 11.5px; color: var(--ad-mute); }

.sv-ctabox { padding: 6px 0 16px; border-bottom: 1px solid var(--ad-line); }
.sv-cta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sv-cta-row .sv-in { flex: 1; min-width: 190px; }
.sv-ctabox .sv-err { display: inline-block; margin-left: 10px; }

.sv-questions { padding: 14px 0; border-bottom: 1px solid var(--ad-line); }
.sv-qline { font-size: 13px; color: var(--ad-ink); padding: 4px 0; line-height: 1.45; }
.sv-qline em {
  font-style: normal; margin-left: 8px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--ad-mute);
}

/* The CTA button on the user's finish card, and the quieter dismiss under it. */
.sv-card .sv-ctabtn {
  display: block; text-align: center; text-decoration: none; margin-bottom: 9px;
}
.sv-card .sv-quiet { background: transparent; border-color: transparent; color: #6b6390; }
.sv-card .sv-quiet:hover { background: rgba(34, 29, 46, .06); color: #221d2e; }

/* ------------------------------------- SURVEYS 2.13.5: audience + archive */
.sv-aud { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sv-aud-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
.sv-aud-row .sv-sel { flex: 1; min-width: 200px; }
.sv-minmsg {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 12.5px; color: #4b4370; font-weight: 600;
}
.sv-minmsg .sv-in { margin-bottom: 0; max-width: 92px; }
.sv-pill.aud { background: rgba(16, 132, 122, .12); color: #0f6f68; }

.sv-arch {
  margin-left: auto; padding: 4px 11px; border-radius: 100px; cursor: pointer;
  background: transparent; border: 1px solid var(--ad-line);
  color: #6b6390; font: inherit; font-size: 11.5px; font-weight: 700;
}
.sv-arch:hover { border-color: var(--ad-accent); color: var(--ad-ink); background: var(--ad-soft); }

/* An archived row is still readable, just visibly out of the running. */
.sv-sub.is-archived { opacity: .62; }
.sv-sub.is-archived .sv-qa { display: none; }
.sv-sub.is-archived:hover { opacity: 1; }
.sv-sub.is-archived:hover .sv-qa { display: block; }
.sv-pill.archived { background: rgba(20, 14, 45, .09); color: #6b6390; }
