/* Community: built only from the theme's variables (--me, --paper, --raised, --ink,
   --rule, --r…), so every theme, colour, light/dark mode and look applies as is. */

.community .c-feed { display: grid; gap: 14px; }
.c-feedtools { gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.c-handle { color: var(--ink-soft); font-size: .85em; }
.c-lock { font-size: .8em; }
.c-pill { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 99px; background: var(--paper-2); color: var(--ink-soft); font-size: .75rem; font-weight: 700; }
.c-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; margin: 8px 0; }
.c-tag { color: var(--me-strong, var(--me)); font-weight: 700; text-decoration: none; }
.c-link { color: var(--me-strong, var(--me)); text-decoration: underline; overflow-wrap: anywhere; }
.c-tabbadge { position: absolute; top: 2px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--you); color: #fff; font-size: .68rem; font-weight: 800; display: grid; place-items: center; line-height: 1; }
.k-tab { position: relative; }

/* avatars */
.avatar.c-av { overflow: hidden; }
.avatar.c-av.xs { width: 26px; height: 26px; font-size: .75rem; box-shadow: none; }
.avatar.c-av.lg { width: 76px; height: 76px; font-size: 1.9rem; }

/* compose */
.c-compose-cta { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; margin: 0 0 14px; border-radius: var(--r-ctl, 18px);
  border: 1px solid var(--rule); background: var(--raised); color: var(--ink-soft); font: inherit; text-align: left; cursor: pointer; }
.c-compose-cta > span:not(.avatar) { flex: 1; }
.c-compose-cta .avatar { flex: none; }
.c-compose-cta .avatar { width: 34px; height: 34px; font-size: .9rem; }
.c-compose-who { display: flex; align-items: center; gap: 10px; }
.c-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.c-thumbs:empty { display: none; }
.c-thumb { position: relative; width: 74px; height: 74px; border-radius: 12px; overflow: hidden; background: var(--paper-2); }
.c-thumb img, .c-thumb video { width: 100%; height: 100%; object-fit: cover; }
.c-thumb button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgb(0 0 0 / .55); color: #fff; font-size: .7rem; cursor: pointer; }

