/* v4: checkmark tiers, profile media, dialogs, sharing, stickers, job & build posts, premium checkout. */

:root {
  --mark-premium: #0f9d63; --mark-plus: #7446ea; --mark-org-a: #f3c24a; --mark-org-b: #c98a0c;
  --mark-check: #ffffff; --mark-check-org: #4a3300;
  --fg-a: #3344d0; --fg-b: #24a66b; --fg-c: #f0a81e;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --mark-premium: #34d391; --mark-plus: #a487ff; --mark-org-a: #ffd56b; --mark-org-b: #e2a524; --mark-check: #0d1413; --mark-check-org: #3a2800;
  --fg-a: #8d9bff; --fg-b: #4fe0a0; --fg-c: #ffc94d; } }
:root[data-theme="dark"] {
  --mark-premium: #34d391; --mark-plus: #a487ff; --mark-org-a: #ffd56b; --mark-org-b: #e2a524; --mark-check: #0d1413; --mark-check-org: #3a2800;
  --fg-a: #8d9bff; --fg-b: #4fe0a0; --fg-c: #ffc94d; }

/* ── checks ─────────────────────────────────────────── */
.mark { flex: none; vertical-align: -2px; }
.mark-premium .v-seal { fill: var(--mark-premium); }
.mark-plus .v-seal { fill: var(--mark-plus); }
.mark .v-check { stroke: var(--mark-check); }
.mark-org .v-check { stroke: var(--mark-check-org); }
.og-a { stop-color: var(--mark-org-a); } .og-b { stop-color: var(--mark-org-b); }
.fg-a { stop-color: var(--fg-a); } .fg-b { stop-color: var(--fg-b); } .fg-c { stop-color: var(--fg-c); }
.mark-founder .mark-ring { stroke: rgb(255 255 255 / 0.55); }
.mark-founder { filter: drop-shadow(0 0 3px color-mix(in oklab, var(--fg-b) 45%, transparent)); }
.profile-name .mark { margin-left: 8px; vertical-align: -2px; }
.tier-chip { display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 3px 10px 3px 6px; border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 700; margin-top: 2px; }
.tier-premium { background: color-mix(in oklab, var(--mark-premium) 14%, var(--surface)); color: var(--mark-premium); }
.tier-plus { background: color-mix(in oklab, var(--mark-plus) 14%, var(--surface)); color: var(--mark-plus); }
.tier-org { background: color-mix(in oklab, var(--mark-org-a) 22%, var(--surface)); color: var(--mark-org-b); }
.tier-founder { background: linear-gradient(90deg, color-mix(in oklab, var(--fg-a) 16%, var(--surface)), color-mix(in oklab, var(--fg-c) 18%, var(--surface))); color: var(--ink); }

/* ── avatars with photos; organizations are square ──── */
.avatar.has-photo { overflow: hidden; background: var(--sunk); }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.is-org { border-radius: 26%; }
.profile-cover.has-banner { background-size: cover; background-position: center; }
.profile-hero .avatar-xl.has-photo { box-shadow: 0 0 0 5px var(--paper); }

/* ── dialogs ────────────────────────────────────────── */
body.has-dialog { overflow: hidden; }
.dialog-backdrop {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgb(8 14 13 / 0.5); animation: fade 160ms var(--ease);
}
.dialog-backdrop.is-closing { opacity: 0; transition: opacity 150ms; }
.dialog {
  width: min(100%, 460px); max-height: calc(100vh - 32px); overflow-y: auto; display: grid; gap: 14px; align-content: start;
  padding: 18px 20px 20px; border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-2); animation: rise 220ms var(--ease);
}
.dialog:focus { outline: none; }
.dialog-wide { width: min(100%, 640px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-head .h3 { flex: 1; }
@media (max-width: 560px) {
  .dialog-backdrop { place-items: end stretch; padding: 0; }
  .dialog { width: 100%; max-height: 92vh; border-radius: var(--r-l) var(--r-l) 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
}

/* keyboard shortcuts */
.shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; }
.shortcuts dl { margin: 6px 0 0; display: grid; gap: 6px; }
.shortcuts dl div { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: var(--t-s); }
.shortcuts dt { flex: none; }
.shortcuts dd { margin: 0; color: var(--ink-2); text-align: right; }
kbd { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--paper); font-family: var(--f-mono); font-size: 0.75rem; color: var(--ink); }

/* ── edit profile ───────────────────────────────────── */
.dialog-edit { width: min(100%, 580px); padding: 0 0 20px; gap: 0; }
.dialog-edit .dialog-head { position: sticky; top: 0; z-index: 2; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.ep-banner { position: relative; height: 160px; background: linear-gradient(120deg, var(--cobalt-soft), var(--overlap-soft), var(--marigold-soft)); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; gap: 12px; }
.ep-cam { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgb(0 0 0 / 0.55); color: #fff; cursor: pointer; transition: background var(--dur); }
.ep-cam:hover { background: rgb(0 0 0 / 0.75); }
.ep-cam:focus-within, .ep-cam:focus-visible { box-shadow: var(--focus); }
.ep-avatar { position: relative; width: 104px; margin: -52px 0 0 20px; }
.ep-avatar .avatar-xl { box-shadow: 0 0 0 4px var(--surface); }
.ep-cam-avatar { position: absolute; inset: 0; margin: auto; }
.ep-remove-photo { margin: 6px 0 0 20px; justify-self: start; }
.ep-fields { padding: 14px 20px 0; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: minmax(0, 1fr); } }

/* ── posts: context, repost, job, build ─────────────── */
.post-context { display: flex; align-items: center; gap: 6px; margin: -4px 0 -6px 4px; font-size: var(--t-xs); font-weight: 600; color: var(--ink-3); }
.post-context a { color: inherit; text-decoration: none; }
.post-context a:hover { text-decoration: underline; }
.post.is-pinned { border-color: color-mix(in oklab, var(--fg-b) 35%, var(--line-soft)); }
.act-repost:hover, .act-repost.is-on { color: var(--overlap); }
.post-actions { gap: 2px; }
.type-job { background: var(--marigold-soft); color: var(--cat-values); }
.type-build { background: color-mix(in oklab, var(--mark-plus) 13%, var(--surface)); color: var(--mark-plus); }
.type-btn.is-active.type-job { background: var(--marigold-soft); color: var(--cat-values); }
.type-btn.is-active.type-build { background: color-mix(in oklab, var(--mark-plus) 13%, var(--surface)); color: var(--mark-plus); }
.job-card, .build-card { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--r-m); border: 1px solid var(--line-soft); background: var(--paper); }
.build-card { background: linear-gradient(135deg, color-mix(in oklab, var(--mark-plus) 7%, var(--paper)), var(--paper) 60%); }
.job-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.job-top > svg { color: var(--cat-values); }
.build-card .job-top > svg { color: var(--mark-plus); }
.job-title { font-size: 1.05rem; }
.hiring-tag, .stage-tag { margin-left: auto; padding: 2px 9px; border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 700; }
.hiring-tag { background: linear-gradient(180deg, var(--mark-org-a), var(--mark-org-b)); color: var(--mark-check-org); }
.stage-tag { background: var(--sunk); color: var(--ink-2); }
.chip-pay { background: var(--overlap-soft); color: var(--overlap); font-weight: 600; }
.job-card .btn, .build-actions .btn { justify-self: start; }
.build-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* feed head + refresh */
.feed-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.feed-head > div { display: grid; gap: 4px; }
.refresh-btn.is-spinning svg { animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ptr { --pull: 0px; display: flex; align-items: center; justify-content: center; gap: 8px; height: var(--pull); overflow: hidden; color: var(--ink-3); font-size: var(--t-xs); font-weight: 600; transition: height 180ms var(--ease); }
.ptr svg { transform: rotate(calc(var(--pull) * 3)); }
.ptr.is-ready { color: var(--cobalt); }

/* composer: job / build fields */
.extra-fields { margin-top: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-m); }
.mini-field { display: grid; gap: 4px; min-width: 0; }
.mini-field > span { font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
.mini-field input, .mini-field select { width: 100%; min-height: 38px; padding: 6px 10px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.mini-field input:focus, .mini-field select:focus { outline: none; border-color: var(--cobalt); }
.mini-wide { grid-column: 1 / -1; }
@media (max-width: 480px) { .extra-fields { grid-template-columns: minmax(0, 1fr); } }

/* ── rich replies ───────────────────────────────────── */
.reply-composer { position: relative; display: grid; gap: 8px; padding-bottom: 12px; }
.reply-row { display: flex; align-items: center; gap: 10px; }
.reply-row input { flex: 1; min-width: 0; min-height: 42px; padding: 8px 16px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); }
.reply-row input:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-soft); }
.reply-tools { display: flex; align-items: center; gap: 2px; padding-left: 40px; }
.reply-send { margin-left: auto; }
.reply-attach:empty { display: none; }
.reply-attach { padding-left: 44px; }
.attach-sm { display: inline-block; max-width: 280px; border: 0; overflow: visible; }
.attach-sm .attach-remove { top: -8px; right: -8px; width: 26px; height: 26px; }
.reply-media { margin-top: 6px; border-radius: var(--r-m); overflow: hidden; max-width: 340px; border: 1px solid var(--line-soft); }
.reply-media img, .reply-media video { display: block; width: 100%; max-height: 300px; object-fit: cover; background: #000; }
.sticker-pop { position: absolute; z-index: 20; left: 40px; top: calc(100% - 8px); padding: 10px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.sticker-picker { display: grid; grid-template-columns: repeat(4, auto); gap: 6px; }
.sticker-opt { border: 0; background: transparent; padding: 4px; border-radius: var(--r-m); }
.sticker-opt:hover, .sticker-opt:focus-visible { background: var(--sunk); }
.reply.is-highlighted { background: linear-gradient(90deg, color-mix(in oklab, var(--mark-plus) 8%, transparent), transparent 70%); border-radius: var(--r-m); padding-inline: 10px; margin-inline: -10px; }
.hl-tag { padding: 1px 7px; border-radius: var(--r-pill); background: color-mix(in oklab, var(--mark-plus) 15%, var(--surface)); color: var(--mark-plus); font-size: 0.6875rem; font-weight: 700; }

/* stickers */
.sticker { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 10px 16px 10px 10px; border-radius: 22px 22px 22px 6px; font-weight: 800; font-size: 1rem; letter-spacing: -0.01em; transform-origin: bottom left; animation: sticker-in 600ms cubic-bezier(.3, 1.6, .5, 1) both, wobble 3.2s ease-in-out 700ms infinite; box-shadow: 0 2px 0 rgb(0 0 0 / 0.08); }
.sticker-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgb(255 255 255 / 0.85); }
.sticker-sm { margin: 0; padding: 6px 10px 6px 6px; font-size: 0.75rem; animation: none; }
.sticker-sm .sticker-icon { width: 24px; height: 24px; }
.sticker-sm .sticker-icon svg { width: 15px; height: 15px; }
.tone-cobalt { background: var(--cobalt); color: var(--on-cobalt); } .tone-cobalt .sticker-icon { color: var(--cobalt); }
.tone-overlap { background: var(--overlap); color: var(--surface); } .tone-overlap .sticker-icon { color: var(--overlap); }
.tone-marigold { background: var(--marigold); color: #241a00; } .tone-marigold .sticker-icon { color: #9a6200; }
.tone-heart { background: var(--heart); color: #fff; } .tone-heart .sticker-icon { color: var(--heart); }
.tone-need { background: var(--need); color: var(--surface); } .tone-need .sticker-icon { color: var(--need); }
@keyframes sticker-in { from { transform: scale(0.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wobble { 0%, 86%, 100% { transform: none; } 90% { transform: rotate(-5deg); } 95% { transform: rotate(4deg); } }

/* ── share dialog ───────────────────────────────────── */
.share-preview { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--r-m); background: var(--paper); font-size: var(--t-s); overflow-wrap: anywhere; }
.share-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.share-opt { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface); font-weight: 600; color: var(--ink); }
.share-opt:hover { border-color: var(--ink-3); }
.share-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; max-height: 220px; overflow-y: auto; }
.share-person { position: relative; width: 100%; display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border: 0; border-radius: var(--r-m); background: transparent; font-size: var(--t-xs); text-align: center; color: var(--ink); }
.share-person:hover { background: var(--sunk); }
.share-person .name-mark { justify-content: center; flex-wrap: wrap; }
.share-check { position: absolute; top: 6px; right: 14px; display: none; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--cobalt); color: var(--on-cobalt); box-shadow: 0 0 0 2px var(--surface); }
.share-person[aria-pressed="true"] .share-check { display: grid; }
.share-person[aria-pressed="true"] .avatar { box-shadow: 0 0 0 3px var(--cobalt); }
.share-note { width: 100%; min-height: 42px; padding: 8px 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--paper); }

/* shared post inside a message */
.shared-post { display: grid; gap: 4px; min-width: 200px; margin-bottom: 4px; padding: 10px 12px; border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none; border: 1px solid var(--line-soft); }
.shared-post:hover { color: var(--ink); border-color: var(--line); }
.shared-head { display: flex; align-items: center; gap: 6px; font-size: var(--t-xs); }
.shared-head .avatar { width: 22px; height: 22px; font-size: 0.55rem; }
.shared-body { font-size: var(--t-s); line-height: 1.4; }
.shared-cta { font-size: var(--t-xs); font-weight: 700; color: var(--cobalt); }
.shared-post.is-missing { color: var(--ink-3); font-style: italic; }

/* ── premium page ───────────────────────────────────── */
.mark-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.mark-key { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-s); font-weight: 600; }
.notice-founder { background: linear-gradient(90deg, color-mix(in oklab, var(--fg-a) 14%, var(--surface)), color-mix(in oklab, var(--fg-c) 16%, var(--surface))); margin-bottom: 16px; }
.billing-toggle { margin-bottom: 16px; }
.save-tag { margin-left: 6px; padding: 1px 7px; border-radius: var(--r-pill); background: var(--overlap-soft); color: var(--overlap); font-size: 0.6875rem; font-weight: 700; }
.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; margin-bottom: 18px; }
.tier { position: relative; padding: 20px; display: grid; gap: 12px; align-content: start; border-width: 1.5px; }
.tier.is-featured { border-color: var(--mark-plus); box-shadow: 0 0 0 4px color-mix(in oklab, var(--mark-plus) 14%, transparent); }
.tiercard-org { background: linear-gradient(180deg, color-mix(in oklab, var(--mark-org-a) 10%, var(--surface)), var(--surface) 40%); }
.tier-flag { position: absolute; top: -11px; left: 18px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--mark-plus); color: #fff; font-size: var(--t-xs); font-weight: 700; }
.tier-head { display: flex; align-items: center; gap: 10px; }
.tier-name { font-size: 1.25rem; font-weight: 700; }
.tier-price strong { font-family: var(--f-display); font-weight: 400; font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.tier-price span { color: var(--ink-3); font-size: var(--t-s); }
.tier-perks { display: grid; gap: 8px; }
.tier-perks li { display: flex; gap: 8px; align-items: flex-start; font-size: var(--t-s); }
.tier-perks svg { flex: none; margin-top: 2px; color: var(--overlap); }
.tier .btn { margin-top: auto; }
.compare { padding: 20px; margin-bottom: 16px; display: grid; gap: 12px; }
.compare-scroll { overflow-x: auto; }
.compare-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: var(--t-s); }
.compare-table th, .compare-table td { padding: 10px 8px; border-top: 1px solid var(--line-soft); text-align: center; font-variant-numeric: tabular-nums; }
.compare-table thead th { border-top: 0; font-weight: 700; }
.compare-table th[scope="row"] { text-align: left; font-weight: 500; color: var(--ink-2); }
.compare-table td svg { color: var(--overlap); vertical-align: middle; }
.checkout { padding: 22px; display: grid; gap: 16px; }
.checkout-head { display: flex; align-items: center; gap: 14px; }
.checkout-preview { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r-m); background: var(--paper); }
.prem-preview { display: inline-flex; align-items: center; gap: 8px; }
.checkout-sum { margin: 0; display: grid; gap: 8px; padding: 14px 0; border-block: 1px solid var(--line-soft); }
.checkout-sum div { display: flex; justify-content: space-between; gap: 12px; font-size: var(--t-s); }
.checkout-sum dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.save-row { color: var(--overlap); }
.sum-total { font-size: var(--t-base) !important; font-weight: 700; padding-top: 8px; border-top: 1px dashed var(--line); }
.sum-total dd { font-size: 1.2rem; }
.checkout-org { gap: 12px; }
