/* css/pops.css */
/* pops.css: the pop page (pop.html) and its owner's page (pop-manage.html),
   which share one layout so the owner sees what visitors see. Loaded by
   those two pages only (their "head" block). */

/* The back area: arrow, where it goes, and the title are one big link. */
.back-bar { gap: var(--sp-1); }
.back-link {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--sp-2);
  min-height: 48px; margin-left: -4px; padding: 4px 12px 4px 4px; border-radius: var(--r-pill);
  color: var(--text); text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.back-link:hover { background: var(--surface-2); }
.back-link:active { transform: scale(.985); }
.back-link:focus-visible { box-shadow: var(--focus); }
.back-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; }
.back-text { display: grid; min-width: 0; line-height: 1.15; }
.back-to { font-size: var(--fs-xs); font-weight: var(--fw-semi); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-link .title { flex: none; font-size: var(--fs-md); }

/* The owner's strip on top of the visitor's layout. */
.owner-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-3);
  margin: 0 12px var(--sp-3); padding: 10px 12px 10px 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); font-size: var(--fs-sm);
}
.owner-bar.has-draft {
  border-color: transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--pop-grad) border-box;
  border: 1.5px solid transparent;
}
.owner-bar-text { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.owner-bar .sub { color: var(--muted); }
.owner-bar .cluster { gap: var(--sp-2); }
@media (min-width: 640px) { .owner-bar { margin-left: 0; margin-right: 0; } }

/* Manage: the stage can play the live version or the waiting draft. */
.manage-main .pop-info { padding-bottom: var(--sp-4); }
.stage-switch { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 var(--sp-2); border-radius: var(--r-pill); background: var(--surface-2); }
.stage-tab {
  height: 34px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: transparent;
  color: var(--muted); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semi); cursor: pointer;
}
.stage-tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.stage-which {
  position: absolute; left: 12px; top: 12px; z-index: 1; padding: 5px 10px; border-radius: var(--r-pill);
  background: rgba(15,11,29,.72); color: #fff; font-size: 12px; font-weight: var(--fw-semi);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.stage-empty { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.7); }
.stage-note .btn { flex: none; }
@media (max-width: 639px) { .stage-note .stage-open { display: none; } }

.manage-review-actions { padding: 0 var(--sp-4) var(--sp-4); gap: var(--sp-2); }
.manage-main > .card { margin-top: var(--sp-4); }
.page-manage .manage-main { padding-bottom: var(--sp-6); }

/* Settings → Pops: drafts waiting for review, first. */
.card.drafts-waiting, .card.manage-review { border: 1.5px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--pop-grad) border-box; }
.waiting-row { align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.waiting-shot { width: 88px; aspect-ratio: 4 / 3; flex: none; border-radius: var(--r-sm); overflow: hidden; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.waiting-shot img { width: 100%; height: 100%; object-fit: cover; }
.waiting-text { min-width: 0; flex: 1 1 14rem; display: grid; gap: 4px; color: var(--text); text-decoration: none; }
.waiting-text .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.waiting-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block !important; }
.waiting-actions { flex: none; gap: var(--sp-2); }
@media (max-width: 480px) { .waiting-actions { width: 100%; justify-content: flex-end; } }

/* css/convo.css */
/* convo.css: threads, @mentions, link previews and group DMs (round 013).
   Loaded by club.html, dm.html and group-new.html. */

/* ---------- a thread under its first message ---------- */
.msg-thread {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; padding: 4px 12px 4px 4px; max-width: 100%;
  border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border);
  font-size: var(--fs-xs); color: var(--text); text-decoration: none; width: max-content;
}
.msg-thread:hover { background: var(--surface-3); border-color: var(--border-strong); }
.msg-thread b { color: var(--accent-text, var(--primary)); white-space: nowrap; }
.msg-thread .faint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-thread.has-unread { border-color: transparent; background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--pop-grad) border-box; }
.msg-thread.has-unread .faint { color: var(--coral); font-weight: var(--fw-bold); }
.msg-thread-avs { display: inline-flex; }
.msg-thread-avs .av { box-shadow: 0 0 0 2px var(--surface-2); }
.msg-thread-avs .av + .av { margin-left: -8px; }
.msg.mine .msg-thread { align-self: flex-end; }
.msg-in-thread { grid-template-columns: auto minmax(0, 1fr); text-decoration: none; border-left-color: var(--coral); }

