/* YouTube-style comment threads on the watch page. Uses the site's theme variables. */
.watch-page #comments #comment-form { margin: 14px 0 6px !important; }
.watch-page #comments .comment-log.ytc-list {
  max-height: none; overflow: visible; border: 0; background: none; padding: 0; margin-top: 18px; font-size: 14px;
}
.watch-page .ytc-thread { padding: 0 0 18px; }
.watch-page .ytc { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; border: 0; padding: 0; }
.watch-page .ytc.ytc-reply { grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding-top: 14px; }
.watch-page .ytc-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: hsl(var(--ytc-hue, 205) 42% 38%); color: #fff; font-weight: 600; font-size: 16px; line-height: 1; user-select: none;
}
.watch-page .ytc-avatar.small { width: 28px; height: 28px; font-size: 12px; }
.watch-page .ytc-deleted .ytc-avatar { background: var(--line); }
.watch-page .ytc-main { min-width: 0; }
.watch-page .ytc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-bottom: 3px; }
.watch-page .ytc-name { color: var(--text); font-weight: 600; font-size: 13px; }
.watch-page .ytc-time { color: var(--muted); font-size: 12px; }
.watch-page .ytc-text {
  margin: 0; color: var(--text); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden;
}
.watch-page .ytc-text.expanded { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; }
.watch-page .ytc-deleted .ytc-text { color: var(--muted); font-style: italic; padding-top: 10px; }
.watch-page .ytc-mention { color: var(--accent-text); font-weight: 500; }
.watch-page .ytc-more {
  background: none; border: 0; padding: 4px 0 0; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.watch-page .ytc-more:hover { color: var(--text); }
.watch-page .ytc-actions { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0 -10px; }
.watch-page .ytc-act {
  background: none; border: 0; border-radius: 999px; padding: 6px 10px; min-height: 32px; display: inline-flex; align-items: center;
  color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.watch-page .ytc-act:hover, .watch-page .ytc-act:focus-visible { background: var(--line); color: var(--text); text-decoration: none; }
.watch-page .ytc-act.ytc-reply-btn { color: var(--text); }
.watch-page .ytc-thread-tail { margin-left: 54px; }
.watch-page .ytc-toggle {
  display: inline-flex; align-items: center; gap: 8px; margin: 6px 0 0 -12px; padding: 8px 14px; min-height: 36px;
  background: none; border: 0; border-radius: 999px; color: var(--accent-text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.watch-page .ytc-toggle:hover, .watch-page .ytc-toggle:focus-visible { background: color-mix(in srgb, var(--accent-text) 14%, transparent); }
.watch-page .ytc-caret { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; transition: transform .2s ease; }
.watch-page .ytc-toggle[aria-expanded="true"] .ytc-caret { transform: rotate(180deg); }
.watch-page .ytc-replies { padding-bottom: 2px; }
.watch-page .ytc-compose { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; margin: 12px 0 4px; }
.watch-page .ytc-compose-input {
  width: 100%; min-height: 28px; resize: none; overflow: hidden; background: transparent; color: var(--text); font: inherit; font-size: 14px;
  border: 0; border-bottom: 1px solid var(--line); padding: 4px 0 6px; outline: none; transition: border-color .2s ease;
}
.watch-page .ytc-compose-input:focus { border-bottom: 2px solid var(--text); padding-bottom: 5px; }
.watch-page .ytc-compose-hint { margin: 6px 0 0; }
.watch-page .ytc-compose-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.watch-page .ytc-btn {
  border: 0; border-radius: 999px; padding: 0 16px; min-height: 36px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.watch-page .ytc-btn.ghost { background: none; color: var(--text); }
.watch-page .ytc-btn.ghost:hover { background: var(--line); }
.watch-page .ytc-btn.primary { background: var(--accent); color: #fff; }
.watch-page .ytc-btn.primary:disabled { background: var(--line); color: var(--muted); cursor: default; }
.watch-page #comment-log.ytc-list .empty { color: var(--muted); padding: 8px 0; }
@media (max-width: 719px) {
  .watch-page .ytc { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
  .watch-page .ytc-avatar { width: 32px; height: 32px; font-size: 14px; }
  .watch-page .ytc.ytc-reply { grid-template-columns: 24px minmax(0, 1fr); }
  .watch-page .ytc-avatar.small { width: 24px; height: 24px; font-size: 11px; }
  .watch-page .ytc-thread-tail { margin-left: 44px; }
  .watch-page .ytc-compose { grid-template-columns: 24px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .watch-page .ytc-caret, .watch-page .ytc-compose-input { transition: none; } }
/* The top composer matches the reply box: an underlined field with a pill button. */
.watch-page #comments #comment-form.comment-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; border: 0; border-radius: 0; background: none; padding: 0;
}
.watch-page #comments #comment-input {
  flex: 1 1 100%; min-height: 30px; resize: none; background: transparent; color: var(--text); font: inherit; font-size: 14px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 4px 0 6px; outline: none; box-shadow: none;
}
.watch-page #comments #comment-input:focus { border-bottom: 2px solid var(--text); padding-bottom: 5px; }
.watch-page #comments #comment-form .btn {
  margin-left: auto; min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600;
}
.watch-page #comments #comment-form .btn:disabled { background: var(--line); color: var(--muted); }
/* Emoji picker beside the comment and reply boxes. */
.watch-page #comments .ytc-emoji-btn {
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; font-size: 20px; line-height: 1;
  display: inline-grid; place-items: center; cursor: pointer; filter: grayscale(.25);
}
.watch-page #comments .ytc-emoji-btn:hover, .watch-page #comments .ytc-emoji-btn[aria-expanded="true"] { background: var(--line); filter: none; }
.watch-page #comments #comment-form, .watch-page #comments .ytc-compose-actions { position: relative; }
.watch-page #comments .ytc-emoji-slot { margin-right: auto; }
.watch-page #comments .ytc-emoji-panel {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: min(320px, 86vw);
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}
html[data-theme="light"] .watch-page #comments .ytc-emoji-panel { background: var(--ui-surface, #f4f5f7); box-shadow: 0 12px 32px rgba(20, 30, 40, .18); }
.watch-page #comments .ytc-emoji-panel button {
  aspect-ratio: 1; border: 0; border-radius: 8px; background: none; font-size: 20px; line-height: 1; cursor: pointer; padding: 0;
}
.watch-page #comments .ytc-emoji-panel button:hover, .watch-page #comments .ytc-emoji-panel button:focus-visible { background: var(--line); outline: none; }
/* r3: a framed composer. The field, emoji button and send button sit in one box, for comments and replies alike. */
.watch-page #comments #comment-form.comment-bar,
.watch-page #comments .ytc-compose-main {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 8px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.watch-page #comments #comment-form.comment-bar:focus-within,
.watch-page #comments .ytc-compose-main:focus-within { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text); }
.watch-page #comments #comment-input, .watch-page #comments #comment-input:focus,
.watch-page #comments .ytc-compose-input, .watch-page #comments .ytc-compose-input:focus {
  border: 0; padding: 2px 0 6px; min-height: 44px; line-height: 1.5;
}
.watch-page #comments #comment-form .ytc-emoji-btn,
.watch-page #comments .ytc-compose-actions .ytc-emoji-btn { margin-left: -6px; }
.watch-page #comments .ytc-compose-actions { align-items: center; margin-top: 2px; }
.watch-page #comments .ytc-compose .ytc-avatar { margin-top: 10px; }
.watch-page #comments .ytc-compose-hint { margin: 0 0 4px; }
@media (prefers-reduced-motion: reduce) {
  .watch-page #comments #comment-form.comment-bar, .watch-page #comments .ytc-compose-main { transition: none; }
}
/* r5: an uploaded profile photo fills the avatar circle. */
.watch-page .ytc-avatar.photo { background: var(--line); overflow: hidden; }
.watch-page .ytc-avatar.photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
/* A comment opened from a notification. */
.watch-page .ytc.ytc-focus { border-radius: 10px; background: rgba(67, 185, 168, .16); box-shadow: 0 0 0 6px rgba(67, 185, 168, .16); transition: background .6s ease, box-shadow .6s ease; }
/* r7: @mention suggestions under the comment and reply boxes. */
.watch-page #comments .ytc-compose { position: relative; }
.watch-page #comments .ytc-mention-panel {
  position: absolute; z-index: 31; top: calc(100% + 6px); left: 0; width: min(300px, 86vw); max-height: 264px; overflow-y: auto;
  padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}
