/* The discussion under a posted build (comment-thread-view.js), and the
   comment-count chip on the hub's rows and cards.

   Built from the design system's tokens only (design-system.css), so it
   follows both themes with no light rules of its own; every rule sits under
   .th. Linked by the hub pages that carry discussions (the pilot:
   /arena-teams/ and /arcade-arena/), after team-hub.css. */

/* ---- the chip beside a build's date ----------------------------------------- */
.th .th-cm-chip { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font-size: 12.5px; font-weight: 700; color: var(--th-ink-3); white-space: nowrap; }
.th .th-cm-chip[hidden] { display: none; }
.th .th-cm-chip svg { width: 14px; height: 14px; }

/* ---- the discussion ----------------------------------------------------------- */
.th .th-ob-discussion { border-top: 1px solid var(--th-line-2); }
.th .th-cm { display: grid; gap: 12px; padding: 16px 22px 20px; }
.th .th-cm-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.th .th-cm-title { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-family: "CookieRun KR", sans-serif; font-size: 17px; font-weight: 700; color: var(--th-heading); }
.th .th-cm-title svg { width: 18px; height: 18px; color: var(--th-gold); }
.th .th-cm-total { min-width: 22px; padding: 2px 7px; border-radius: 999px; font-family: "Outfit", sans-serif; font-size: 12px; line-height: 1.3; text-align: center; color: var(--th-ink-2); background: var(--th-surface-3); }
.th .th-cm-quiet, .th .th-cm-empty { margin: 0; font-size: 14px; line-height: 1.5; color: var(--th-ink-3); }
.th .th-cm-quiet a, .th .th-cm-empty a { color: var(--th-link); font-weight: 600; }

/* the composer */
.th .th-cm-compose { display: grid; gap: 8px; }
.th .th-cm-compose textarea { width: 100%; min-height: 72px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--th-line-2); background: var(--th-field-bg); color: var(--th-ink); font: 400 15px/1.45 "Outfit", sans-serif; resize: vertical; }
.th .th-cm-compose textarea::placeholder { color: var(--th-ink-3); }
.th .th-cm-compose textarea:focus-visible { outline: 3px solid var(--th-btn-focus); outline-offset: 0; border-color: transparent; }
.th .th-cm-compose-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 12px; }
.th .th-cm-count { margin-right: auto; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--th-ink-3); }
.th .th-cm-rules { font-size: 12.5px; font-weight: 600; color: var(--th-link); }
.th .th-cm-compose-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; font-weight: 600; color: var(--th-ink-3); }
.th .th-cm-compose-chip svg { width: 14px; height: 14px; }
.th .th-cm-error { margin: 0; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--th-down); font-size: 13.5px; line-height: 1.45; color: var(--th-ink); background: var(--th-field-bg); }
.th .th-cm-error a { color: var(--th-link); font-weight: 700; }

/* the list: top-level comments, each with its replies indented under it */
.th .th-cm-list, .th .th-cm-reply-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.th .th-cm-item { display: grid; gap: 8px; }
.th .th-cm-replies { display: grid; gap: 8px; margin-left: 18px; padding-left: 14px; border-left: 2px solid var(--th-line-2); }

