/* Route-specific Firefly styles: comments */




/* Nebula comment port: https://github.com/jkjoy/typecho-theme-nebula */
.nebula-comments {
 --text-muted: var(--text-soft); --accent-2: #0891b2;
 --grad: linear-gradient(120deg,#7c3aed,#06b6d4 55%,#f472b6);
 --surface-strong: var(--card-solid); --shadow-border: 0 0 0 1px var(--line);
 --font-mono: Consolas, monospace;
 --comment-visitor-bubble: #fff; --comment-visitor-bubble-hover: #f8faff;
 --comment-author-bubble: #4967d8; --comment-author-bubble-hover: #3f5fce;
 margin-top: 54px; padding: 34px 20px 0; border-top: 1px solid var(--line);
 background: transparent; border-radius: 0; box-shadow: none;
}

.dark .nebula-comments { --comment-visitor-bubble:#171b26; --comment-visitor-bubble-hover:#1e2431; }

.nebula-comments ul {padding:0;list-style:none;}

.nebula-comments .comment-content {margin:0;padding:0;position:static;background:none;border:0;box-shadow:none;}

.nebula-comments .comment-content::before {content:none;}

.nebula-comments .comment-content p {margin:0 0 10px;}

.nebula-comments .comment-content p:last-child {margin-bottom:0;}

.nebula-comments .comment-list {display:block;}

.nebula-comments .comment-children {padding:0;}

.nebula-comments .sr-only {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;}

.nebula-comments .comment-list,
.nebula-comments .comment-children {
  list-style: none;
}


.nebula-comments .comment-list {
  margin-top: 28px;
}


.nebula-comments .comment-item {
  margin-top: 16px;
}


.nebula-comments .comment-list > .comment-item + .comment-item {
  margin-top: 42px;
  padding-top: 42px;
  border-top: 1px solid var(--line);
}


.nebula-comments .comment-entry {
  display: flex;
  min-width: 0;
  flex-direction: column;
}


.nebula-comments .comment-row {
  display: flex;
  align-items: center;
  gap: 12px;
}


.nebula-comments .comment-avatar {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--grad);
  font-size: 0.88rem;
  font-weight: 700;
}


.nebula-comments .comment-avatar[data-reply-tip]::before,
.nebula-comments .comment-avatar[data-reply-tip]::after {
  position: absolute;
  z-index: 3;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition-property: opacity, visibility, transform;
  transition-duration: 140ms;
  transition-timing-function: ease-out;
}


.nebula-comments .comment-avatar[data-reply-tip]::before {
  content: "";
  bottom: calc(100% + 1px);
  left: 18px;
  border: 5px solid transparent;
  border-top-color: var(--surface-strong);
}


.nebula-comments .comment-avatar[data-reply-tip]::after {
  content: attr(data-reply-tip);
  bottom: calc(100% + 10px);
  left: 0;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 6px;
  color: var(--text);
  background-color: var(--surface-strong);
  box-shadow: var(--shadow-border), 0 8px 24px rgba(0, 0, 0, 0.2);
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 20px;
  white-space: nowrap;
}


.nebula-comments .comment-item.comment-by-author > .comment-entry > .comment-row .comment-avatar[data-reply-tip]::before {
  right: 18px;
  left: auto;
}


.nebula-comments .comment-item.comment-by-author > .comment-entry > .comment-row .comment-avatar[data-reply-tip]::after {
  right: 0;
  left: auto;
}


.nebula-comments .comment-avatar img {
  position: absolute;
  inset: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
}


.nebula-comments .comment-avatar-reply {
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: 50%;
}


.nebula-comments .comment-avatar-reply:empty {
  display: none;
}


.nebula-comments .comment-avatar-reply a {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}


.nebula-comments .comment-avatar:has(.comment-avatar-reply a) {
  cursor: pointer;
  transition-property: scale, box-shadow;
  transition-duration: 160ms;
  transition-timing-function: ease-out;
}


.nebula-comments .comment-avatar:has(.comment-avatar-reply a:hover),
.nebula-comments .comment-avatar:has(.comment-avatar-reply a:focus-visible) {
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.28);
}


.nebula-comments .comment-avatar:has(.comment-avatar-reply a):hover::before,
.nebula-comments .comment-avatar:has(.comment-avatar-reply a):hover::after,
.nebula-comments .comment-avatar:has(.comment-avatar-reply a):focus-within::before,
.nebula-comments .comment-avatar:has(.comment-avatar-reply a):focus-within::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}


.nebula-comments .comment-avatar:has(.comment-avatar-reply a:active) {
  scale: 0.96;
}