html[data-theme="light"] .watch-page #comments .ytc-mention-panel { background: var(--ui-surface, #f4f5f7); box-shadow: 0 12px 32px rgba(20, 30, 40, .18); }
.watch-page #comments .ytc-mention-opt {
  display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 8px; cursor: pointer;
  color: var(--text); font-size: 14px; line-height: 1.3; overflow: hidden;
}
.watch-page #comments .ytc-mention-opt span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-page #comments .ytc-mention-opt[aria-selected="true"], .watch-page #comments .ytc-mention-opt:hover { background: var(--line); }
/* r8: why someone is suggested, the bare-@ hint and the five-person note. */
.watch-page #comments .ytc-mention-opt .ytc-mention-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-page #comments .ytc-mention-opt .ytc-mention-why { margin-left: auto; padding-left: 8px; flex: none; color: var(--muted); font-size: 12px; }
.watch-page #comments .ytc-mention-hint { padding: 7px 9px 3px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); margin-top: 4px; }
.watch-page #comments .ytc-mention-limit { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.watch-page #comments .ytc-mention-limit[hidden] { display: none; }
/* r9: pinned comment label. */
.watch-page .ytc-pinned { display: inline-flex; align-items: center; gap: 4px; margin-right: 2px; color: var(--muted); font-size: 12px; font-weight: 500; }
.watch-page .ytc-pinned::before { content: ""; width: 10px; height: 10px; background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16 3l5 5-3 1-4 4 1 5-2 2-4-4-5 5-1-1 5-5-4-4 2-2 5 1 4-4z"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16 3l5 5-3 1-4 4 1 5-2 2-4-4-5 5-1-1 5-5-4-4 2-2 5 1 4-4z"/></svg>') center / contain no-repeat; }
/* r10: timestamps in comments jump the film. */
.watch-page .ytc-time { display: inline; padding: 0; margin: 0; border: 0; background: none; font: inherit; color: var(--accent-text, #7fc4ea);
  cursor: pointer; text-decoration: none; border-radius: 3px; }
.watch-page .ytc-time:hover { text-decoration: underline; }
.watch-page .ytc-time:focus-visible { outline: 2px solid #43b9a8; outline-offset: 1px; }