/* posts */
.c-post { background: var(--raised); border: 1px solid var(--rule); border-radius: var(--r, 20px); padding: 14px 14px 8px; }
.c-post-head { display: flex; align-items: center; gap: 8px; }
.c-who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; color: inherit; text-decoration: none; }
.c-who.small { gap: 6px; font-size: .9rem; }
.c-who-t { display: flex; flex-direction: column; min-width: 0; }
.c-who-t b, .c-who-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-vis { font-size: .85rem; opacity: .7; }
.c-more { width: 34px; height: 34px; box-shadow: none; background: transparent; }
.c-media { margin: 8px 0; border-radius: 14px; overflow: hidden; display: grid; gap: 3px; background: var(--paper-2); }
.c-media.many { grid-template-columns: 1fr 1fr; }
.c-media img, .c-media video { width: 100%; display: block; max-height: 520px; object-fit: cover; background: #000; }
.c-media.many img, .c-media.many video { aspect-ratio: 1; height: 100%; }
.c-shot { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; }
.c-repost { margin: 8px 0; border: 1px solid var(--rule); border-radius: 14px; padding: 10px 12px; background: var(--paper); }
.c-inner .c-text { margin: 6px 0 4px; }
.c-acts { display: flex; align-items: center; gap: 2px; margin-top: 4px; border-top: 1px dashed color-mix(in srgb, var(--rule) 80%, transparent); padding-top: 4px; flex-wrap: wrap; }
.c-act { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 4px 10px; border: 0; border-radius: 12px; background: none; color: var(--ink-soft); font: inherit; font-weight: 700; cursor: pointer; }
.c-act:hover { background: var(--paper-2); }
.c-act.on { color: var(--you); }
.c-act.c-likers { margin-left: auto; font-size: .8rem; font-weight: 600; }

/* comments */
.c-comments { display: grid; gap: 10px; }
.c-thread { display: grid; gap: 6px; }
.c-comment { display: flex; gap: 8px; align-items: flex-start; }
.c-comment.reply { margin-left: 34px; }
.c-bubble { background: var(--paper-2); border-radius: 14px; padding: 6px 10px; }
.c-cname { display: block; font-weight: 800; font-size: .85rem; color: inherit; text-decoration: none; }
.c-ctext { white-space: pre-wrap; overflow-wrap: anywhere; }
.c-cacts { display: flex; gap: 12px; align-items: center; padding: 2px 6px; font-size: .78rem; }
.c-cacts .linkish.on { color: var(--you); font-weight: 800; }
.c-cbox { margin-top: 12px; display: grid; gap: 4px; }
.c-cbox .row { align-items: flex-end; gap: 8px; }
.c-cbox textarea { flex: 1; min-height: 44px; resize: vertical; }

/* stories */
.c-stories { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; }
.c-stories::-webkit-scrollbar { display: none; }
.c-story { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 68px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.c-story small { max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; }
.c-ring { position: relative; padding: 3px; border-radius: 50%; background: var(--rule); }
.c-story.new .c-ring { background: conic-gradient(var(--me), var(--you), var(--me)); }
.c-ring .avatar { width: 56px; height: 56px; border: 3px solid var(--paper); box-shadow: none; }
.c-plus { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%; background: var(--me); color: var(--on-me, #fff); border: 2px solid var(--paper); display: grid; place-items: center; font-weight: 800; }
.c-story-preview { border-radius: 14px; overflow: hidden; background: #000; max-height: 50vh; display: grid; place-items: center; }
.c-story-preview img, .c-story-preview video { max-width: 100%; max-height: 50vh; }
.c-sview { position: fixed; inset: 0; z-index: 95; background: #000; color: #fff; display: flex; flex-direction: column; animation: fade .2s; }
.c-sbars { display: flex; gap: 4px; padding: calc(env(safe-area-inset-top) + 10px) 10px 0; }
.c-sbars i { flex: 1; height: 3px; border-radius: 2px; background: rgb(255 255 255 / .35); overflow: hidden; }
.c-sbars b { display: block; height: 100%; background: #fff; width: 0; }
.c-shead { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.c-shead .c-who { color: #fff; }
.c-sx { margin-left: auto; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgb(255 255 255 / .15); color: #fff; font-size: 1rem; cursor: pointer; }
.c-sstage { flex: 1; min-height: 0; display: grid; place-items: center; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.c-sstage img, .c-sstage video { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.c-scap { text-align: center; padding: 8px 16px; white-space: pre-wrap; text-shadow: 0 1px 3px rgb(0 0 0 / .6); }
.c-scap:empty { display: none; }
.c-sfoot { padding: 10px 12px calc(env(safe-area-inset-bottom) + 12px); }
.c-sfoot .row { gap: 8px; }
.c-sfoot input { flex: 1; background: rgb(255 255 255 / .12); color: #fff; border-color: rgb(255 255 255 / .3); }
.c-sfoot .btn.ghost { color: #fff; }

/* profiles */
.c-profile .c-phead { display: flex; gap: 14px; align-items: center; }
.c-profile h2 { margin: 0; font-size: 1.25rem; overflow-wrap: anywhere; }
.c-bio { white-space: pre-wrap; margin: 10px 0; }
.c-pacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.c-editav .avatar { pointer-events: none; }
.c-points { margin: 8px 0 14px 18px; display: grid; gap: 6px; }
.c-agree { align-items: flex-start; gap: 10px; margin: 10px 0 14px; }
.c-agree input { margin-top: 3px; flex: none; }

/* lists */
.c-new { background: var(--me-tint); border-radius: 12px; }
.c-nthumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.c-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--you); color: #fff; font-size: .72rem; font-weight: 800; display: inline-grid; place-items: center; }
.c-unread-t { font-weight: 800; color: var(--ink); }
.c-chat-tools { gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.c-requests { border-color: var(--me); }
.c-picks { display: grid; gap: 4px; max-height: 50vh; overflow-y: auto; }
.c-pick { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; cursor: pointer; }
.c-pick:hover { background: var(--paper-2); }
.c-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.c-snap { background: var(--paper-2); border-radius: 12px; padding: 10px; margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.c-snap img { max-width: 140px; max-height: 140px; border-radius: 8px; margin: 6px 6px 0 0; }
.c-join .c-points li::marker { color: var(--me); }

/* a conversation */
.c-chatpage .k-panel { padding-bottom: 0; }
.c-chat { display: flex; flex-direction: column; height: calc(100dvh - var(--nav-h, 76px) - 180px); min-height: 360px; background: var(--raised); border: 1px solid var(--rule); border-radius: var(--r, 20px); overflow: hidden; }
.c-chead { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.c-chead .icon-btn { width: 38px; height: 38px; box-shadow: none; }
.c-chead b, .c-chead small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-chead .grow { min-width: 0; }
.c-msgs { flex: 1; overflow-y: auto; padding: 10px 10px 4px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.c-day { align-self: center; margin: 10px 0 6px; padding: 2px 10px; border-radius: 99px; background: var(--paper-2); color: var(--ink-soft); font-size: .75rem; font-weight: 700; }
.c-sys { align-self: center; text-align: center; max-width: 85%; margin: 6px 0; color: var(--ink-soft); font-size: .78rem; }
.c-b { display: flex; flex-direction: column; align-items: flex-start; max-width: 100%; }
.c-b.first { margin-top: 6px; }
.c-b.mine { align-items: flex-end; }
.c-b-who { margin: 0 0 2px 34px; color: var(--ink-soft); font-size: .72rem; font-weight: 700; }
.c-b-row { display: flex; align-items: flex-end; gap: 6px; max-width: 82%; }
.c-av-gap { width: 26px; flex: none; }
.c-b-in { background: var(--paper-2); border-radius: 18px; padding: 7px 11px 4px; min-width: 64px; max-width: 100%; cursor: default; outline-offset: 2px; user-select: text; -webkit-user-select: text; }
.c-b.mine .c-b-in { background: var(--me); color: var(--on-me, #fff); }
.c-b.mine .c-b-in .c-tag, .c-b.mine .c-b-in .c-link { color: inherit; }
.c-mtext { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.c-b-time { display: block; text-align: right; font-size: .65rem; opacity: .7; margin-top: 2px; }
.c-quote { border-left: 3px solid currentColor; padding: 2px 8px; margin-bottom: 4px; opacity: .85; font-size: .82rem; border-radius: 4px; background: rgb(0 0 0 / .06); }
.c-quote b { display: block; font-size: .75rem; }
.c-quote span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.c-mshot { padding: 0; border: 0; background: none; display: block; cursor: zoom-in; }
.c-mshot img, .c-mvid { display: block; max-width: min(260px, 60vw); max-height: 320px; border-radius: 12px; margin: 2px 0 4px; background: #000; }
.c-b-in .voice { min-width: 200px; }
.c-spost { display: block; text-decoration: none; color: inherit; background: var(--raised); color: var(--ink); border-radius: 12px; padding: 8px; margin: 2px 0 4px; max-width: 240px; }
.c-spost img { width: 100%; border-radius: 8px; margin-top: 6px; max-height: 180px; object-fit: cover; }
.c-spost-t { font-size: .85rem; margin-top: 4px; overflow-wrap: anywhere; }
.c-reacts { display: flex; gap: 4px; margin: -4px 8px 2px; flex-wrap: wrap; position: relative; z-index: 1; }
.c-b:not(.mine) .c-reacts { margin-left: 40px; }
.c-react { border: 1px solid var(--rule); background: var(--raised); color: var(--ink); border-radius: 99px; padding: 1px 7px; font-size: .78rem; cursor: pointer; }
.c-react.on { border-color: var(--me); background: var(--me-tint); }
.c-seen { align-self: flex-end; font-size: .7rem; margin: 2px 6px 0; }
.c-typing { min-height: 1.2em; padding: 0 14px; font-size: .75rem; }
.c-composer { border-top: 1px solid var(--rule); padding: 8px; display: grid; gap: 6px; }
.c-cin { display: flex; align-items: flex-end; gap: 6px; }
.c-cin .icon-btn { width: 42px; height: 42px; box-shadow: none; flex: none; }
.c-input { flex: 1; min-height: 44px; max-height: 140px; resize: none; border-radius: 22px; padding: 10px 14px; line-height: 1.35; }
.c-replying:empty { display: none; }
.c-replying .row { align-items: center; gap: 6px; background: var(--paper-2); border-radius: 12px; padding: 6px 8px; }
.c-qt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.c-reqbar { display: grid; gap: 8px; padding: 4px; }
.c-reqbar p { margin: 0; }
.c-reqbar .row { gap: 8px; flex-wrap: wrap; }
.c-chat .recording { border-top: 1px solid var(--rule); }
@media (min-width: 900px) { .c-chat { height: calc(100dvh - 200px); } }

/* fewer moving parts when motion is reduced */
[data-motion="reduce"] .c-sview { animation: none; }
@media (prefers-reduced-motion: reduce) { .c-sview { animation: none; } }

/* a person's picture as a list row's lead: the round picture itself, no tile behind it */
.k-lead:has(> .avatar.c-av) { background: none; border-radius: 50%; }
.k-lead > .avatar.c-av { width: 100%; height: 100%; font-size: 1rem; box-shadow: none; }

/* On a wide screen the feed keeps a comfortable reading width, like other social apps */
@media (min-width: 900px) {
  .community .c-feed, .community .c-post, .community .c-compose-cta, .community .c-stories, .community .c-feedtools,
  .community .k-card, .community .k-seg, .community .tool-search, .community .c-chat { max-width: 680px; margin-left: auto; margin-right: auto; }
}