.nebula-comments .comment-main {
  --comment-content-inset: 17px;
  position: relative;
  isolation: isolate;
  min-width: 0;
  margin: 10px 0 0 7px;
  padding: 15px 17px;
  width: fit-content;
  max-width: calc(100% - 7px);
  align-self: flex-start;
  border-radius: 12px;
  background-color: var(--comment-visitor-bubble);
  box-shadow: var(--shadow-border);
  transition-property: background-color, box-shadow;
  transition-duration: 160ms;
  transition-timing-function: ease-out;
}


.nebula-comments .comment-main::before {
  content: "";
  position: absolute;
  top: -10px;
  left: calc(var(--comment-content-inset) - 7px);
  width: 14px;
  height: 11px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background-color: inherit;
  pointer-events: none;
}


.nebula-comments .comment-main:hover {
  background-color: var(--comment-visitor-bubble-hover);
}


.nebula-comments .comment-item.comment-by-author > .comment-entry > .comment-row {
  flex-direction: row-reverse;
}


.nebula-comments .comment-item.comment-by-author > .comment-entry > .comment-row .comment-head {
  align-items: flex-end;
  text-align: right;
}


.nebula-comments .comment-item.comment-by-author > .comment-entry > .comment-main {
  margin-right: 7px;
  margin-left: 0;
  align-self: flex-end;
  color: #fff;
  background-color: var(--comment-author-bubble);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 8px 24px rgba(0, 0, 0, 0.12);
}


.nebula-comments .comment-item.comment-by-author > .comment-entry > .comment-main::before {
  right: calc(var(--comment-content-inset) - 7px);
  left: auto;
}


.nebula-comments .comment-item.comment-by-author > .comment-entry > .comment-main:hover {
  background-color: var(--comment-author-bubble-hover);
}


.nebula-comments .comment-item.comment-by-author > .comment-entry > .comment-main .comment-content,
.nebula-comments .comment-item.comment-by-author > .comment-entry > .comment-main .comment-content a {
  color: #fff;
}


.nebula-comments .comment-head {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: flex-start;
  flex-direction: column;
  gap: 1px;
}


.nebula-comments .comment-author-line,
.nebula-comments .comment-badges {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
}


.nebula-comments .comment-author-line {
  gap: 7px;
}


.nebula-comments .comment-badges {
  gap: 4px;
}


.nebula-comments .comment-head strong,
.nebula-comments .comment-head strong a {
  color: var(--text);
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  font-size: 0.92rem;
  -webkit-text-fill-color: transparent;
}


.nebula-comments .comment-badge {
  display:inline-flex;
  align-items:center;
  min-height:20px;
  padding:2px 7px;
  border:1px solid var(--line);
  border-radius:999px;
  color: var(--text);
  background-color: color-mix(in srgb, currentColor 10%, transparent);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}


.nebula-comments .comment-badge-author {
  color: #f472b6;
}


.nebula-comments .comment-badge-friend {
  color: #34d399;
}


.nebula-comments .comment-badge-level-2 {
  color: #22d3ee;
}


.nebula-comments .comment-badge-level-3 {
  color: #4ade80;
}


.nebula-comments .comment-badge-level-4 {
  color: #fbbf24;
}


.nebula-comments .comment-badge-level-5 {
  color: #fb7185;
}


.nebula-comments .comment-head time {
  flex: 0 0 auto;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}


.nebula-comments .comment-content {
  color: var(--text);
  font-size: 0.9rem;
}


.nebula-comments .comment-reply-to {
  margin-right: 6px;
  color: var(--accent-2);
  font-weight: 650;
  white-space: nowrap;
}


.nebula-comments .comment-reply-to + p {
  display: inline;
}


.nebula-comments .comment-item.comment-by-author > .comment-entry > .comment-main .comment-reply-to {
  color: #ffffff;
}


.nebula-comments .comment-content a {
  color: var(--accent-2);
}


.nebula-comments .comment-content img {
  height: auto;
  border-radius: 8px;
}


.nebula-comments .cancel-comment-reply a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  color: var(--text);
  font-size: 0.78rem;
}


.nebula-comments .cancel-comment-reply a:hover {
  color: var(--accent-2);
}


.nebula-comments .comment-children {
  margin-left: 62px;
}


/* Keep replies to an author comment on the same horizontal baseline. */
.nebula-comments .comment-item.comment-by-author > .comment-children {
  margin-left: -62px;
}


.nebula-comments .respond {margin-top:34px;padding:24px;border:1px solid var(--line);border-radius:12px;background:var(--card-bg);}