/* the Threads button in the club's head */
.thread-btn { position: relative; }
.thread-btn .badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; font-size: 10px; box-shadow: 0 0 0 2px rgba(0,0,0,.25); }

/* ---------- the thread pane: a full sheet on a phone, a column on a desktop ---------- */
.thread-pane[hidden] { display: none !important; }
.thread-pane {
  display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 85;
  background: var(--bg); padding-bottom: env(safe-area-inset-bottom);
  animation: thread-in var(--dur-3, .24s) var(--ease-out, ease-out);
}
@keyframes thread-in { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.thread-head {
  flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 10px; min-height: 60px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(120% 140% at 0% 0%, rgba(122,59,255,.28), transparent 60%), radial-gradient(120% 160% at 100% 0%, rgba(255,77,141,.22), transparent 55%), var(--surface);
}
.thread-head-text { min-width: 0; display: grid; line-height: 1.2; }
.thread-head-text b { font-size: var(--fs-lg); }
.thread-head-text .faint { font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-area { flex: 1; min-height: 0; }
.thread-area[hidden] { display: none; }
.thread-list { padding: var(--sp-3) var(--sp-3) var(--sp-4) var(--sp-1); }
.thread-list > .msg.is-root .msg-main { padding-bottom: 2px; }
.thread-sep {
  display: flex; align-items: center; gap: 10px; margin: 6px var(--gutter) 10px; color: var(--muted);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .06em;
}
.thread-sep::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }
.thread-composer[hidden] { display: none; }
.thread-also { display: flex; align-items: center; gap: 8px; padding: 0 var(--gutter) 10px; font-size: var(--fs-sm); color: var(--muted); background: var(--surface); cursor: pointer; }
.thread-also input { width: 18px; height: 18px; accent-color: var(--grape); }
.thread-index { flex: 1; overflow-y: auto; padding: var(--sp-3) var(--sp-2) var(--sp-5); }
.thread-index[hidden] { display: none; }
.thread-none { padding: var(--sp-5) var(--gutter); text-align: center; max-width: 44ch; margin: 0 auto; }
.thread-row { align-items: flex-start; border-radius: var(--r-md); padding: 10px; }
.thread-row:hover { background: var(--surface-2); }
.thread-row .grow { min-width: 0; }
.thread-row-body { color: var(--text) !important; display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.thread-row.has-unread .title { font-weight: var(--fw-bold); }
.thread-row .badge { align-self: center; }
/* Room for both: with a thread open, the Chats pane steps aside until the screen is wide. */
@media (min-width: 1000px) and (max-width: 1599px) {
  body.app.has-chatpane.thread-open { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  body.has-chatpane.thread-open .chatpane { display: none; }
}
@media (min-width: 1000px) {
  body.thread-open.page-club .shell { grid-template-columns: minmax(0, 1fr) min(440px, 38vw) !important; }
  body.thread-open.page-club .club-aside { display: none !important; }
  .thread-pane {
    position: sticky; top: 0; inset: auto; height: 100dvh; z-index: 1; animation: none;
    border-left: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 40%, var(--bg));
  }
  .thread-head { min-height: 64px; padding: 10px 14px; }
}

/* ---------- @mention completion ---------- */
.mention-pop {
  position: fixed; z-index: 120; list-style: none; margin: 0; padding: 6px; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-3);
  display: grid; gap: 2px;
}
.mention-pop li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: var(--fs-sm); min-width: 0; }
.mention-pop li .grow { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mention-pop li[aria-selected="true"] { background: var(--surface-3); }
.mention-pop li[aria-selected="true"] b { color: var(--accent-text, var(--primary)); }
.mention-all { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--pop-grad); color: #fff; font-weight: var(--fw-bold); font-size: 13px; flex: none; }

/* ---------- link previews ---------- */
.link-preview { position: relative; max-width: min(420px, 100%); margin-top: 4px; }
.link-preview > a {
  display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; text-decoration: none; color: var(--text);
  border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border);
  box-shadow: inset 3px 0 0 var(--grape);
}
.link-preview > a:hover { border-color: var(--border-strong); }
.lp-img { display: block; background: var(--surface-3); aspect-ratio: 1.91 / 1; overflow: hidden; }
.lp-img img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center; display: block; }
/* a small or square picture: a thumbnail beside the text (unfurl.go Side) */
.link-preview.lp-side > a { grid-template-columns: 96px minmax(0, 1fr); }
.link-preview.lp-side .lp-img { aspect-ratio: auto; min-height: 96px; height: 100%; }
@media (max-width: 420px) { .link-preview.lp-side > a { grid-template-columns: 80px minmax(0, 1fr); } .link-preview.lp-side .lp-img { min-height: 80px; } }
.lp-text { display: grid; gap: 2px; padding: 9px 12px 10px 14px; min-width: 0; }
.lp-site { font-size: 11px; font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-title { font-size: var(--fs-sm); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lp-desc { font-size: var(--fs-xs); color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lp-x {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(20,12,36,.72); color: #fff; opacity: 0; transition: opacity .15s;
}
.link-preview:hover .lp-x, .lp-x:focus-visible { opacity: 1; }
@media (hover: none) { .lp-x { opacity: .9; } }
.msg.mine .link-preview { margin-left: auto; }

/* the composer's preview, before sending (preview.js take/attach) */
.composer-preview {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px var(--sp-2) 8px var(--gutter);
  background: var(--surface); border-top: 1px solid var(--border); min-width: 0;
  animation: cp-in .18s ease-out;
}
.composer-preview img { flex: none; width: 56px; height: 56px; border-radius: var(--r-sm, 8px); object-fit: cover; background: var(--surface-3); }
.composer-preview::before { content: ""; flex: none; align-self: stretch; width: 3px; border-radius: 3px; background: var(--pop-grad, var(--grape)); }
.cp-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.cp-site { font-size: 11px; font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-title { font-size: var(--fs-sm); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-desc { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-x { flex: none; }
@keyframes cp-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .composer-preview { animation: none; } }

/* ---------- photos and files in DMs ---------- */
.msg-group .bubble.bubble-img { padding: 0; background: none; border: 0; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-1, 0 1px 2px rgba(0,0,0,.12)); }
.msg-group .bubble.bubble-img img { display: block; max-width: min(320px, 70vw); height: auto; }
.bubble-file { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; max-width: 100%; }
.bubble-file .ic { flex: none; }
.bubble-file span { min-width: 0; display: grid; line-height: 1.25; }
.bubble-file b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bubble-file small { opacity: .75; }

/* ---------- group DMs ---------- */
.vis-pill[data-vis="group"] { background: rgba(255,255,255,.18); }
.group-new .group-name, .group-new-for { padding: 0 var(--gutter); }
.group-new .group-name { margin: var(--sp-2) 0 var(--sp-3); }
.group-picked { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 var(--gutter) var(--sp-3); min-height: 40px; align-items: center; }
.group-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px 0 4px; border-radius: var(--r-pill);
  background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--pop-grad) border-box; border: 1.5px solid transparent;
  color: var(--text); text-decoration: none; font-size: var(--fs-sm); font-weight: var(--fw-semi);
}
.group-chip .ic { opacity: .7; }
.group-chip:hover .ic { opacity: 1; }
.group-none { font-size: var(--fs-sm); }
.group-error { padding: 0 var(--gutter); }
.group-go[disabled] { opacity: .5; }

/* ---------- adding people to a club (club-add.html) ---------- */
.club-add .form-error, .club-add-done { margin: 0 var(--gutter) var(--sp-2); }
.club-add-done { display: flex; gap: 6px; align-items: center; color: var(--ok, var(--primary)); font-weight: var(--fw-semi); }
.club-add-row { display: flex; align-items: center; gap: 12px; margin: 0; }
.club-add-row .grow { min-width: 0; display: grid; }
.club-add-row .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.club-add-phone { padding: 0 var(--gutter); background: none; border: 0; box-shadow: none; }
.club-add-phone .section-title { display: flex; align-items: center; gap: 6px; }
.club-add-phone-form { padding: var(--sp-3); }
.club-add-phone-form .cluster { flex-wrap: nowrap; }
.club-add-phone-form .input { min-width: 0; }
/* Add people: someone already invited (clubadd.go) */
.club-add-row .is-invited { pointer-events: none; color: var(--success, var(--muted)); background: transparent; box-shadow: inset 0 0 0 1px var(--border); }