.th .th-cm-c { display: grid; gap: 6px; padding: 12px 14px; border-radius: 16px; background: var(--th-surface-1); border: 1px solid var(--th-line); scroll-margin-top: 120px; }
.th .th-cm-c:focus { outline: none; }
.th .th-cm-c:focus-visible { outline: 3px solid var(--th-btn-focus); outline-offset: 0; }
.th .th-cm-c.is-under_review, .th .th-cm-c.is-hidden { border-style: dashed; border-color: var(--th-line-3); }
.th .th-cm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.th .th-cm-av { position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none; font-size: 12px; font-weight: 800; color: var(--th-ink-2); background: var(--th-surface-3); overflow: hidden; }
.th .th-cm-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.th .th-cm-av img.is-missing { display: none; }
.th .th-cm-name { font-size: 14px; font-weight: 700; color: var(--th-ink); overflow-wrap: anywhere; }
.th .th-cm-time { font-size: 12.5px; color: var(--th-ink-3); }
.th .th-cm-badge, .th .th-cm-pin { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; color: var(--th-ink-2); border: 1px solid var(--th-line-2); }
.th .th-cm-pin { color: var(--th-gold); border-color: var(--th-gold-line); }
.th .th-cm-pin svg { width: 12px; height: 12px; }
.th .th-cm-replyto { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-size: 12.5px; color: var(--th-ink-3); }
.th .th-cm-replyto svg { width: 13px; height: 13px; }
.th .th-cm-replyto a { color: var(--th-link); font-weight: 600; text-decoration: none; }
.th .th-cm-replyto a:hover { text-decoration: underline; }
.th .th-cm-notice { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--th-gold); }
.th .th-cm-notice.is-removed { color: var(--th-down); }
.th .th-cm-body { margin: 0; font-size: 15px; line-height: 1.5; color: var(--th-ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.th .th-cm-body.is-deleted, .th .th-cm-body.is-low { font-size: 13.5px; font-style: italic; color: var(--th-ink-3); white-space: normal; }

/* the actions row: votes, then the small text buttons */
.th .th-cm-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin-left: -6px; }
.th .th-cm-votes { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; }
.th .th-cm-vote { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 999px; background: none; color: var(--th-ink-3); cursor: pointer; }
.th .th-cm-vote svg { width: 14px; height: 14px; }
.th .th-cm-vote:hover { background: var(--th-btn-hover); color: var(--th-ink); }
.th .th-cm-vote--up[aria-pressed="true"] { color: var(--th-up); background: var(--th-btn-bg); }
.th .th-cm-vote--down[aria-pressed="true"] { color: var(--th-down); background: var(--th-btn-bg); }
.th .th-cm-score { min-width: 24px; font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; color: var(--th-ink-2); }
.th .th-cm-score.is-static { margin: 0 8px 0 6px; }
.th .th-cm-act { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 9px; border: 0; border-radius: 999px; background: none; font: 600 13px/1 "Outfit", sans-serif; color: var(--th-ink-3); cursor: pointer; }
.th .th-cm-act svg { width: 14px; height: 14px; }
.th .th-cm-act:hover { background: var(--th-btn-hover); color: var(--th-ink); }
.th .th-cm-act:disabled { cursor: default; background: none; color: var(--th-ink-3); }
.th .th-cm-act.is-armed { color: var(--th-down); background: var(--th-btn-bg); }
.th .th-cm-act.th-cm-link { min-height: 0; padding: 0; color: var(--th-link); }
.th .th-cm-act.th-cm-link:hover { background: none; text-decoration: underline; }
.th .th-cm-more { justify-self: start; color: var(--th-link); }
.th :is(.th-cm-vote, .th-cm-act):focus-visible { outline: 3px solid var(--th-btn-focus); outline-offset: 0; }

/* a comment a notice linked to (?comment=): marked until the reader moves on */
.th .th-cm-c.is-target { border-color: var(--th-gold-line); box-shadow: 0 0 0 2px var(--th-gold-line); }
.th .th-cm-mute[aria-pressed="true"] { color: var(--th-ink-2); background: var(--th-btn-bg); }

/* ---- the season discussion, below the builds ---------------------------------
   One panel in the page's width; it shares the opened build's container name
   so the narrow rules below reach it too. The earlier seasons fold under it. */
.th .th-talk { container: th-ob th-talk / inline-size; margin: 40px 0 8px; border-radius: var(--th-radius); border: 1px solid var(--th-line); background: var(--th-surface-1); scroll-margin-top: 120px; }
.th .th-talk[hidden] { display: none; }
.th .th-talk-head { display: grid; gap: 6px; padding: 20px 22px 4px; }
.th .th-talk-title { margin: 0; font-family: "CookieRun KR", sans-serif; font-size: 24px; font-weight: 700; line-height: 1.2; color: var(--th-heading); }
.th .th-talk-sub { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--th-ink-3); }
.th .th-talk .th-cm { padding-top: 12px; }
.th .th-talk-past { margin: 0 22px 20px; border-top: 1px solid var(--th-line-2); padding-top: 14px; }
.th .th-talk-past > summary, .th .th-talk-old > summary { display: flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; font-weight: 700; color: var(--th-ink-2); }
.th .th-talk-past > summary:focus-visible, .th .th-talk-old > summary:focus-visible { outline: 3px solid var(--th-btn-focus); outline-offset: 2px; border-radius: 8px; }
.th .th-talk-old-list { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.th .th-talk-old { border-radius: 12px; background: var(--th-surface-2); padding: 4px 12px; }
.th .th-talk-old > summary { font-weight: 600; }
.th .th-talk-range { font-size: 12.5px; font-weight: 500; color: var(--th-ink-3); }
.th .th-talk-old .th-cm { padding: 8px 0 12px; }

/* a phone, or a narrow opened build: less inset, replies indented less */
@container th-ob (max-width: 640px) {
  .th .th-cm { padding: 14px 12px 16px 15px; }
  .th .th-cm-replies { margin-left: 6px; padding-left: 10px; }
  .th .th-cm-c { padding: 10px 12px; }
  .th .th-cm-act { padding: 0 7px; }
}
@container th-talk (max-width: 640px) {
  .th .th-talk-head { padding: 16px 15px 2px; }
  .th .th-talk-title { font-size: 20px; }
  .th .th-talk-past { margin: 0 12px 16px 15px; }
}

@media (prefers-reduced-motion: no-preference) {
  .th .th-cm-vote, .th .th-cm-act { transition: background-color 0.15s ease, color 0.15s ease; }
}
