/* =====================================================================
   Comments, posts, and reach and engagement (0082, public/content.js).
   Built from the AIBO design system in styles.css: each page has its own
   colour (comments teal, posts sky, reach purple), read from data-page.
   ===================================================================== */

body[data-page="comments"] { --sec: #0d9488; --sec-strong: #0f766e; --sec-deep: #134e4a; --sec-soft: #f0fdfa; --sec-line: #99f6e4; --sec-2: #22d3ee; }
body[data-page="posts"] { --sec: #0284c7; --sec-strong: #0369a1; --sec-deep: #0c4a6e; --sec-soft: #f0f9ff; --sec-line: #bae6fd; --sec-2: #38bdf8; }
body[data-page="reach"] { --sec: #9333ea; --sec-strong: #7e22ce; --sec-deep: #581c87; --sec-soft: #faf5ff; --sec-line: #e9d5ff; --sec-2: #e879f9; }
.nav-item[data-view="comments"], .nav-group-current[data-view="comments"] { --tile: #14b8a6; --tile-deep: #0f766e; --tile-glow: #5eead4; }
.nav-item[data-view="posts"], .nav-group-current[data-view="posts"] { --tile: #0ea5e9; --tile-deep: #0369a1; --tile-glow: #7dd3fc; }
.nav-item[data-view="reach"], .nav-group-current[data-view="reach"] { --tile: #a855f7; --tile-deep: #7e22ce; --tile-glow: #d8b4fe; }

/* ─── Shared ─────────────────────────────────────────────────────── */

.content-bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.content-bar-actions .button { display: inline-flex; align-items: center; gap: .4rem; width: auto; flex: none; }
.content-bar-actions .button .journey-icon, .content-access-actions .button .journey-icon { width: 1rem; height: 1rem; }
/* Whose posts a refresh button reads: the account chosen in the page's filter, or all of them. */
.content-bar-actions .button .button-scope {
  min-width: 0; max-width: 9.5rem; padding: .08rem .45rem; overflow: hidden; border-radius: 999px;
  background: color-mix(in srgb, currentColor 15%, transparent); font: 700 .7rem/1.35 var(--font-ui);
  text-overflow: ellipsis; white-space: nowrap;
}
.content-bar-actions .button[aria-busy="true"] .journey-icon { animation: content-spin .9s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .content-bar-actions .button[aria-busy="true"] .journey-icon { animation: none; }
}
.content-view select {
  width: auto; min-width: 10rem; max-width: 100%; min-height: 2.5rem; padding: .35rem 2rem .35rem .75rem; font: 650 .85rem/1.2 var(--font-ui);
}
.content-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.content-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.content-search { display: flex; gap: .4rem; }
.content-search input { width: min(16rem, 52vw); min-height: 2.5rem; padding: .4rem .75rem; font-size: .88rem; }
.content-search .button { width: auto; }

.content-tabs {
  display: flex; flex-wrap: wrap; gap: .2rem; padding: .25rem; border: 1px solid var(--ob-line); border-radius: 14px;
  background: #fff; box-shadow: var(--ob-shadow);
}
.content-tabs button, .content-range button {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 2.45rem; padding: .35rem .85rem; border: 0; border-radius: 11px;
  background: transparent; color: var(--ob-muted); font: 700 .84rem/1 var(--font-ui); cursor: pointer;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.content-tabs button:hover, .content-range button:hover { color: var(--ob-ink); background: var(--surface-3); }
.content-tabs button[aria-pressed="true"] { background: var(--sec-soft); color: var(--sec-deep); box-shadow: inset 0 0 0 1px var(--sec-line); }
.content-tabs button:focus-visible, .content-range button:focus-visible, .content-chip:focus-visible,
.comment-item:focus-visible, .post-card-media:focus-visible, .reach-top-item:focus-visible { outline: 3px solid var(--sec-line); outline-offset: 2px; }
.content-tab-count {
  display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem; border-radius: 999px;
  background: var(--sec); color: #fff; font: 800 .7rem/1 var(--font-ui); font-variant-numeric: tabular-nums;
}
.content-tab-count[hidden] { display: none; }

.content-range { display: inline-flex; padding: .2rem; border: 1px solid var(--ob-line); border-radius: 12px; background: var(--surface-3); }
.content-range button { min-height: 2.25rem; padding: .3rem .75rem; border-radius: 9px; font-size: .8rem; }
.content-range button[aria-pressed="true"] { background: #fff; color: var(--sec-strong); box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 4px 10px -6px rgba(15, 23, 42, .25); }

.content-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.content-tag {
  display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .5rem .12rem .4rem; border: 1px solid var(--tag-line, var(--ob-line));
  border-radius: 999px; background: var(--tag-soft, #f8fafc); color: var(--tag, #475569); font: 750 .7rem/1.35 var(--font-ui); white-space: nowrap;
}
.content-tag .journey-icon { width: .8rem; height: .8rem; flex: none; }
.content-tag[data-tone="amber"] { --tag: #b45309; --tag-soft: #fffbeb; --tag-line: #fde68a; }
.content-tag[data-tone="green"] { --tag: #047857; --tag-soft: #ecfdf5; --tag-line: #a7f3d0; }
.content-tag[data-tone="rose"] { --tag: #be123c; --tag-soft: #fff1f2; --tag-line: #fecdd3; }
.content-tag[data-tone="red"] { --tag: #b42318; --tag-soft: #fef2f2; --tag-line: #fecaca; }
.content-tag[data-tone="violet"] { --tag: #6d28d9; --tag-soft: #f5f3ff; --tag-line: #ddd6fe; }
.content-tag[data-tone="teal"] { --tag: #0f766e; --tag-soft: #f0fdfa; --tag-line: #99f6e4; }
.content-tag[data-tone="slate"] { --tag: #475569; --tag-soft: #f8fafc; --tag-line: #e2e8f0; }

.content-avatar {
  position: relative; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; flex: none; border-radius: 50%;
  background: linear-gradient(135deg, var(--sec-2), var(--sec-strong)); color: #fff; font: 800 .8rem/1 var(--font-ui); letter-spacing: .02em;
}
.content-avatar .platform-icon {
  position: absolute; right: -.25rem; bottom: -.25rem; width: 1.2rem; height: 1.2rem; flex-basis: 1.2rem; border: 2px solid #fff; border-radius: 50%;
}
.content-avatar .platform-icon svg { width: .7rem; height: .7rem; }
/* One colour per person, from the same family as the page colours. */
:is(.content-avatar, .mini-avatar)[data-tone="teal"] { background: linear-gradient(135deg, #14b8a6, #115e59); }
:is(.content-avatar, .mini-avatar)[data-tone="sky"] { background: linear-gradient(135deg, #0ea5e9, #075985); }
:is(.content-avatar, .mini-avatar)[data-tone="violet"] { background: linear-gradient(135deg, #8b5cf6, #5b21b6); }
:is(.content-avatar, .mini-avatar)[data-tone="amber"] { background: linear-gradient(135deg, #d97706, #92400e); }
:is(.content-avatar, .mini-avatar)[data-tone="rose"] { background: linear-gradient(135deg, #f43f5e, #9f1239); }
:is(.content-avatar, .mini-avatar)[data-tone="emerald"] { background: linear-gradient(135deg, #10b981, #065f46); }
.content-avatar.has-photo { background: #e2e8f0; }
.content-avatar.has-photo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
/* Someone Facebook hasn't named: a plain person, not made-up initials. */
.content-avatar.is-unknown { background: #e2e8f0; color: #64748b; }
.content-avatar.is-unknown > .journey-icon { width: 1.2rem; height: 1.2rem; }
.comment-item-top strong.is-unknown, .comment-detail-who h3.is-unknown { color: var(--ob-muted); font-weight: 650; }

.mini-avatar {
  display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; flex: none; overflow: hidden; border-radius: 50%;
  background: linear-gradient(135deg, var(--sec-2), var(--sec-strong)); color: #fff; font: 800 .55rem/1 var(--font-ui); object-fit: cover;
}
img.mini-avatar { background: #e2e8f0; }
.mini-avatar .journey-icon { width: .8rem; height: .8rem; }
.mini-avatar.is-unknown { background: #e2e8f0; color: #64748b; }
.mini-avatar.is-business { background: rgba(255, 255, 255, .22); color: #fff; }
.post-dialog-comments .mini-avatar.is-business { background: var(--sec-soft); color: var(--sec-strong); }
.thread-who { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.thread-who > span { min-width: 0; overflow-wrap: anywhere; }

.content-empty { margin: .5rem; }
.content-empty .button { margin-top: .65rem; width: auto; }
.content-loading { display: flex; align-items: center; gap: .55rem; margin: 0; padding: .9rem 1rem; color: var(--ob-muted); font-size: .86rem; }
.content-spinner {
  width: 1rem; height: 1rem; flex: none; border: 2px solid var(--sec-line); border-top-color: var(--sec-strong); border-radius: 50%;
  animation: content-spin .8s linear infinite;
}
@keyframes content-spin { to { transform: rotate(360deg); } }
@keyframes content-shimmer { 0% { background-position: -18rem 0; } 100% { background-position: 18rem 0; } }
.is-skeleton i, .post-card.is-skeleton .post-card-media {
  display: block; border-radius: 8px;
  background: linear-gradient(90deg, #eef2f7 0, #f8fafc 40%, #eef2f7 80%) 0 0 / 36rem 100%; animation: content-shimmer 1.4s ease-in-out infinite;
}
.comment-item.is-skeleton { cursor: default; }
.comment-item.is-skeleton .content-avatar { background: #eef2f7; }
.comment-item.is-skeleton i { height: .7rem; }
.comment-item.is-skeleton i:nth-child(1) { width: 45%; }
.comment-item.is-skeleton i:nth-child(2) { width: 92%; }
.comment-item.is-skeleton i:nth-child(3) { width: 60%; }
.post-card.is-skeleton i { height: .75rem; }
.post-card.is-skeleton i + i { width: 55%; }
.content-more { width: 100%; margin-top: .75rem; }
.content-more[hidden] { display: none; }

/* ─── Comments ───────────────────────────────────────────────────── */

#viewComments .content-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }

#viewComments .content-access {
  margin-bottom: 1rem; padding: 1.1rem 1.2rem; border-color: var(--sec-line); background: linear-gradient(135deg, var(--sec-soft), #fff 62%);
}
.content-access-head { display: flex; align-items: flex-start; gap: .85rem; }
.content-access-icon {
  display: grid; place-items: center; width: 2.8rem; height: 2.8rem; flex: none; border-radius: .9rem;
  background: linear-gradient(135deg, var(--sec-2), var(--sec-strong)); color: #fff; box-shadow: 0 10px 20px -14px var(--sec);
}
.content-access-icon .journey-icon { width: 1.35rem; height: 1.35rem; }
.content-access-head h3 { margin: 0 0 .25rem; font-size: 1.05rem; }
.content-access-head p { max-width: 62rem; margin: 0; color: var(--soft); font-size: .88rem; line-height: 1.55; }
.content-access-list { display: grid; gap: .45rem; margin: 1rem 0; padding: 0; list-style: none; }
.content-access-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; padding: .55rem .7rem; border: 1px solid var(--ob-line); border-radius: 12px; background: #fff;
}
.content-access-list strong { flex: 1 1 10rem; min-width: 0; color: var(--ob-ink); font-size: .88rem; overflow-wrap: anywhere; }
.access-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.access-chip {
  display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem .15rem .4rem; border: 1px solid var(--ob-line); border-radius: 999px;
  background: var(--surface-2); color: var(--ob-muted); font: 750 .72rem/1.35 var(--font-ui);
}
.access-chip .journey-icon { width: .8rem; height: .8rem; }
.access-chip.is-ok { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.access-chip.is-missing { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.content-access-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.content-access-actions .button { width: auto; }
.content-access-actions small { flex: 1 1 18rem; color: var(--ob-subtle); font-size: .78rem; line-height: 1.45; }
.content-access-help { margin-top: .75rem; color: var(--soft); font-size: .82rem; line-height: 1.55; }
.content-access-help summary { display: inline-flex; align-items: center; min-height: 2.25rem; color: var(--sec-strong); font-weight: 700; cursor: pointer; }
.content-access-help p { margin: .25rem 0 0; }
.content-access-help code { padding: .05rem .3rem; border-radius: 6px; background: var(--surface-3); color: var(--ob-ink); font-size: .78rem; }

.comments-layout { display: grid; grid-template-columns: minmax(19rem, 25rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
#viewComments .comments-list {
  position: sticky; top: 1rem; max-height: calc(100dvh - 2rem); overflow: auto; padding: .45rem; scrollbar-width: thin;
}
/* Room above for the sticky menu on phones, when the chosen comment scrolls into view. */
#viewComments .comment-detail { min-height: 26rem; padding: 1.1rem 1.2rem 1.2rem; scroll-margin-top: 5.5rem; }
.comment-items { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.comment-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .7rem; width: 100%; padding: .7rem .75rem; border: 1px solid transparent;
  border-radius: 16px; background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease;
}
.comment-item:hover { background: var(--surface-2); }
.comment-item.is-selected { border-color: var(--sec-line); background: var(--sec-soft); }
.comment-item-main { display: grid; gap: .28rem; min-width: 0; }
.comment-item-top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; min-width: 0; }
.comment-item-top strong { min-width: 0; overflow: hidden; color: var(--ob-ink); font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.comment-item-top time { flex: none; color: var(--ob-subtle); font-size: .74rem; }
.comment-item-text {
  display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  color: var(--soft); font-size: .86rem; line-height: 1.45; overflow-wrap: anywhere;
}
.comment-item-post { display: flex; align-items: center; gap: .35rem; min-width: 0; color: var(--ob-subtle); font-size: .74rem; }
.comment-item-post span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-item-post .journey-icon { width: .85rem; height: .85rem; flex: none; }

.comment-detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; padding-bottom: .9rem; border-bottom: 1px solid var(--ob-line); }
.comment-detail-head .content-avatar { width: 3rem; height: 3rem; font-size: .9rem; }
.comment-detail-who { flex: 1 1 12rem; min-width: 0; }
.comment-detail-who h3 { margin: 0; font-size: 1.08rem; overflow-wrap: anywhere; }
.comment-detail-who small { color: var(--ob-subtle); font-size: .78rem; }
.comment-detail-head .button { width: auto; flex: none; }
.content-back { flex-basis: 100%; justify-content: flex-start; margin: -.35rem 0 -.25rem -.5rem; }
/* A general rule hides ghost buttons' words on small screens; going back keeps them. */
.content-back span { display: inline; }

.comment-post {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .85rem; align-items: start; padding: .75rem;
  border: 1px solid var(--ob-line); border-radius: 16px; background: var(--surface-2);
}
.comment-post img, .comment-post-icon { width: 5.5rem; height: 5.5rem; border-radius: 12px; object-fit: cover; background: var(--sec-soft); }
.comment-post-icon { display: grid; place-items: center; color: var(--sec-strong); }
.comment-post-icon .journey-icon { width: 1.6rem; height: 1.6rem; }
.comment-post p {
  display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  margin: .3rem 0; color: var(--ob-text); font-size: .86rem; line-height: 1.5; overflow-wrap: anywhere;
}
.content-kind { display: inline-flex; align-items: center; gap: .3rem; color: var(--sec-strong); font: 750 .74rem/1.3 var(--font-ui); }
.content-kind .journey-icon { width: .85rem; height: .85rem; }
.comment-post-numbers { display: flex; flex-wrap: wrap; gap: .4rem .85rem; color: var(--ob-muted); font-size: .76rem; font-variant-numeric: tabular-nums; }
.comment-post-numbers span { display: inline-flex; align-items: center; gap: .25rem; }
.comment-post-numbers .journey-icon { width: .85rem; height: .85rem; color: var(--sec-strong); }

.comment-thread { display: grid; gap: .5rem; margin: 1rem 0; padding: 0; list-style: none; }
.thread-item {
  justify-self: start; max-width: min(36rem, 92%); padding: .6rem .8rem; border-radius: 4px 16px 16px 16px; background: var(--surface-3); color: var(--ob-text);
}
.thread-item.is-business {
  justify-self: end; border-radius: 16px 4px 16px 16px; color: #fff;
  background: linear-gradient(135deg, var(--sec-strong), color-mix(in srgb, var(--sec-strong) 70%, var(--sec-deep)));
}
.thread-item.is-current { box-shadow: 0 0 0 2px var(--sec); }
.thread-item strong { font-size: .76rem; }
.thread-item p { margin: .15rem 0; font-size: .9rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread-item small { font-size: .72rem; opacity: .8; }
.thread-item img { display: block; max-width: 10rem; height: auto; margin-top: .35rem; border-radius: 10px; }
.thread-delete {
  display: inline-flex; align-items: center; gap: .25rem; min-height: 1.9rem; margin-top: .3rem; padding: 0 .55rem;
  border: 1px solid transparent; border-radius: 999px; background: transparent; color: inherit; opacity: .85;
  font: 650 .74rem/1 var(--font-ui); cursor: pointer; transition: border-color .16s ease, opacity .16s ease;
}
.thread-delete .journey-icon { width: .8rem; height: .8rem; }
.thread-delete:hover { border-color: currentColor; opacity: 1; }
.thread-delete:focus-visible { outline: 3px solid var(--sec-line); outline-offset: 2px; }
.thread-delete:disabled { opacity: .45; cursor: not-allowed; }
.thread-item.is-business .thread-delete { color: #fff; }
.thread-item.is-removed, .post-dialog-comments li.is-removed { opacity: .62; }
.thread-item.is-removed p, .post-dialog-comments li.is-removed p { text-decoration: line-through; }
.memory-action.is-liked { border-color: #fecdd3; background: #fff1f2; color: #be123c; }

.comment-suggestion {
  display: grid; gap: .5rem; margin-bottom: .9rem; padding: .85rem 1rem; border: 1px solid var(--sec-line); border-radius: 16px;
  background: linear-gradient(180deg, var(--sec-soft), #fff 4.5rem);
}
.comment-suggestion header { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; color: var(--sec-deep); }
.comment-suggestion header > .journey-icon { width: 1.1rem; height: 1.1rem; }
.comment-suggestion p { display: flex; align-items: flex-start; gap: .4rem; margin: 0; color: var(--soft); font-size: .86rem; line-height: 1.5; }
.comment-suggestion p .journey-icon { width: 1rem; height: 1rem; flex: none; margin-top: .15rem; }
.comment-suggestion .button { justify-self: start; width: auto; }
.comment-suggestion .follow-up-findings { font-size: .84rem; }
.comment-suggestion .follow-up-findings strong { font-weight: 700; }
.comment-suggestion.is-waiting { border-style: dashed; background: var(--surface-2); }
.comment-suggestion.is-waiting .content-loading { padding: 0; }
.comment-suggestion.is-spam { border-color: #fecdd3; background: linear-gradient(180deg, #fff1f2, #fff 4.5rem); }
.comment-suggestion.is-spam header { color: #9f1239; }
.comment-suggestion-done { color: #047857 !important; font-weight: 650; }
.comment-check { font-weight: 700; font-size: .8rem !important; }
.comment-check.is-good { color: #047857 !important; }
.comment-check.is-check { color: #b45309 !important; }
.comment-check.is-unsafe { color: #be123c !important; }

.comment-composers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.comment-composer { display: grid; gap: .55rem; align-content: start; padding: .85rem; border: 1px solid var(--ob-line); border-radius: 16px; background: #fff; }
.comment-composer header { display: flex; align-items: flex-start; gap: .6rem; }
.comment-composer header > .journey-icon {
  width: 2.1rem; height: 2.1rem; flex: none; padding: .48rem; border-radius: .7rem; background: var(--sec-soft); color: var(--sec-strong);
}
.comment-composer.is-private header > .journey-icon { background: #eef2ff; color: #4338ca; }
.comment-composer header strong { display: block; color: var(--ob-ink); font-size: .9rem; }
.comment-composer header small { color: var(--ob-subtle); font-size: .76rem; line-height: 1.45; }
.comment-composer textarea { width: 100%; min-height: 6rem; padding: .6rem .7rem; font-size: .92rem; line-height: 1.5; resize: vertical; }
.comment-composer footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; }
.comment-composer footer .button { width: auto; }
.comment-composer .button .journey-icon { width: .95rem; height: .95rem; }
.composer-count { margin-right: auto; color: var(--ob-subtle); font-size: .74rem; font-variant-numeric: tabular-nums; }
.composer-count.is-near { color: #b45309; font-weight: 700; }
.composer-done { display: inline-flex; align-items: center; gap: .25rem; color: #047857; font-size: .76rem; font-weight: 700; }
.composer-done .journey-icon { width: .85rem; height: .85rem; }
.comment-composer.is-closed { border-style: dashed; background: var(--surface-2); }
.comment-composer.is-done { border-color: #bbf7d0; background: #f0fdf4; }
.comment-composer.is-done .button { justify-self: start; width: auto; }
.comment-actions { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--ob-line); }
.comment-actions:empty { display: none; }
.comment-removed { display: flex; align-items: center; gap: .4rem; margin: 0; padding: .75rem .9rem; border-radius: 12px; background: var(--surface-2); color: var(--ob-muted); font-size: .86rem; }
.comment-removed .journey-icon { width: 1rem; height: 1rem; }

/* ─── Posts ──────────────────────────────────────────────────────── */

.content-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.content-chip {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 2.4rem; padding: .3rem .8rem .3rem .6rem; border: 1px solid var(--ob-line);
  border-radius: 999px; background: #fff; color: var(--ob-text); font: 700 .82rem/1 var(--font-ui); cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}
.content-chip .journey-icon { width: .95rem; height: .95rem; color: var(--sec-strong); }
.content-chip span { color: var(--ob-subtle); font-variant-numeric: tabular-nums; }
.content-chip:hover { border-color: var(--sec-line); }
.content-chip[aria-pressed="true"] { border-color: var(--sec); background: var(--sec-soft); color: var(--sec-deep); }

.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.posts-grid > .content-empty { grid-column: 1 / -1; }
.post-card {
  display: grid; grid-template-rows: auto 1fr; min-width: 0; overflow: hidden; border: 1px solid var(--ob-line); border-radius: 20px;
  background: #fff; box-shadow: var(--shadow); transition: transform .18s var(--ob-ease), box-shadow .18s ease;
}
.post-card:not(.is-skeleton):hover { transform: translateY(-2px); box-shadow: var(--shadow-float); }
.post-card-media {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden; border: 0; border-radius: 0;
  background: var(--sec-soft); cursor: pointer;
}
.post-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-card-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: var(--sec-strong); }
.post-card-placeholder .journey-icon { width: 2.6rem; height: 2.6rem; opacity: .7; }
.post-kind, .post-waiting {
  position: absolute; display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem .25rem .45rem; border-radius: 999px;
  color: #fff; font: 750 .72rem/1.25 var(--font-ui);
}
.post-kind { top: .6rem; left: .6rem; background: rgba(15, 23, 42, .72); }
.post-waiting { bottom: .6rem; left: .6rem; background: #e11d48; box-shadow: 0 6px 14px -8px rgba(225, 29, 72, .8); }
.post-kind .journey-icon, .post-waiting .journey-icon { width: .85rem; height: .85rem; }
.post-platform { position: absolute; top: .6rem; right: .6rem; }
.post-platform .platform-icon { width: 1.7rem; height: 1.7rem; flex-basis: 1.7rem; border: 2px solid #fff; border-radius: 50%; }
.post-card-body { display: grid; align-content: start; gap: .45rem; padding: .8rem .9rem .9rem; min-width: 0; }
.post-caption {
  display: -webkit-box; min-height: 2.6em; margin: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  color: var(--ob-text); font-size: .86rem; line-height: 1.45; overflow-wrap: anywhere;
}
.post-card-body time { color: var(--ob-subtle); font-size: .74rem; }
.post-stats {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .35rem .5rem; margin: 0; padding-top: .55rem; border-top: 1px solid var(--ob-line);
}
.post-stats div { display: flex; align-items: center; gap: .25rem; }
.post-stats dt { display: inline-grid; color: var(--sec-strong); }
.post-stats dt .journey-icon { width: .9rem; height: .9rem; }
.post-stats dd { margin: 0; color: var(--ob-ink); font: 750 .82rem/1 var(--font-ui); font-variant-numeric: tabular-nums; white-space: nowrap; }

.post-dialog {
  width: min(60rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; overflow: auto; border: 0; border-radius: 24px;
  background: #fff; color: var(--ob-text); box-shadow: var(--shadow-float);
}
.post-dialog::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
.post-dialog[open] { animation: content-dialog-in .2s var(--ob-ease); }
@keyframes content-dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.post-dialog-body { display: grid; gap: 1rem; padding: 1.2rem; }
.post-dialog-head { display: flex; align-items: center; gap: .75rem; }
.post-dialog-head > div { flex: 1; min-width: 0; }
.post-dialog-head h2 { margin: 0; color: var(--ob-ink); font-size: 1.15rem; }
.post-dialog-head small { color: var(--ob-subtle); font-size: .8rem; }
.post-dialog-close {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: none; padding: 0; border: 1px solid var(--ob-line);
  border-radius: .85rem; background: #fff; color: var(--ob-ink); cursor: pointer;
}
.post-dialog-close:hover { background: var(--surface-3); }
.post-dialog-main { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.post-dialog-media { aspect-ratio: 1; overflow: hidden; border-radius: 18px; background: var(--sec-soft); }
.post-dialog-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-dialog-info { display: grid; align-content: start; gap: .85rem; min-width: 0; }
.post-dialog-info .button { justify-self: start; width: auto; }
.post-dialog-caption { max-height: 14rem; margin: 0; overflow: auto; font-size: .92rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-dialog-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .5rem; margin: 0; }
.post-dialog-stats div { padding: .6rem .7rem; border: 1px solid var(--ob-line); border-radius: 12px; background: var(--surface-2); }
.post-dialog-stats dt { display: flex; align-items: center; gap: .3rem; color: var(--ob-muted); font-size: .74rem; font-weight: 700; }
.post-dialog-stats dt .journey-icon { width: .9rem; height: .9rem; color: var(--sec-strong); }
.post-dialog-stats dd { margin: .2rem 0 0; color: var(--ob-ink); font: 800 1.15rem/1.1 var(--font-ui); font-variant-numeric: tabular-nums; }
.post-dialog-note { display: flex; align-items: flex-start; gap: .4rem; margin: 0; color: var(--ob-muted); font-size: .84rem; line-height: 1.5; }
.post-dialog-note .journey-icon { width: 1rem; height: 1rem; flex: none; margin-top: .15rem; }
.post-dialog-comments h3 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; font-size: 1rem; }
.post-dialog-comments ol { display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.post-dialog-comments li {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: .6rem .75rem; border: 1px solid var(--ob-line); border-radius: 12px;
}
.post-dialog-comments li > div { min-width: 0; }
.post-dialog-comments li.is-reply { margin-left: 1.5rem; }
.post-dialog-comments li.is-business { border-color: var(--sec-line); background: var(--sec-soft); }
.post-dialog-comments li .button { flex: none; width: auto; }
.post-dialog-actions { display: inline-flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .35rem; }
.post-dialog-comments .thread-delete { margin: 0; color: #b42318; }
.post-dialog-comments p { margin: .15rem 0; font-size: .86rem; line-height: 1.45; overflow-wrap: anywhere; }
.post-dialog-comments small { color: var(--ob-subtle); font-size: .72rem; }
.post-dialog-foot { display: flex; justify-content: flex-end; }

/* ─── Reach and engagement ───────────────────────────────────────── */

.reach-finding-list { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.reach-finding-list li {
  display: flex; align-items: flex-start; gap: .6rem; padding: .7rem .85rem; border-radius: 12px; background: var(--sec-soft);
  color: var(--ob-text); font-size: .9rem; line-height: 1.5;
}
.reach-finding-list .journey-icon { width: 1.1rem; height: 1.1rem; flex: none; margin-top: .15rem; color: var(--sec-strong); }
.reach-chart { margin: 0; color: var(--sec); }
.reach-chart-plot { position: relative; padding-top: 1rem; }
.reach-chart svg { display: block; width: 100%; height: clamp(10rem, 22vw, 15rem); overflow: visible; }
.reach-chart-max { position: absolute; top: 0; left: 0; color: var(--ob-subtle); font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-grid { stroke: var(--ob-line); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-line.is-views { stroke: var(--sec-strong); }
.chart-line.is-reach { stroke: var(--sec-2); stroke-dasharray: 6 4; }
.chart-area { stroke: none; }
.chart-hit { fill: transparent; stroke: none; }
.chart-hit:hover { fill: color-mix(in srgb, var(--sec) 9%, transparent); }
.reach-chart-axis { display: flex; justify-content: space-between; margin-top: .4rem; color: var(--ob-subtle); font-size: .72rem; }
.reach-chart-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .6rem; color: var(--ob-muted); font-size: .78rem; }
.reach-chart-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.reach-chart-legend .is-views::before, .reach-chart-legend .is-reach::before { content: ""; width: 1.1rem; height: .22rem; border-radius: 999px; }
.reach-chart-legend .is-views::before { background: var(--sec-strong); }
.reach-chart-legend .is-reach::before { background: repeating-linear-gradient(90deg, var(--sec-2) 0 6px, transparent 6px 9px); }
.reach-chart-note { color: #b45309; }
.content-bars { margin-top: 0; }
.content-bars .analytics-bar-row strong { display: inline-flex; align-items: center; gap: .3rem; text-transform: none; }
.content-bars .analytics-bar-row strong .journey-icon { width: .9rem; height: .9rem; color: var(--sec-strong); }
.content-bars .analytics-bar-row.is-best strong { color: var(--sec-deep); }
.content-bars .analytics-bar-row.is-best i { box-shadow: 0 0 0 2px var(--sec-line); }
.reach-top { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.reach-top-item {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: .75rem; width: 100%; padding: .55rem .7rem;
  border: 1px solid var(--ob-line); border-radius: 14px; background: #fff; color: inherit; font: inherit; text-align: start; cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease;
}
.reach-top-item:hover { border-color: var(--sec-line); background: var(--sec-soft); }
.reach-top-item img, .reach-top-item .comment-post-icon { width: 3.5rem; height: 3.5rem; border-radius: 10px; object-fit: cover; }
.reach-top-copy { display: grid; gap: .2rem; min-width: 0; }
.reach-top-copy strong { overflow: hidden; color: var(--ob-ink); font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.reach-top-copy small { display: flex; align-items: center; gap: .35rem; color: var(--ob-subtle); font-size: .74rem; }
.reach-top-copy small .platform-icon { width: 1.15rem; height: 1.15rem; flex-basis: 1.15rem; }
.reach-top-numbers { display: flex; gap: .75rem; color: var(--ob-ink); font: 750 .82rem/1 var(--font-ui); font-variant-numeric: tabular-nums; }
.reach-top-numbers span { display: inline-flex; align-items: center; gap: .25rem; }
.reach-top-numbers .journey-icon { width: .9rem; height: .9rem; color: var(--sec-strong); }

/* ─── Screen sizes ───────────────────────────────────────────────── */

@media (max-width: 1350px) {
  .comment-composers { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1100px) {
  .content-back { display: none; }
}
@media (max-width: 1099px) {
  .comments-layout { grid-template-columns: minmax(0, 1fr); }
  #viewComments .comments-list { position: static; max-height: none; }
  .comments-layout[data-pane="list"] .comment-detail { display: none; }
  .comments-layout[data-pane="detail"] .comments-list { display: none; }
}
@media (max-width: 1024px) {
  .content-tabs button, .content-range button, .content-chip, .content-access-help summary,
  .content-view select, .content-search input, .content-search .button { min-height: 44px; }
  .content-search input { font-size: 1rem; }
  .comment-composer textarea { font-size: 1rem; }
}
@media (max-width: 900px) {
  #viewComments .content-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-dialog-main { grid-template-columns: minmax(0, 1fr); }
  .post-dialog-media { max-width: 26rem; }
}
@media (max-width: 680px) {
  .content-toolbar, .content-filters { align-items: stretch; flex-direction: column; }
  .content-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content-tabs button { justify-content: center; padding: .35rem .4rem; }
  .content-search input { flex: 1; width: auto; }
  .content-bar-actions { width: 100%; }
  .content-bar-actions .button { flex: 1 1 auto; justify-content: center; }
  .content-range { width: 100%; }
  .content-range button { flex: 1; justify-content: center; }
  #viewComments .comment-detail { padding: .9rem; }
  .comment-detail-head .button:not(.content-back) { flex: 1 1 100%; justify-content: center; }
  .thread-item { max-width: 100%; }
  .thread-delete { min-height: 44px; }
  /* Hide, Spam and Mark as answered keep their words on a phone. */
  .comment-actions .memory-action { min-height: 44px; padding: 0 .75rem; border-color: var(--ob-line); }
  .comment-actions .memory-action span { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; }
  /* Two posts a row, like the apps they come from. */
  .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .post-card { border-radius: 16px; }
  .post-card-body { gap: .35rem; padding: .6rem .65rem .7rem; }
  .post-caption { font-size: .8rem; }
  .post-kind, .post-waiting { padding: .2rem .45rem .2rem .35rem; font-size: .66rem; }
  .post-kind { top: .45rem; left: .45rem; }
  .post-waiting { bottom: .45rem; left: .45rem; }
  .post-platform { top: .45rem; right: .45rem; }
  .post-platform .platform-icon { width: 1.45rem; height: 1.45rem; flex-basis: 1.45rem; }
  .post-stats { gap: .3rem .55rem; justify-content: flex-start; }
  .post-stats dd { font-size: .76rem; }
  .post-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .reach-top-item { grid-template-columns: auto minmax(0, 1fr); }
  .reach-top-item .insights-rank { display: none; }
  .reach-top-numbers { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .content-spinner { animation-duration: 2.4s; }
  .is-skeleton i, .post-card.is-skeleton .post-card-media, .post-dialog[open] { animation: none; }
  .post-card, .comment-item, .content-chip, .reach-top-item { transition: none; }
  .post-card:not(.is-skeleton):hover { transform: none; }
}
