/* Shared custom-comments UI for article and Tube singles. */

.parsid-community,
.parsid-community *,
.parsid-community *::before,
.parsid-community *::after { box-sizing: border-box; }
.parsid-community, .cc-form, .cc-wrap, .cc-list, .cc-item, .cc-right, .cc-bubble { min-width: 0; max-width: 100%; }
/* Single comments: compact vertical form and social-style comment list. */
.parsid-comments-v2 {
  display: grid;
  gap: 16px;
  padding: 0;
}

.parsid-comments-v2 > .parsid-component-heading {
  padding: 0;
  margin: 0;
}

.parsid-community {
  display: grid;
  gap: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--parsid-color-text, #f5f7fb);
}

.parsid-community :where(button, input, textarea, select) {
  font: inherit;
}

.cc-form,
.cc-wrap {
  display: grid;
  gap: 14px;
}

.cc-form {
  padding: 14px;
  border: 0;
  border-radius: 20px;
  background: var(--parsid-color-surface, #101216);
}

.cc-form-el {
  display: grid;
  gap: 10px;
}

.cc-wrap,
.cc-closed,
.cc-pending,
.no-comment {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.cc-form-heading,
.cc-header,
.cc-meta,
.cc-actions,
.cc-captcha-wrap,
.cc-submit-content {
  display: flex;
  align-items: center;
}

.cc-form-heading,
.cc-header {
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.cc-form-title {
  margin: 0;
  color: var(--parsid-color-text, #f5f7fb);
  font-size: .96rem;
  font-weight: 900;
  line-height: 1.45;
}

.cc-replying {
  gap: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(117, 227, 0, .08);
  color: var(--parsid-color-text, #f5f7fb);
  font-size: .76rem;
}

.cc-cancel-reply,
.cc-captcha-refresh,
.cc-reply,
.cc-pin-toggle,
.cc-load-more,
.cc-submit-button,
.cc-like,
.cc-dislike {
  appearance: none;
  border: 0;
  text-decoration: none;
  cursor: pointer;
}

.cc-cancel-reply,
.cc-reply,
.cc-pin-toggle,
.cc-captcha-refresh {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .055);
  color: var(--parsid-color-muted, #a8adb6);
  font-size: .74rem;
  font-weight: 800;
}

.cc-cancel-reply:hover,
.cc-reply:hover,
.cc-pin-toggle:hover,
.cc-captcha-refresh:hover {
  color: var(--parsid-color-accent, #75e300);
  background: rgba(117, 227, 0, .09);
}

.cc-comment-row {
  order: 1;
}

.cc-form-bottom {
  order: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.cc-fields-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, .9fr) minmax(240px, 1fr);
  align-items: end;
  gap: 9px;
}

.cc-row {
  display: grid;
  gap: 5px;
  margin: 0;
}

.cc-row label,
.cc-sort label {
  color: var(--parsid-color-muted, #a8adb6);
  font-size: .72rem;
  font-weight: 800;
}

.cc-row input:not([type="checkbox"]),
.cc-row textarea,
.cc-sort select {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .052);
  color: var(--parsid-color-text, #f5f7fb);
  outline: 0;
  padding: 8px 12px;
  transition: background-color .18s ease, box-shadow .18s ease;
}

.cc-row textarea {
  min-height: 72px;
  max-height: 180px;
  resize: vertical;
  line-height: 1.75;
}

.cc-row input:focus,
.cc-row textarea:focus,
.cc-sort select:focus {
  background: rgba(255, 255, 255, .073);
  box-shadow: none;
}

.cc-row input::placeholder,
.cc-row textarea::placeholder {
  color: color-mix(in srgb, var(--parsid-color-muted, #a8adb6) 68%, transparent);
}

.cc-captcha-wrap {
  display: grid;
  grid-template-columns: auto minmax(92px, 1fr) auto;
  gap: 6px;
}

.cc-captcha-challenge {
  display: grid;
  place-items: center;
  min-width: 152px;
  min-height: 48px;
  padding: 0;
  border: 1px solid var(--parsid-color-border, rgba(255,255,255,.085));
  border-radius: 12px;
  background: var(--parsid-color-surface-3, #343434);
  color: var(--parsid-color-text, #fbfbfb);
  overflow: hidden;
}

.cc-captcha-challenge.is-loading { opacity: .55; }
.parsid-numeric-captcha { display: inline-flex; align-items: center; justify-content: center; user-select: none; }
.parsid-numeric-captcha img { display: block; width: 152px; max-width: 100%; height: 48px; user-select: none; pointer-events: none; }
.cc-captcha label small { margin-inline-start: 5px; color: var(--parsid-color-muted-2, #7f8793); font-size: .65rem; font-weight: 600; }
.cc-honeypot { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }

.cc-form-actions {
  display: flex;
  justify-content: flex-start;
}

.cc-submit-button {
  min-height: 42px;
  white-space: nowrap;
  padding: 9px 16px;
  border-radius: 12px;
  background: var(--parsid-color-accent, #75e300);
  color: var(--parsid-color-accent-contrast, #081000);
  font-weight: 900;
  box-shadow: none;
}

.cc-submit-button:hover {
  background: color-mix(in srgb, var(--parsid-color-accent, #75e300) 88%, #fff);
}

.cc-submit-button:disabled {
  opacity: .7;
  cursor: wait;
}

.cc-submit-content {
  gap: 8px;
}

.cc-submit-icon {
  flex: 0 0 auto;
}

.cc-submit-icon path {
  fill: currentColor;
}

.cc-flash,
.cc-pending,
.cc-closed,
.no-comment {
  padding: 8px 0;
  color: var(--parsid-color-muted, #a8adb6);
  font-size: .86rem;
  line-height: 1.8;
}

.cc-flash.is-success,
.cc-flash.success,
.cc-pending {
  color: var(--parsid-color-accent, #75e300);
}

.cc-flash.is-error,
.cc-flash.error {
  color: #fecaca;
}

.cc-sort {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}

.cc-sort select {
  min-width: 128px;
  min-height: 36px;
  padding-block: 5px;
}

.cc-pinned,
.cc-list {
  display: grid;
  gap: 14px;
}

.cc-pinned:not(:empty) {
  margin-bottom: 14px;
}

.cc-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.cc-item.is-pending {
  opacity: .82;
}

.cc-left {
  min-width: 0;
  padding-top: 3px;
}

.cc-avatar {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--parsid-color-surface-3, #1d2026);
  color: var(--parsid-color-text, #f5f7fb);
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}

.cc-avatar--initial {
  flex: 0 0 auto;
}

.cc-right {
  display: grid;
  gap: 10px;
  min-width: 0;
}

/*
 * Every comment owns one message bubble. Replies stay outside the parent's
 * bubble so threaded discussions keep the Reddit-style hierarchy while each
 * individual message keeps the compact Telegram-style speech shape.
 */
.cc-bubble {
  --cc-bubble-bg: rgba(255, 255, 255, .047);
  position: relative;
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px 12px 9px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 18px 7px 18px 18px;
  background: var(--cc-bubble-bg);
}

.cc-bubble::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: 13px;
  inset-inline-start: -7px;
  width: 8px;
  height: 14px;
  background: var(--cc-bubble-bg);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  pointer-events: none;
}

html[dir='ltr'] .cc-bubble {
  border-radius: 7px 18px 18px 18px;
}

html[dir='ltr'] .cc-bubble::before {
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

.cc-item.is-pinned > .cc-right > .cc-bubble,
.cc-pinned > .cc-item > .cc-right > .cc-bubble {
  --cc-bubble-bg: rgba(117, 227, 0, .065);
  border-color: rgba(117, 227, 0, .17);
}

.cc-item.is-pending > .cc-right > .cc-bubble {
  border-style: dashed;
  border-color: rgba(255, 255, 255, .11);
}

.cc-meta {
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 22px;
  line-height: 1.7;
}

.cc-author {
  color: var(--parsid-color-text, #f5f7fb);
  font-size: .9rem;
  font-weight: 900;
}

.cc-member-mark {
  display: inline-grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--parsid-color-accent, #75e300);
  line-height: 1;
}

.cc-member-mark svg {
  width: 17px;
  height: 17px;
}

.cc-date {
  margin-inline-start: auto;
  color: color-mix(in srgb, var(--parsid-color-muted, #a8adb6) 72%, transparent);
  font-size: .69rem;
  font-weight: 700;
  white-space: nowrap;
}

.cc-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 900;
}

.cc-badge-admin {
  background: var(--parsid-color-surface-3, #1d2026);
  color: #bfdbfe;
}

.cc-badge-pin {
  background: var(--parsid-color-surface-3, #1d2026);
  color: #fde68a;
}

.cc-badge-pending {
  background: var(--parsid-color-surface-3, #1d2026);
  color: #fed7aa;
}

.cc-body {
  position: relative;
  z-index: 1;
  color: var(--parsid-color-text, #f5f7fb);
  font-size: .9rem;
  line-height: 1.95;
  overflow-wrap: anywhere;
}

.cc-body p {
  margin: 0;
}

.cc-body a {
  color: var(--parsid-color-accent, #75e300);
  text-decoration: none;
}

.cc-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, .055);
}

.cc-like,
.cc-dislike {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  color: var(--parsid-color-muted, #a8adb6);
  font-size: .74rem;
  font-weight: 900;
}

.cc-actions .cc-reply,
.cc-actions .cc-pin-toggle {
  min-height: 28px;
  padding-block: 4px;
  background: transparent;
}

.cc-like:hover,
.cc-like.active {
  color: var(--parsid-color-accent, #75e300);
  background: rgba(117, 227, 0, .09);
}

.cc-dislike:hover,
.cc-dislike.active {
  color: #fca5a5;
  background: rgba(252, 165, 165, .07);
}

.cc-svg {
  width: 15px;
  height: 15px;
}

/* Reddit-like thread rail, with each reply keeping its own independent bubble. */
.cc-children {
  display: grid;
  gap: 10px;
  margin-top: 1px;
  padding-inline-start: 14px;
  border-inline-start: 2px solid rgba(255, 255, 255, .075);
}

.cc-children .cc-item {
  grid-template-columns: 34px minmax(0, 1fr);
  padding: 0;
  background: transparent;
}

.cc-children .cc-avatar {
  width: 32px;
  height: 32px;
}

.cc-children .cc-bubble {
  padding: 9px 11px 8px;
  border-radius: 16px 6px 16px 16px;
}

.cc-children .cc-bubble::before {
  top: 12px;
}

.cc-load-more {
  justify-self: center;
  min-height: 38px;
  margin-top: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: var(--parsid-color-text, #f5f7fb);
  font-weight: 900;
}

.cc-load-more:hover {
  background: rgba(117, 227, 0, .09);
  color: var(--parsid-color-accent, #75e300);
}

@media (max-width: 980px) {
  .cc-form-bottom {
    grid-template-columns: 1fr;
  }

  .cc-fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cc-captcha {
    grid-column: 1 / -1;
  }

  .cc-form-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .cc-form {
    padding: 12px;
    border-radius: 18px;
  }

  .cc-form-heading,
  .cc-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .cc-sort {
    width: 100%;
    margin-inline-start: 0;
    justify-content: space-between;
  }

  .cc-sort select {
    flex: 1 1 auto;
  }

  .cc-fields-grid {
    grid-template-columns: 1fr;
  }

  .cc-captcha-wrap {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .cc-item {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
  }

  .cc-avatar {
    width: 32px;
    height: 32px;
  }

  .cc-bubble {
    padding: 9px 10px 8px;
    border-radius: 16px 6px 16px 16px;
  }

  .cc-bubble::before {
    top: 12px;
  }

  .cc-date {
    width: 100%;
    margin-inline-start: 0;
  }

  .cc-children {
    padding-inline-start: 10px;
  }

  .cc-children .cc-item {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 7px;
  }

  .cc-children .cc-avatar {
    width: 28px;
    height: 28px;
  }

  .cc-actions {
    gap: 5px;
  }
}

@media (max-width: 420px) {
  .parsid-store-specs {
    grid-template-columns: 1fr;
  }
}
