/* ---------- threaded comments ---------- */
.comments-title { margin:26px 0 2px; font-size:1.05rem; font-weight:600; color:var(--text); display:flex; align-items:baseline; gap:8px; }
.comments-title .count { font-size:.8rem; font-weight:500; color:var(--muted); }
.gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:8px; margin:10px 0; }
.gallery-item { display:block; border-radius:8px; overflow:hidden; background:var(--card2); }
.gallery-item img { display:block; width:100%; height:auto; cursor:zoom-in; }
.gallery-item:hover img { opacity:.9; }
.comments { margin-top:6px; }
.comment { position:relative; margin:4px 0; padding:8px 12px; border-radius:10px; transition:background .12s ease; }
.comment:hover { background:var(--card2); }
/* tree: vertical line for a thread + a horizontal tick to each child */
.comment-thread { margin-left:10px; padding-left:20px; border-left:2px solid var(--line); }
.comment-thread > .comment::before {
  content:""; position:absolute; left:-20px; top:22px; width:20px; height:2px;
  background:var(--line); border-radius:2px;
}
.comment-head { display:flex; gap:8px; align-items:center; font-size:.82rem; flex-wrap:wrap; }
.comment-head a.author { color:var(--accent); font-weight:700; text-decoration:none; letter-spacing:.1px; }
.comment-head a.author:hover { text-decoration:underline; }
.comment-head .meta { color:var(--muted); }
.comment-head .meta a { color:var(--muted); text-decoration:none; }
.comment-head .meta a:hover { color:var(--link); text-decoration:underline; }
.comment-head .sep { color:var(--line); }
.comment-head .op { background:var(--accent); color:var(--accent-text); border-radius:5px; padding:1px 6px; font-size:.66rem; font-weight:700; letter-spacing:.4px; }
.comment-body { font-size:.94rem; line-height:1.55; margin:6px 0 2px; color:var(--text); overflow-wrap:break-word; }
.comment-body p { margin:6px 0; }
.comment-body img { max-width:100%; border-radius:8px; }
.comment-body a { color:var(--link); }
.comment-body blockquote { border-left:3px solid var(--accent); margin:8px 0; padding:2px 12px; color:var(--muted); background:var(--card2); border-radius:0 6px 6px 0; }
.comment-body pre, .comment-body code { background:var(--code-bg); border-radius:5px; padding:1px 5px; font-size:.86em; }
.comment-body pre { padding:10px; overflow-x:auto; }
/* collapse: hide body + replies, show a note instead */
.comment.collapsed > .comment-body, .comment.collapsed > .comment-thread { display:none; }
.comment-head .collapsed-note { display:none; color:var(--muted); font-style:italic; font-size:.78rem; }
.comment.collapsed > .comment-head .collapsed-note { display:inline; }
.comment.collapsed > .comment-head .meta, .comment.collapsed > .comment-head .sep { display:none; }
.collapser { cursor:pointer; user-select:none; color:var(--muted); border:none; background:none;
  width:20px; height:20px; display:inline-flex; align-items:center; justify-content:center;
  border-radius:6px; padding:0; flex:0 0 auto; transition:transform .15s ease, background .12s, color .12s; }
.collapser:hover { color:var(--text); background:var(--border); }
.collapser svg { width:14px; height:14px; }
.comment.collapsed > .comment-head .collapser { transform:rotate(-90deg); }

.badge.cached { background:var(--code-bg); color:var(--muted); font-size:.7rem; }
.giphy { max-width:100%; max-width:420px; border-radius:8px; display:block; margin:8px 0; }
.giphy-toggle { display:inline-block; margin:6px 0; padding:4px 10px; border-radius:6px;
  background:var(--card2); border:1px solid var(--border); color:var(--accent);
  font-size:.82rem; text-decoration:none; cursor:pointer; }
.giphy-toggle:hover { background:var(--border); }
.reply-form { margin-bottom:16px; }
.reply-form h3 { margin:0 0 8px; font-size:1rem; }
.reply-form textarea, .reply-inline textarea { width:100%; box-sizing:border-box;
  background:var(--code-bg); color:var(--fg); border:1px solid var(--border);
  border-radius:8px; padding:8px 10px; font:inherit; resize:vertical; }
.reply-form button, .reply-inline button { margin-top:8px; }
.reply-row { margin-top:6px; }
.reply-toggle { background:none; border:none; color:var(--accent); cursor:pointer;
  font-size:.8rem; padding:2px 0; }
.reply-toggle:hover { text-decoration:underline; }
.edit-toggle { background:none; border:none; color:var(--accent); cursor:pointer;
  font-size:.8rem; padding:2px 0; }
.edit-toggle:hover { text-decoration:underline; }
.del-btn { background:none; border:none; color:var(--danger, #e5606a); cursor:pointer;
  font-size:.8rem; padding:2px 0; }
.del-btn:hover { text-decoration:underline; }
.edit-inline { margin-top:8px; }
.reply-inline { margin-top:8px; }

/* round 13: reddit's own machine translation (translate buttons + the
   swapped-in translated body). The button lives in .comment-head and the
   post .meta row; .translated/.translation-* are added by base.js at
   runtime (show-original toggles back to the untouched original). */
.translate-btn { background:none; border:none; color:var(--accent);
  cursor:pointer; font-size:.8rem; padding:2px 0; margin-left:6px; }
.translate-btn:hover { text-decoration:underline; }
.translate-btn.err { color:var(--danger, #e5606a); }
.badge.lang { opacity:.85; }
.translation-note { color:var(--muted); font-size:.78rem; font-style:italic;
  margin-top:4px; }
.translated:not(.show-original) .translation-original { display:none; }
.translated.show-original .translation-text,
.translated.show-original .translation-note { display:none; }

/* ---------- round 16: comment-sort toolbar ----------
   Shares .toolbar / .toolbar a / .toolbar a.on with the listing sort rows
   (base.css — same look everywhere); this only tightens the gap under the
   comments heading. */
.comment-sorts { margin:2px 0 10px; }
/* round 18: the honest comment-window note ("showing N of M · show
   more") under the sort toolbar — muted like the count span, the rung
   link styled like any other inline link */
.cmt-window { margin:2px 0 10px; font-size:.8rem; color:var(--muted); }
.cmt-window a { color:var(--link); }
/* round 17: the ?tl= render can come back UNtranslated (no MT for the
   language) — the note says so instead of dressing the no-op up */
.translation-note.translation-same { color: var(--accent); font-weight:600; }
