.respond {
    position: relative;
}

#comments > .respond > #response {
    margin: 0 0 16px;
    color: #252b35;
    font-size: 20px;
    line-height: 1.35;
}

.comment-discussion {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid rgba(38, 48, 61, .11);
}

.comment-discussion__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
}

.comment-discussion__header h3 {
    margin: 0;
    color: #303742;
    font-size: 17px;
    line-height: 1.4;
}

.comment-discussion__empty {
    margin: 0;
    padding: 18px 0 8px;
    color: #77808d;
    font-size: 14px;
}

.comment-discussion > .comment-list > li:first-child {
    margin-top: 0;
}

.comment-closed {
    padding: 4px 0;
}

.comment-closed h3 {
    margin: 0;
    font-size: 17px;
}

.comment-submit-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 38px;
}

#comment-form .submit {
    min-width: 132px;
}

#comment-form .submit[aria-busy="true"] {
    position: relative;
    padding-left: 34px;
}

#comment-form .submit[aria-busy="true"]::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 12px;
    height: 12px;
    margin-top: -7px;
    border: 2px solid rgba(255, 255, 255, .42);
    border-top-color: #fff;
    border-radius: 50%;
    animation: comment-submit-spin .7s linear infinite;
}

.comment-submit-status {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 10050;
    width: max-content;
    max-width: min(420px, calc(100vw - 32px));
    padding: 10px 14px;
    border: 1px solid #d8e1e8;
    border-radius: 6px;
    background: #f7f9fa;
    box-shadow: 0 7px 20px rgba(38, 52, 64, .1);
    color: #384653;
    font-size: 13px;
    line-height: 1.45;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 7px);
    transition: opacity 160ms ease, transform 200ms ease;
}

.comment-submit-status.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.comment-submit-status.is-success {
    border-color: #bfe3cd;
    background: #f0faf4;
    color: #286746;
}

.comment-submit-status.is-error {
    border-color: #efcaca;
    background: #fff5f5;
    color: #a33f3f;
}

.comment-just-published {
    animation: comment-arrive 1.4s cubic-bezier(.2, .8, .2, 1);
}

.comment-local-content {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.comment-local-avatar {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(64, 72, 84, .12);
    border-radius: 50%;
    background: #eef1f5;
    color: #596371;
    font-size: 13px;
    font-weight: 700;
}

.comment-is-removing {
    pointer-events: none;
    animation: comment-remove 260ms cubic-bezier(.4, 0, 1, 1) forwards;
    transform-origin: top center;
}

.comment-delete-dialog {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.comment-delete-dialog.is-open {
    opacity: 1;
    visibility: visible;
}

.comment-delete-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 24, 31, .36);
    backdrop-filter: blur(3px);
}

.comment-delete-dialog__panel {
    position: relative;
    width: min(100%, 380px);
    padding: 22px;
    border: 1px solid rgba(38, 48, 61, .12);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(20, 28, 39, .2);
    transform: translateY(10px) scale(.98);
    transition: transform 220ms cubic-bezier(.2, .8, .2, 1);
}

.comment-delete-dialog.is-open .comment-delete-dialog__panel {
    transform: translateY(0) scale(1);
}

.comment-delete-dialog__panel h3 {
    margin: 0 0 8px;
    color: #252b35;
    font-size: 18px;
    line-height: 1.35;
}

.comment-delete-dialog__panel p {
    margin: 0;
    color: #68717d;
    font-size: 14px;
    line-height: 1.55;
}

.comment-delete-dialog__error {
    min-height: 20px;
    margin-top: 8px;
    color: #b44545;
    font-size: 13px;
}

.comment-delete-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.comment-delete-dialog__cancel,
.comment-delete-dialog__confirm {
    min-width: 86px;
}

.comment-delete-dialog__cancel {
    border: 1px solid #dce1e8;
    background: #fff;
    color: #4f5967;
}

.comment-delete-dialog__cancel:hover {
    border-color: #cbd2dc;
    background: #f5f7f9;
}

.comment-delete-dialog__confirm,
.comment-delete-dialog__confirm:hover {
    background: #b7443e;
    color: #fff;
}

@keyframes comment-submit-spin {
    to { transform: rotate(360deg); }
}

@keyframes comment-arrive {
    0% {
        opacity: .28;
        transform: translateY(10px);
        box-shadow: 0 0 0 3px rgba(64, 158, 255, .16);
    }
    45% {
        opacity: 1;
        transform: translateY(0);
        box-shadow: 0 0 0 3px rgba(64, 158, 255, .1);
    }
    100% {
        box-shadow: none;
    }
}

@keyframes comment-remove {
    to {
        opacity: 0;
        transform: translateY(-6px) scale(.985);
    }
}

html[data-theme="dark"] .comment-submit-status {
    border-color: #3a4650;
    background: #252d34;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .24);
    color: #dce3e8;
}

html[data-theme="dark"] .comment-submit-status.is-success {
    border-color: #35684d;
    background: #1d3528;
    color: #bde4cc;
}

html[data-theme="dark"] .comment-submit-status.is-error {
    border-color: #734545;
    background: #3b2527;
    color: #f0c3c3;
}

html[data-theme="dark"] #comments > .respond > #response,
html[data-theme="dark"] .comment-discussion__header h3,
html[data-theme="dark"] .comment-closed h3 {
    color: #edf1f6;
}

html[data-theme="dark"] .comment-discussion {
    border-top-color: rgba(255, 255, 255, .1);
}

html[data-theme="dark"] .comment-discussion__empty {
    color: #98a2b0;
}

html[data-theme="dark"] .comment-local-avatar {
    border-color: rgba(255, 255, 255, .1);
    background: #252b35;
    color: #c9d0da;
}

html[data-theme="dark"] .comment-delete-dialog__backdrop {
    background: rgba(0, 0, 0, .58);
}

html[data-theme="dark"] .comment-delete-dialog__panel {
    border-color: rgba(255, 255, 255, .1);
    background: #171b22;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .46);
}

html[data-theme="dark"] .comment-delete-dialog__panel h3 {
    color: #edf1f6;
}

html[data-theme="dark"] .comment-delete-dialog__panel p {
    color: #a8b0bc;
}

html[data-theme="dark"] .comment-delete-dialog__cancel {
    border-color: #353c47;
    background: #20252d;
    color: #d4dae3;
}

@media (max-width: 640px) {
    .comment-discussion {
        margin-top: 24px;
        padding-top: 20px;
    }

    #comments > .respond > #response {
        font-size: 18px;
    }

    .comment-submit-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    #comment-form .submit {
        width: 100%;
    }

    .comment-submit-status {
        bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    .comment-just-published {
        animation: none;
    }

    .comment-submit-status {
        transition: none;
    }
}
