/**
 * hub-thread.css — the HUB's one comment thread (assets/js/hub-thread.js).
 * Facebook-style: bubbles, Like · Reply under each, replies tucked under the
 * top comment ("View 3 replies"), a reply to a reply tagged with whom it
 * answers. Used on the home feed cards and on every item page. The HUB is
 * dark-only; colours follow hub-ui-v2.css. Everything is scoped under .ht.
 */
.ht {
  --ht-bg: #0f141c;
  --ht-surface: #161c26;
  --ht-bubble: #1f2734;
  --ht-bubble-own: #1d2a40;
  --ht-line: #28303d;
  --ht-line-2: #333c4a;
  --ht-ink: #e6ebf3;
  --ht-ink-2: #c9d1dc;
  --ht-muted: #9aa5b6;
  --ht-faint: #7d899b;
  --ht-accent: #3b76f0;
  --ht-link: #7aa5ff;
  --ht-like: #ff5c7a;
  --ht-star: #f6c964;
  color: var(--ht-ink);
  font-size: 15px;
  line-height: 1.45;
}
.ht *, .ht *::before, .ht *::after { box-sizing: border-box; }
.ht button { font: inherit; color: inherit; }
.ht a { color: var(--ht-link); text-decoration: none; }
.ht a:hover { text-decoration: underline; }
.ht [hidden] { display: none !important; }   /* the display rules below must not resurrect hidden parts */
.ht-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Header (item pages) ───────────────────────────────────────────────── */
.ht-head { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.ht-title { margin: 0; font-size: 20px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px; }
.ht-count { font-size: 14px; font-weight: 600; color: var(--ht-muted); background: var(--ht-bubble); border-radius: 999px; padding: 1px 9px; }
.ht-rating { display: inline-flex; align-items: center; gap: 6px; color: var(--ht-muted); font-size: 14px; }
.ht-rating b { color: #fff; font-size: 15px; }
.ht-sort { margin-left: auto; display: inline-flex; background: var(--ht-surface); border: 1px solid var(--ht-line); border-radius: 10px; padding: 3px; }
.ht-sort button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-size: 13.5px; color: var(--ht-muted); cursor: pointer; min-height: 32px; }
.ht-sort button[aria-pressed="true"] { background: var(--ht-bubble); color: #fff; }

/* ── Stars ─────────────────────────────────────────────────────────────── */
.ht-stars { color: var(--ht-star); letter-spacing: 1px; font-size: 13px; white-space: nowrap; }
.ht-stars .off { color: #4a5568; }
.ht-starpick { display: inline-flex; align-items: center; gap: 2px; }
.ht-starpick button { border: 0; background: transparent; padding: 2px 3px; font-size: 22px; line-height: 1; color: #4a5568; cursor: pointer; min-width: 32px; min-height: 36px; }
.ht-starpick button.on { color: var(--ht-star); }
.ht-starpick button:focus-visible { outline: 2px solid var(--ht-accent); border-radius: 6px; }
.ht-starpick-label { font-size: 13px; color: var(--ht-muted); margin-right: 6px; }
.ht-starpick-clear { font-size: 12.5px !important; color: var(--ht-muted) !important; min-width: 0 !important; }

/* ── Avatars ───────────────────────────────────────────────────────────── */
.ht-av { flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: #2a3442; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #c9d1dc; }
.ht-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ht-replies .ht-av, .ht-compose-reply .ht-av { width: 28px; height: 28px; font-size: 11px; }
.ht-av-gone { background: #222a35; color: var(--ht-faint); }

/* ── Composer ──────────────────────────────────────────────────────────── */
.ht-compose { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; }
.ht-compose-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ht-compose textarea {
  width: 100%; resize: none; overflow: hidden; min-height: 42px; max-height: 260px;
  font: inherit; font-size: 15px; color: var(--ht-ink); background: var(--ht-bubble);
  border: 1px solid transparent; border-radius: 20px; padding: 9px 15px;
}
.ht-compose textarea:focus { outline: none; border-color: rgba(59, 118, 240, .7); background: #1c2431; }
.ht-compose textarea::placeholder { color: var(--ht-faint); }
/* the box and its Post / Reply button on one row (John, 2026-10-15) */
.ht-compose-row { display: flex; align-items: flex-end; gap: 8px; }
.ht-compose-row textarea { flex: 1 1 auto; min-width: 0; }
.ht-compose-row > .ht-btn { flex: none; min-height: 42px; border-radius: 21px; padding-left: 18px; padding-right: 18px; }
.ht-compose-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ht-compose-bar[hidden] { display: none; }
.ht-compose-bar .ht-spacer { flex: 1 1 auto; }
.ht-compose-hint { font-size: 13px; color: var(--ht-muted); }
.ht-compose-hint.err { color: #ff8a96; }
.ht-btn {
  border: 0; border-radius: 10px; padding: 6px 14px; min-height: 36px; font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--ht-accent); color: #fff !important; display: inline-flex; align-items: center; gap: 6px;
}
.ht-btn:disabled { opacity: .45; cursor: default; }
.ht-btn-ghost { background: transparent; color: var(--ht-ink-2) !important; border: 1px solid var(--ht-line-2); }
.ht-btn-danger { background: #c9384a; }
.ht-guest { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 10px 14px; border: 1px dashed var(--ht-line-2); border-radius: 12px; color: var(--ht-muted); font-size: 14px; }
.ht-closed { color: var(--ht-muted); font-size: 14px; margin: 0 0 12px; }
.ht-compose-reply { margin: 6px 0 4px; padding-left: 16px; }
.ht-replying { font-size: 12.5px; color: var(--ht-muted); display: flex; align-items: center; gap: 6px; }
.ht-replying button { border: 0; background: transparent; color: var(--ht-muted); cursor: pointer; padding: 0 4px; font-size: 16px; line-height: 1; min-height: 24px; }

/* ── Comments ──────────────────────────────────────────────────────────── */
.ht-list, .ht-replies { list-style: none; margin: 0; padding: 0; }
.ht-c { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 12px; }
.ht-replies .ht-c { margin: 8px 0 0; }
.ht-c-main { flex: 1 1 auto; min-width: 0; }
.ht-bubble { display: inline-block; max-width: 100%; background: var(--ht-bubble); border-radius: 16px; padding: 7px 13px 8px; }
.ht-own > .ht-c-main > .ht-bubble { background: var(--ht-bubble-own); }
.ht-who { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 13.5px; }
.ht-name { font-weight: 700; color: #fff !important; }
.ht-to { color: var(--ht-muted); font-size: 13px; }
.ht-to a { color: var(--ht-ink-2) !important; font-weight: 600; }
.ht-owner-tag { font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: #8db0ff; background: rgba(91, 140, 255, .14); border-radius: 6px; padding: 0 6px; }
.ht-text { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; color: var(--ht-ink); font-size: 15px; margin-top: 1px; }
.ht-text a { overflow-wrap: anywhere; }
.ht-gone > .ht-c-main > .ht-bubble { background: transparent; border: 1px dashed var(--ht-line-2); color: var(--ht-faint); font-size: 14px; }
.ht-imgs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ht-imgs a { display: block; border-radius: 10px; overflow: hidden; }
.ht-imgs img { display: block; max-width: 220px; max-height: 180px; object-fit: cover; }
.ht-meta { display: flex; align-items: center; gap: 2px 12px; flex-wrap: wrap; padding: 3px 0 0 12px; font-size: 13px; color: var(--ht-muted); }
.ht-meta button {
  border: 0; background: transparent; padding: 2px 0; min-height: 28px; font-size: 13px; font-weight: 700; color: var(--ht-muted); cursor: pointer;
}
.ht-meta button:hover { color: #fff; }
.ht-meta .ht-liked { color: var(--ht-like); }
.ht-likes { display: inline-flex; align-items: center; gap: 3px; color: var(--ht-muted); }
.ht-likes i { color: var(--ht-like); font-style: normal; }
.ht-edited { color: var(--ht-faint); }
.ht-menu-wrap { position: relative; }
.ht-menu-btn { font-size: 18px !important; line-height: 1; padding: 0 6px !important; letter-spacing: 1px; }
.ht-menu {
  position: absolute; z-index: 40; top: 26px; left: 0; min-width: 170px; padding: 6px;
  background: #1a2130; border: 1px solid #3b4a60; border-radius: 12px; box-shadow: 0 16px 36px -12px rgba(0, 0, 0, .7);
}
.ht-menu[hidden] { display: none; }
.ht-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px !important; border-radius: 8px; font-weight: 600 !important; color: var(--ht-ink) !important; min-height: 36px !important; }
.ht-menu button:hover, .ht-menu button:focus { background: #243046; outline: none; }
.ht-menu .ht-danger { color: #ff8a96 !important; }
.ht-confirm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 0 12px; font-size: 13.5px; color: var(--ht-ink-2); }
.ht-report { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 0 12px; }
.ht-report select { background: var(--ht-bubble); color: var(--ht-ink); border: 1px solid var(--ht-line-2); border-radius: 8px; padding: 5px 8px; min-height: 34px; }
.ht-edit textarea { width: 100%; min-height: 60px; resize: vertical; font: inherit; color: var(--ht-ink); background: var(--ht-bubble); border: 1px solid rgba(59, 118, 240, .7); border-radius: 12px; padding: 8px 12px; }
.ht-edit .ht-compose-bar { margin-top: 6px; }

.ht-replies { margin-left: 0; padding-left: 14px; border-left: 2px solid var(--ht-line); }
.ht-toggle { border: 0; background: transparent; color: var(--ht-ink-2); font-weight: 700; font-size: 13.5px; cursor: pointer; padding: 4px 0 2px 12px; min-height: 30px; display: flex; width: fit-content; align-items: center; gap: 6px; }
.ht-toggle:hover { color: #fff; }
.ht-toggle::before { content: ""; width: 18px; height: 1px; background: var(--ht-line-2); display: inline-block; }

.ht-more { border: 0; background: transparent; color: var(--ht-ink-2); font-weight: 700; font-size: 14px; cursor: pointer; padding: 6px 0; min-height: 34px; }
.ht-more:hover { color: #fff; }
.ht-empty { color: var(--ht-muted); font-size: 14px; padding: 4px 0 8px; }
.ht-loading { color: var(--ht-muted); font-size: 14px; padding: 6px 0; }
.ht-error { color: #ff8a96; font-size: 14px; padding: 6px 0; }

.ht-c.ht-flash > .ht-c-main > .ht-bubble { animation: htFlash 2.4s ease-out 1; }
@keyframes htFlash { 0%, 30% { box-shadow: 0 0 0 2px rgba(91, 140, 255, .9); } 100% { box-shadow: 0 0 0 2px rgba(91, 140, 255, 0); } }
.ht-c.ht-new > .ht-c-main > .ht-bubble { animation: htIn .35s ease-out 1; }
@keyframes htIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Inline (inside a feed card) ───────────────────────────────────────── */
.ht-inline { border-top: 1px solid var(--ht-line); margin-top: 10px; padding-top: 10px; }
.ht-inline .ht-compose { margin-bottom: 8px; }
.ht-inline .ht-empty { padding: 0 0 2px; }
.ht-inline .ht-av { width: 32px; height: 32px; }

@media (max-width: 640px) {
  .ht { font-size: 14.5px; }
  .ht-head { gap: 8px 10px; }
  .ht-sort { margin-left: 0; }
  .ht-replies { padding-left: 8px; }
  .ht-imgs img { max-width: 150px; max-height: 130px; }
  .ht-av { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .ht-c.ht-flash > .ht-c-main > .ht-bubble, .ht-c.ht-new > .ht-c-main > .ht-bubble { animation: none; }
}

/* photos (Signature Track pages) */
.ht-photo-btn { cursor: pointer; position: relative; }
.ht-photo-btn:focus-within { outline: 2px solid var(--ht-accent); }
.ht-photo-prev { display: flex; gap: 6px; flex-wrap: wrap; }
.ht-photo-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--ht-bubble); font-size: 12.5px; color: var(--ht-ink-2); }
.ht-photo-chip button { border: 0; background: transparent; color: var(--ht-muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px; min-height: 26px; }