.nebula-comments .comments-heading h2,.nebula-comments .respond-heading h2 {margin:5px 0 0;font-size:24px;}

.nebula-comments .section-kicker {margin:0;color:#06738c;font-family:Consolas,monospace;font-size:12px;letter-spacing:0;}

.nebula-comments .comment-form {margin-top:18px;}

.nebula-comments .comment-form input,.nebula-comments .comment-form textarea {width:100%;min-width:0;border:1px solid var(--line);border-radius:8px;background:var(--card-solid);color:var(--text);padding:11px 12px;font:inherit;}

.nebula-comments .comment-form textarea {resize:vertical;}

.nebula-comments .comment-form-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
  margin-top: 14px;
}

.nebula-comments .xcaptcha-comment-slot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: min(100%, 340px);
  max-width: 340px;
  min-width: 0;
  overflow: hidden;
}

.nebula-comments .xcaptcha-comment-slot #gt-captcha,
.nebula-comments .xcaptcha-comment-slot .h-captcha,
.nebula-comments .xcaptcha-comment-slot .cf-turnstile,
.nebula-comments .xcaptcha-comment-slot .g-recaptcha {
  max-width: 100%;
  transform-origin: right center;
}

.nebula-comments .xcaptcha-comment-slot .precheck-label {
  display: none;
}

.nebula-comments .comment-form .submit:disabled,
.nebula-comments .comment-form .submit.captcha-disabled {background:#9aa3ad;color:#fff;cursor:not-allowed;opacity:.72;}

.nebula-comments .comment-form .submit:not(:disabled),
.nebula-comments .comment-form .submit.captcha-enabled {background:var(--primary);color:#fff;opacity:1;}


/* Restore the white comment form panel on the top-level response area. */
.nebula-comments > .respond {
    margin-top: 34px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card-solid);
    box-shadow: 0 12px 32px rgba(24, 31, 42, 0.08);
}


.nebula-comments > .respond .respond-heading {
    margin: 0 0 18px;
}


/* Match the article block width exactly. */
.nebula-comments {
    padding-right: 0;
    padding-left: 0;
}


.nebula-comments > .respond {
    width: 100%;
    box-sizing: border-box;
}

.nebula-comments .comment-item.comment-by-author > .comment-entry > .comment-main {
    background-color: var(--primary);
}


.nebula-comments .comment-item.comment-by-author > .comment-entry > .comment-main:hover {
    background-color: color-mix(in oklch, var(--primary) 88%, #000);
}


.nebula-comments .submit {
    background: var(--primary);
}


.nebula-comments .submit:hover {
    background: color-mix(in oklch, var(--primary) 88%, #000);
}



/* Comment ALTCHA compact sizing */
.nebula-comments .xcaptcha-comment-slot:has(altcha-widget) {
  width: min(100%, 280px);
  max-width: 280px;
  min-height: 40px;
  height: 40px;
  overflow: visible;
  align-items: center;
}

.nebula-comments .xcaptcha-comment-slot altcha-widget {
  display: block;
  width: 280px;
  max-width: 280px;
  height: 40px;
  min-height: 40px;
  --altcha-max-width: 280px;
  transform: scale(.76);
  transform-origin: right center;
  margin-right: -67px;
}

.nebula-comments .comment-form-actions .comment-form-captcha-slot {
  order: 1;
  flex: 0 0 auto;
  width: 280px;
  max-width: 100%;
  min-width: 0;
  height: 40px;
  margin: 0;
  padding: 0;
  overflow: visible;
}

.nebula-comments .comment-form-actions .comment-form-captcha-slot .xcaptcha-comment-slot {
  width: 280px;
  max-width: 100%;
  min-width: 0;
  height: 40px;
  margin: 0;
  padding: 0;
  justify-content: flex-start;
  overflow: visible;
}

.nebula-comments .comment-form-actions .comment-form-captcha-slot altcha-widget {
  display: block;
  width: 280px;
  max-width: 280px;
  height: 40px;
  min-height: 40px;
  transform: scale(.76);
  transform-origin: left top;
  margin: -4px 0 0;
  position: relative;
  top: -2px;
}

.nebula-comments .comment-form-actions > .submit {
  order: 0;
  flex: 0 0 auto;
  align-self: center;
  margin: 0;
}



/* Keep article ALTCHA label height stable across verification states. */
.nebula-comments .comment-form-actions .comment-form-captcha-slot altcha-widget .altcha-label {
  min-height: 40px;
  display: flex;
  align-items: center;
}


.nebula-comments .xcaptcha-comment-slot altcha-widget{--altcha-border-radius:16px}
