/* Comment editor enhancements; retain the existing comment card and native form. */
.comment-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 12px; }
.comment-editor-heading .comment-reply-title { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.comment-editor-heading .comments-title { flex: 0 0 auto; margin: 0; white-space: nowrap; }
.comments-area > .comment-respond ~ .comment-list, .comment-thread-list.has-comments { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--dafa-border); }
.comment-sort { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; font-size: 12px; }
.comment-sort a { display: inline-flex; align-items: center; min-height: 36px; color: var(--dafa-text-soft); text-decoration: none; }
.comment-sort a:hover, .comment-sort a[aria-current="true"] { color: var(--dafa-accent); }
.comment-sort a[aria-current="true"] { font-weight: 600; }
.comment-sort a:focus-visible { outline: 2px solid var(--dafa-accent); outline-offset: 3px; }
.comment-thread-list > .comment-list { margin-top: 0; }
.comment-thread-list[aria-busy="true"] { opacity: .6; cursor: progress; }
.comment-sort-status { font-size: 12px; color: var(--dafa-text-soft); }
.comment-sort-status:empty { display: none; }
.comment-form .comment-form-comment textarea { display: block; }
.comment-form[data-editor-ready="1"] .comment-form-comment textarea { box-sizing: border-box; height: 108px; min-height: 108px; max-height: 360px; resize: none; }
.comment-editor-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: 4px; }
.comment-form .comment-editor-actions .form-submit { flex: 0 0 auto; margin: 0 0 0 auto; }
.comment-editor-actions .comment-editor-emoji { flex: 0 1 auto; }
.comment-editor-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-height: 28px; margin-top: 4px; }
.comment-editor-tools button,
.comment-editor-emoji button { min-height: 36px; padding: 5px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--dafa-text-soft); font: inherit; font-size: 13px; cursor: pointer; }
.comment-editor-tools button { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding-block: 4px; font-size: 12px; line-height: 20px; }
.comment-editor-tools button:hover,
.comment-editor-emoji button:hover { background: var(--dafa-bg); color: var(--dafa-text); }
.comment-editor-tools button:focus-visible,
.comment-editor-emoji button:focus-visible { outline: 2px solid var(--dafa-accent); outline-offset: 2px; }
.comment-editor-tools button:disabled { opacity: .45; cursor: default; }
.comment-editor-tools button[hidden] { display: none; }
.comment-editor-count { margin-left: auto; color: var(--dafa-text-soft); font-size: 12px; line-height: 20px; font-variant-numeric: tabular-nums; }
/* Warm, consistent picker artwork without changing the submitted emoji. */
.comment-editor-emoji { display: flex; flex-wrap: wrap; gap: 2px; padding-block: 0; }
.comment-editor-emoji[hidden] { display: none; }
.comment-editor-emoji button { --emoji-fill: #f3dba5; --emoji-ink: #826c48; --emoji-paper: #fff9ec; --emoji-accent: #cb8055; --emoji-heart: #df9c8e; display: inline-flex; align-items: center; justify-content: center; width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 8px; border-radius: 9px; line-height: 1; transition: background-color 140ms ease; }
.comment-emoji-art { display: block; flex: 0 0 auto; width: 20px; height: 20px; overflow: visible; transition: transform 140ms ease; }
.comment-editor-emoji button:focus-visible { --emoji-fill: #ffd176; --emoji-ink: #73522e; --emoji-accent: #df582f; --emoji-heart: #ef856d; background: color-mix(in srgb, var(--dafa-accent) 9%, var(--dafa-surface)); }
@media (hover: hover) {
  .comment-editor-emoji button:hover { --emoji-fill: #ffd176; --emoji-ink: #73522e; --emoji-accent: #df582f; --emoji-heart: #ef856d; background: color-mix(in srgb, var(--dafa-accent) 9%, var(--dafa-surface)); }
  .comment-editor-emoji button:hover .comment-emoji-art { transform: translateY(-1px); }
}
.comment-editor-emoji button:active .comment-emoji-art { transform: scale(.92); }
@media (pointer: coarse) {
  .comment-editor-emoji button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .comment-editor-emoji button, .comment-emoji-art { transition: none; }
  .comment-editor-emoji button:hover .comment-emoji-art, .comment-editor-emoji button:active .comment-emoji-art { transform: none; }
}
.comment-form .comment-editor-help,
.comment-form .comment-editor-status { margin: 6px 0 0; color: var(--dafa-text-soft); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.comment-form .comment-editor-tools .comment-editor-help { margin: 0; min-width: 0; line-height: 20px; color: color-mix(in srgb, var(--dafa-text-soft) 45%, var(--dafa-surface)); }
.comment-form .comment-editor-help { visibility: hidden; }
.comment-form:focus-within .comment-editor-help { visibility: visible; }
.comment-editor-status:empty { display: none; }
.comment-form[aria-busy="true"] .submit { cursor: wait; opacity: .65; }
.comment-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; margin-top: 8px; }
.comment-actions button, .comment-actions a { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 32px; padding: 0; border: 0; background: transparent; color: var(--dafa-text-soft); font: inherit; font-size: 12px; cursor: pointer; text-decoration: none; }
.comment-actions button:hover, .comment-actions a:hover, .comment-actions button[aria-pressed="true"] { color: var(--dafa-accent); }
.comment-actions button:disabled { opacity: .5; cursor: wait; }
.comment-actions .comment-vote { min-width: 28px; justify-content: center; gap: 4px; }
.comment-action-icon, .comment-vote-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.comment-vote-icon--down { transform: rotate(180deg); }
.comment-actions button:focus-visible, .comment-actions a:focus-visible, .comment-inline-controls button:focus-visible { outline: 2px solid var(--dafa-accent); outline-offset: 3px; }
.comment-actions[hidden], .comment-content[hidden] { display: none; }
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .comment-body > .comment-actions > :is([data-comment-action="edit"], [data-comment-action="delete"]) { opacity: 0; pointer-events: none; }
  .comment-body:hover > .comment-actions > :is([data-comment-action="edit"], [data-comment-action="delete"]),
  .comment-body:focus-within > .comment-actions > :is([data-comment-action="edit"], [data-comment-action="delete"]) { opacity: 1; pointer-events: auto; }
}
.comment-list .comment-action-status, .comment-list .comment-deleted-note { margin: 6px 0 0; font-size: 12px; color: var(--dafa-text-soft); }
.comment-action-status:empty { display: none; }
.comment-editor-status:not(:empty), .comment-action-status:not(:empty) { padding: 8px 12px; border-left: 2px solid var(--dafa-accent); border-radius: 4px; background: color-mix(in srgb, var(--dafa-accent) 6%, var(--dafa-surface)); color: var(--dafa-text); }
.comment-toast { position: fixed; z-index: 10000; top: calc(env(safe-area-inset-top, 0px) + 20px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; box-sizing: border-box; width: max-content; max-width: calc(100vw - 32px); padding: 10px 12px 10px 16px; border: 1px solid var(--dafa-border); border-radius: 10px; background: var(--dafa-surface); color: var(--dafa-text); box-shadow: 0 8px 28px rgb(0 0 0 / 12%); font-size: 14px; line-height: 1.5; }
.comment-toast[hidden] { display: none; }
.admin-bar .comment-toast { top: calc(env(safe-area-inset-top, 0px) + 60px); }
.comment-toast svg { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.comment-toast__icon { color: var(--dafa-accent); }
.comment-toast__message { min-width: 0; overflow-wrap: anywhere; }
.comment-toast button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--dafa-text-soft); cursor: pointer; }
.comment-toast button:hover { background: var(--dafa-bg); color: var(--dafa-text); }
.comment-toast button:focus-visible { outline: 2px solid var(--dafa-accent); outline-offset: 2px; }
.comment-inline-editor { margin-top: 12px; }
.comment-form.comment-inline-editor .comment-form-comment { margin: 0; }
.comment-inline-controls { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.comment-inline-controls [data-cancel-edit] { min-height: 44px; padding: 9px 14px; border: 0; border-radius: 6px; background: transparent; color: var(--dafa-text-soft); font: inherit; font-size: 14px; cursor: pointer; }
.comment-inline-controls [data-cancel-edit]:hover { background: var(--dafa-bg); color: var(--dafa-text); }
.comment-inline-controls button:disabled { cursor: wait; opacity: .5; }
.comment-confirm { box-sizing: border-box; width: 360px; max-width: calc(100vw - 32px); padding: 24px; border: 1px solid var(--dafa-border); border-radius: 12px; background: var(--dafa-surface); color: var(--dafa-text); box-shadow: 0 16px 48px rgb(0 0 0 / 18%); }
.comment-confirm::backdrop { background: rgb(0 0 0 / 30%); }
.comment-confirm h3 { margin: 0; font-size: 18px; }
.comment-confirm p { margin: 10px 0 20px; color: var(--dafa-text-soft); font-size: 14px; line-height: 1.6; }
.comment-confirm form { display: flex; justify-content: flex-end; gap: 10px; }
.comment-confirm button { min-height: 40px; padding: 8px 16px; border: 1px solid var(--dafa-border); border-radius: 6px; background: var(--dafa-surface); color: var(--dafa-text); font: inherit; font-size: 13px; cursor: pointer; }
.comment-confirm button[value="delete"] { background: var(--dafa-accent); border-color: var(--dafa-accent); color: #fff; }
.comment-confirm button:focus-visible { outline: 2px solid var(--dafa-accent); outline-offset: 3px; }
.comment-parent-label { display: inline; margin-left: 8px; overflow-wrap: anywhere; }
.comment-body { scroll-margin-top: 100px; }
@media (max-width: 767px) {
  .comment-sort a { min-height: 44px; }
  .comment-actions button, .comment-actions a, .comment-inline-controls button { min-height: 44px; }
  .comment-actions button, .comment-actions a { min-width: 36px; }
  .comment-editor-actions .comment-editor-emoji { flex-basis: 100%; display: grid; grid-template-columns: repeat(4, 44px); }
  .comment-editor-actions .comment-editor-emoji[hidden] { display: none; }
  .comment-editor-emoji button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .comment-editor-tools .comment-editor-help { flex-basis: 100%; order: 1; }
  .comment-list .children .children { margin-left: 0; padding-left: 0; border-left: 0; }
  .comment-confirm button { min-height: 44px; }
}
@media (max-width: 480px) {
  .comment-editor-tools { gap: 4px 8px; }
  .comment-editor-tools button { min-height: 44px; }
  .comment-editor-shortcut { display: none; }
}

.comment-safety-notice { margin: 16px 0 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--dafa-text-soft); font-size: 13px; line-height: 1.8; }
.comment-safety-notice > summary { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-height: 44px; padding: 4px 0; list-style: none; cursor: pointer; color: var(--dafa-text); }
.comment-safety-notice > summary::-webkit-details-marker { display: none; }
.comment-safety-notice__heading { font-size: 14px; font-weight: 600; }
.comment-safety-notice__overview { min-width: 0; color: var(--dafa-text-soft); font-size: 12px; }
.comment-safety-notice__chevron { flex: 0 0 auto; margin-left: auto; color: var(--dafa-text-soft); }
.comment-safety-notice[open] .comment-safety-notice__chevron { transform: rotate(180deg); }
.comment-safety-notice__body { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px 20px; margin: 8px 0 0; }
.comment-safety-notice__body dt { margin: 0; color: var(--dafa-text); font-weight: 500; }
.comment-safety-notice__body dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.comment-safety-notice > summary:hover .comment-safety-notice__heading { color: var(--dafa-accent); }
.comment-safety-notice > summary:focus-visible { outline: 2px solid var(--dafa-accent); outline-offset: 4px; border-radius: 4px; }
@media (max-width: 560px) {
  .comment-safety-notice > summary { column-gap: 8px; }
  .comment-safety-notice__overview { flex-basis: calc(100% - 24px); order: 2; }
  .comment-safety-notice__body { grid-template-columns: minmax(0, 1fr); gap: 4px; margin-top: 12px; }
  .comment-safety-notice__body dt:not(:first-child) { margin-top: 12px; }
}
/* Keep the posting time and coarse IP location together, wrapping on narrow screens. */
.comment-metadata { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.comment-metadata > a, .comment-ip-region { white-space: nowrap; }
.comment-ip-region { display: inline-flex; align-items: baseline; gap: 8px; margin: 0; color: inherit; font-size: inherit; }
.comment-ip-region::before { content: "·"; }
.comment-metadata .comment-parent-label { margin-left: 0; }
