/* ===== KudosC tweaks: theme prompt on top, one-line project header, bigger chats actions, spaced chat list ===== */

/* 1) "Wanna try dark theme?" popup now slides in from the TOP */
.theme-prompt { bottom: auto !important; top: calc(10px + env(safe-area-inset-top, 0px)); animation: tp-in-top .35s cubic-bezier(.2,.8,.2,1) both; z-index: 1200; }
.theme-prompt.is-leaving { transform: translateY(-16px); }
@keyframes tp-in-top { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }

/* 2) Home projects: name block + Connect + three-dot always on ONE line */
.feed-card .project-author { flex-wrap: nowrap; align-items: center; gap: 10px; }
.feed-card .project-author > div:not(.project-author-actions) { flex: 1 1 auto; min-width: 0; }
.feed-card .project-author > div:not(.project-author-actions) strong,
.feed-card .project-author > div:not(.project-author-actions) small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-card .project-author-actions { flex: 0 0 auto; flex-wrap: nowrap; gap: 6px; margin-left: auto; }
.feed-card .project-author-actions .follow-button { align-items: center; border-radius: 999px; display: inline-flex; font-size: 11.5px; gap: 5px; height: 34px; margin-left: 0; padding: 0 14px; white-space: nowrap; }
.feed-card .project-author-actions .follow-button svg { height: 13px; width: 13px; }
.feed-card .project-author-actions .card-menu-button { border: 1px solid #e1e5ed; height: 34px; width: 34px; }
body[data-theme="dark"] .feed-card .project-author-actions .card-menu-button { border-color: rgba(255,255,255,.14); }

/* 3) Chats page: bigger, cooler Select / New group buttons */
#page-messages .feed-heading { align-items: center; }
#page-messages .feed-heading-actions { display: flex; flex-wrap: wrap; gap: 10px; }
#page-messages .feed-heading-actions .secondary-action { align-items: center; background: #f1efff; border: 1px solid #ddd8ff; border-radius: 14px; box-shadow: 0 4px 12px rgba(110,94,217,.14); color: #5b4bd0; display: inline-flex; font-size: 14px; font-weight: 800; gap: 8px; justify-content: center; min-height: 46px; padding: 0 18px; transition: transform .15s ease, box-shadow .15s ease; }
#page-messages .feed-heading-actions .secondary-action svg { height: 19px; width: 19px; }
#page-messages .feed-heading-actions #newGroupButton, #page-messages .feed-heading-actions #newChannelButton { background: linear-gradient(135deg, #7a68ee, #5b4bd0); border-color: transparent; box-shadow: 0 8px 20px rgba(110,94,217,.38); color: #fff; }
#page-messages .feed-heading-actions .secondary-action:active { transform: scale(.96); }
body[data-theme="dark"] #page-messages .feed-heading-actions #threadSelectModeButton { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.16); box-shadow: none; color: #e6edf3; }

/* 4) Chats page: breathing room between the search box and the chat list */
#page-messages #threadSearchWrap { margin-bottom: 16px; }
#page-messages .thread-list-standalone { padding-top: 4px; }

/* 5) Dark theme page colour: #181818 everywhere (final override) */
html:has(body[data-theme="dark"]), body[data-theme="dark"] { background: #181818 !important; }
body[data-theme="dark"] { --kc-bg: #181818; --kc-bg-alt: #1c1c1c; }
body[data-theme="dark"] .app-view,
body[data-theme="dark"] .app-layout,
body[data-theme="dark"] .main-column,
body[data-theme="dark"] .page-view { background-color: transparent; }
body[data-theme="dark"] #page-messages,
body[data-theme="dark"] .thread-list-standalone,
body[data-theme="dark"] .thread-messages,
body[data-theme="dark"] .chat-page-inner { background-color: #181818; }

/* 5) Chats page: icon-only Select / New group / New channel, pinned top-right */
#page-messages .feed-heading { flex-wrap: nowrap; }
#page-messages .feed-heading-actions { flex-wrap: nowrap; gap: 10px; margin-left: auto; justify-content: flex-end; }
#page-messages .feed-heading-actions .secondary-action { border-radius: 50%; height: 46px; min-height: 46px; min-width: 46px; padding: 0; width: 46px; }
#page-messages .feed-heading-actions .secondary-action svg { height: 22px; width: 22px; }

/* 6) Chats page: bigger "Search conversations…" field + placeholder */
#page-messages .thread-search { gap: 12px; padding: 14px 16px; }
#page-messages .thread-search svg { height: 20px; width: 20px; }
#page-messages .thread-search input { font-size: 16px; line-height: 1.4; min-height: 28px; }
#page-messages .thread-search input::placeholder { font-size: 16px; opacity: .75; }

/* 7) Search page: bigger, cleaner account rows */
#page-search .search-people-label { font-size: 12px; margin-bottom: 10px; }
#page-search .search-person-row { gap: 14px; padding: 14px 4px; }
#page-search .search-person-info { gap: 14px; }
#page-search .search-person-info .mini-avatar { font-size: 17px; height: 60px; width: 60px; }
#page-search .search-person-info .mini-avatar img { border-radius: 50%; height: 100%; object-fit: cover; width: 100%; }
#page-search .search-person-text { gap: 3px; }
#page-search .search-person-text strong { font-size: 17px; font-weight: 800; line-height: 1.25; }
#page-search .search-person-text small { font-size: 14px; }
#page-search .search-person-row .small-follow { font-size: 13px; padding: 10px 16px; }
#page-search .search-person-row .small-follow svg { height: 15px; width: 15px; }

/* 8) Payments (online checkout + admin ledger) */
.pay-modal-price { font-size: 38px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; }
.pay-modal-sub { color: #8a92a6; font-size: 13px; margin: 0 0 14px; }
.pay-trust { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.pay-trust li { align-items: flex-start; color: #5a6279; display: flex; font-size: 13px; gap: 8px; line-height: 1.4; }
.pay-trust li::before { color: #1f9d55; content: '✓'; font-weight: 800; }
.pay-button { align-items: center; background: linear-gradient(135deg, #7a68ee, #5b4bd0); border-radius: 14px; box-shadow: 0 8px 20px rgba(110,94,217,.38); color: #fff; display: flex; font-size: 16px; font-weight: 800; gap: 8px; justify-content: center; min-height: 52px; width: 100%; }
.pay-button:disabled { opacity: .6; }
.pay-methods { color: #8a92a6; font-size: 12px; margin-top: 10px; text-align: center; }
.pay-result { align-items: center; display: grid; gap: 6px; justify-items: center; padding: 10px 0 4px; text-align: center; }
.pay-result .pay-tick { align-items: center; background: #e2f8ea; border-radius: 50%; color: #1c8a4c; display: flex; font-size: 30px; height: 64px; justify-content: center; width: 64px; }
.pay-result .pay-tick.wait { background: #fff4dd; color: #b9770e; }
body[data-theme="dark"] .pay-modal-sub, body[data-theme="dark"] .pay-trust li, body[data-theme="dark"] .pay-methods { color: #aab2c5; }

.pay-banner { border-radius: 12px; font-size: 13px; line-height: 1.45; margin: 0 0 14px; padding: 12px 14px; }
.pay-banner.ok { background: #e2f8ea; color: #17703d; }
.pay-banner.warn { background: #fff4dd; color: #8a5a06; }
.pay-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 16px; }
.pay-stat { background: #fff; border: 1px solid #e6e8f0; border-radius: 14px; padding: 12px 14px; }
.pay-stat strong { display: block; font-size: 20px; letter-spacing: -.01em; }
.pay-stat span { color: #8a92a6; font-size: 12px; }
.pay-stat.alert strong { color: #c0392b; }
.pay-price-row { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pay-price-row label { color: #5a6279; display: grid; font-size: 12px; font-weight: 700; gap: 4px; }
.pay-price-row input, .pay-toolbar input { background: #f4f5f9; border: 1px solid #e1e5ed; border-radius: 10px; font-size: 14px; min-height: 40px; padding: 0 10px; width: 100%; }
.pay-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.pay-toolbar input { flex: 1 1 100%; }
.pay-toolbar .secondary-action { flex: 1 1 auto; justify-content: center; }
.pay-row { margin-bottom: 10px; }
.pay-row-head { align-items: flex-start; display: flex; gap: 10px; justify-content: space-between; }
.pay-row-head strong { font-size: 15px; }
.pay-row-head small { color: #8a92a6; display: block; font-size: 12px; margin-top: 2px; }
.pay-amounts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; margin: 8px 0 6px; }
.pay-amounts b { font-weight: 800; }
.pay-checks { color: #5a6279; display: flex; flex-wrap: wrap; font-size: 12px; gap: 4px 12px; }
.pay-checks .yes { color: #1c8a4c; }
.pay-checks .no { color: #b9770e; }
.pay-ids { color: #8a92a6; font: 11px "DM Mono", monospace; margin-top: 6px; overflow-wrap: anywhere; }
.pay-pill { border-radius: 20px; font-size: 11px; font-weight: 800; padding: 4px 10px; text-transform: capitalize; white-space: nowrap; }
.pay-pill.paid { background: #e2f8ea; color: #1c8a4c; }
.pay-pill.created { background: #eaf0ff; color: #3a5bd0; }
.pay-pill.failed { background: #fde8e8; color: #c0392b; }
.pay-pill.refunded { background: #f1eaff; color: #6a45c4; }
.pay-pill.mismatch { background: #fff4dd; color: #b9770e; }
.pay-payout { align-items: center; border-top: 1px solid #eceef5; display: flex; gap: 10px; justify-content: space-between; padding: 10px 0; }
.pay-payout:first-child { border-top: 0; }
.pay-payout small { color: #8a92a6; display: block; font-size: 12px; overflow-wrap: anywhere; }
body[data-theme="dark"] .pay-stat { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.1); }
body[data-theme="dark"] .pay-price-row input, body[data-theme="dark"] .pay-toolbar input { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #f2f2f2; }
body[data-theme="dark"] .pay-payout { border-color: rgba(255,255,255,.1); }
body[data-theme="dark"] .pay-checks, body[data-theme="dark"] .pay-price-row label { color: #aab2c5; }
@media (min-width: 700px) { .pay-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .pay-toolbar input { flex: 2 1 260px; } }

/* ---- Project card: tags + Full screen + ⋯ on ONE line (compact, professional) ---- */
.feed-card-meta-row { align-items: center; display: flex; gap: 8px; justify-content: space-between; margin: 8px 0 4px; min-width: 0; }
.feed-card-meta-row .tech-row { flex: 1 1 auto; flex-wrap: nowrap; margin: 0; min-width: 0; overflow: hidden; }
.feed-card-meta-row .tech-row span { flex: 0 1 auto; max-width: 33%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-card-meta-actions { align-items: center; display: flex; flex: 0 0 auto; gap: 6px; }
.feed-card-meta-actions .feed-card-fullscreen-button { height: 32px; padding: 0 11px; white-space: nowrap; }
.feed-card-meta-actions .card-menu-button { border: 1.5px solid #e3e6ee; border-radius: 10px; color: #4b5568; height: 32px; width: 32px; }
body[data-theme="dark"] .feed-card-meta-actions .card-menu-button { border-color: rgba(255,255,255,.14); color: #c9c9d3; }
@media (max-width: 380px) { .feed-card-meta-actions .feed-card-fullscreen-button span { display: none; } .feed-card-meta-actions .feed-card-fullscreen-button { padding: 0 9px; } }

/* ---- Guests: locked GitHub / Source code / Download buttons ---- */
.guest-lock-button { cursor: pointer; opacity: .92; }
.guest-lock-button svg { height: 13px; width: 13px; }

/* ---- Zoom + text selection on projects & community posts ----------------------------------
   The swipe track used touch-action: pan-y (which also switches off pinch-zoom) and the card
   front used user-select: none, so posts could neither be zoomed nor selected. Pinch-zoom is
   now allowed (double-tap stays free for "give kudos") and post text is selectable again. */
.swipe-track { touch-action: pan-y pinch-zoom; }
.swipe-front,
.project-card, .feed-card, .community-post-row,
.feed-card-summary, .community-post-summary, .community-post-headline, .feed-card-title-row,
.feed-card-body, .project-author strong, .tech-row {
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;
}
.project-card button, .feed-card button, .swipe-actions, .action-button, .dock-item,
.project-card .profile-trigger { -webkit-user-select: none; user-select: none; }
.lightbox-layer { touch-action: pan-y pinch-zoom; }
.lightbox-stage img { touch-action: pinch-zoom pan-x pan-y; }
