#commentSection [hidden],
.hdc-likers-dialog [hidden],
.hdc-likers-dialog:not([open]) {
    display: none !important;
}

#commentSection .comment-item.hdc-comment-thread {
    --reply-indent: 2.25rem;
    padding: 0 !important;
    min-height: 0;
    margin: .8rem 0 0;
    border: 0;
    background: transparent !important;
    overflow: visible !important;
}

.comment-section-box .hdc-comment-thread > .hdc-comment-card {
    --comment-avatar-size: 2.15rem;
    --comment-avatar-offset: .65rem;
    --comment-avatar-gap: .65rem;
    position: relative;
    min-height: calc(var(--comment-avatar-size) + 1.35rem);
    padding: .7rem .85rem .65rem calc(var(--comment-avatar-offset) + var(--comment-avatar-size) + var(--comment-avatar-gap)) !important;
    border: 1px solid #49413c !important;
    border-radius: .6rem;
    background: #252527;
    overflow: visible !important;
}

.comment-section-box .hdc-comment-thread > .hdc-comment-framed {
    --comment-avatar-size: 3.15rem;
}

.comment-section-box .hdc-comment-thread > .hdc-comment-pinned {
    border-left: 3px solid #e69460 !important;
    background: #292421;
}

.comment-section-box .hdc-comment-pinned > .comment-pin-label {
    display: flex;
    gap: .35rem;
    align-items: center;
    margin: 0 0 .2rem;
    color: #e69460;
}

#commentSection .hdc-comment-card .comment-avatar-wrap {
    top: .7rem !important;
    left: var(--comment-avatar-offset) !important;
    width: var(--comment-avatar-size) !important;
    height: var(--comment-avatar-size) !important;
}

#commentSection .hdc-comment-card .comment-avatar-wrap.has-frame img {
    width: calc(100% - 14px) !important;
    height: calc(100% - 14px) !important;
}

.comment-section-box .hdc-comment-card > .comment-head,
.comment-section-box .hdc-comment-card .comment-reply-head {
    margin: 0;
}

.comment-section-box .hdc-comment-card .comment-head-main {
    display: flex;
    align-items: center;
    flex-wrap: wrap !important;
    gap: .15rem .45rem;
}

.comment-section-box .hdc-comment-card .comment-head-main > .comment-time,
.comment-section-box .hdc-comment-card .comment-head-main > .comment-episode-label {
    display: block !important;
    flex: 0 0 auto;
    margin: 0 !important;
}

.comment-section-box .hdc-comment-thread > .hdc-reply-list {
    margin: .7rem 0 0;
    padding-left: calc(var(--reply-indent) + 1px);
}

#commentSection .hdc-reply-list > .comment-reply-item.hdc-comment-thread,
.comment-section-box .hdc-reply-list > .comment-reply-item.hdc-comment-thread {
    margin: 0 0 .3rem !important;
    padding: 0 !important;
    border: 0 !important;
    min-height: 0 !important;
    overflow: visible !important;
}

.comment-section-box .hdc-reply-list > .comment-reply-item > .hdc-comment-card {
    --comment-avatar-size: 1.75rem;
    background: #232325;
}

.comment-section-box .hdc-reply-list > .comment-reply-item > .hdc-comment-framed {
    --comment-avatar-size: 2.85rem;
}

.comment-actions .btn-like[aria-pressed="true"] i::before {
    content: "\f164";
}

.comment-section-box .comment-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .35rem;
}

.hdc-comment-primary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
}

.comment-section-box .hdc-comment-primary .btn-reply,
.hdc-comment-options summary {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin: 0;
    padding: .2rem .55rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #303033;
    color: #dedede;
    cursor: pointer;
}

.comment-section-box .hdc-comment-primary .btn-reply {
    padding: .15rem .55rem !important;
    border: 1px solid transparent !important;
    background: #303033 !important;
    color: #dedede !important;
    white-space: nowrap;
}

.comment-section-box .hdc-comment-primary .btn-reply[aria-pressed="true"] {
    border-color: #765233 !important;
    background: #352922 !important;
    color: #e69460 !important;
}

.comment-section-box .hdc-comment-primary .btn-reply:hover {
    border-color: #765233 !important;
    color: #e69460 !important;
}

.hdc-comment-options summary:hover,
.hdc-comment-options[open] summary {
    border-color: #765233;
    color: #e69460;
}

.hdc-comment-options {
    position: relative;
    flex: 0 0 auto;
    margin-left: auto;
}

.hdc-comment-options summary {
    justify-content: center;
    min-width: 32px;
    background: transparent;
    color: #b9b1ab;
    font: bold 19px/1 sans-serif;
    list-style: none;
}

.hdc-comment-options summary::-webkit-details-marker {
    display: none;
}

.hdc-comment-options:not([open]) .hdc-comment-menu {
    display: none;
}

.hdc-comment-options[open] {
    z-index: 5;
}

.hdc-comment-menu {
    position: absolute;
    top: calc(100% + .25rem);
    right: 0;
    min-width: 10.5rem;
    max-width: calc(100vw - 2rem);
    padding: .25rem;
    border: 1px solid #494949;
    border-radius: 8px;
    background: #252527;
    box-shadow: 0 5px 16px rgb(0 0 0 / 45%);
}

.comment-section-box .hdc-comment-menu .btn-reply {
    display: flex !important;
    align-items: center;
    gap: .35rem;
    width: 100%;
    min-height: 32px;
    margin: 0;
    padding: .4rem .55rem !important;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #eee;
    text-align: left;
}

.comment-section-box .hdc-comment-menu .btn-reply:disabled {
    color: #999 !important;
    cursor: default;
}

.comment-section-box .hdc-comment-menu .btn-reply:enabled:hover {
    background: #352922 !important;
    color: #e69460 !important;
}

.comment-section-box .comment-body .hdc-member-mention {
    color: #e69460;
    font-weight: 600;
    text-decoration: none;
}

.comment-section-box .hdc-comment-thread > .hdc-reply-toggle {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    min-height: 28px;
    margin: .55rem 0 0 var(--reply-indent, 0);
    padding: .15rem .65rem !important;
    border: 1px solid #765233 !important;
    border-radius: 999px;
    background: #2c2520 !important;
    color: #e69460 !important;
    font-size: .75rem;
    line-height: 1.2;
    cursor: pointer;
}

.comment-section-box .hdc-comment-thread > .hdc-reply-toggle:hover {
    border-color: #e69460 !important;
}

.comment-section-box .hdc-comment-thread > .hdc-reply-more:not([hidden]) {
    display: block !important;
    width: calc(100% - var(--reply-indent, 0rem) - 1px);
    min-height: 42px;
    margin: .25rem 0 0 calc(var(--reply-indent, 0rem) + 1px);
    padding: .4rem .55rem !important;
    border: 1px dashed #765233 !important;
    border-radius: .35rem;
    background: #2c2520 !important;
    color: #e69460 !important;
    text-align: center;
    font-size: .75rem;
    cursor: pointer;
}

.comment-section-box .hdc-reply-more:hover,
.comment-section-box .hdc-reply-more:focus-visible {
    text-decoration: underline;
}

.hdc-likers-dialog {
    width: min(26rem, calc(100vw - 2rem));
    max-height: min(38rem, 86vh);
    position: fixed;
    inset: 0;
    margin: auto;
    padding: 0;
    border: 1px solid #494949;
    border-radius: 8px;
    background: #252527;
    color: #eee;
    overflow: auto;
    z-index: 1051;
}

.hdc-likers-dialog::backdrop {
    background: rgb(0 0 0 / 65%);
}

.hdc-likers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem 1rem;
    border-bottom: 1px solid #494949;
}

.hdc-likers-tally {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .45rem;
    margin: .75rem 1rem .25rem;
    padding: .5rem;
    border: 1px solid #765233;
    border-radius: 5px;
    background: #2c2520;
    color: #e69460;
}

.hdc-likers-tally span {
    padding: .1rem .45rem;
    border-radius: 999px;
    background: #423025;
}

.hdc-likers-dialog .hdc-likers-close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #555;
    border-radius: 5px;
    background: #303033;
    color: #eee;
    font: 22px/1 sans-serif;
    cursor: pointer;
}

.hdc-likers-dialog .hdc-likers-close:focus-visible {
    outline: 2px solid #e69460;
    outline-offset: 2px;
}

.hdc-likers-list {
    margin: .5rem 1rem;
    padding: 0;
    list-style: none;
}

.hdc-likers-list li {
    padding: .75rem .15rem;
    border-bottom: 1px solid #494949;
    overflow-wrap: anywhere;
}

.hdc-likers-status,
.hdc-likers-more {
    margin: .75rem 1rem;
}

.hdc-likers-status:empty {
    display: none;
}

.hdc-comment-sort {
    margin: 0;
}

.hdc-comment-sort-select {
    max-width: 100%;
    min-height: 32px;
    padding: 3px 8px;
    border: 1px solid #494949;
    border-radius: 4px;
    background: #252527;
    color: #eee;
    color-scheme: dark;
    font: inherit;
    cursor: pointer;
}

.hdc-comment-sort-select:focus-visible {
    outline: 2px solid #ff9601;
    outline-offset: 2px;
}

.comment-pagination-wrap .pagination {
    align-items: center;
    gap: .35rem;
    margin: 1rem 0 .35rem;
}

.comment-pagination-wrap .pagination .page-item > .page-link,
.comment-pagination-wrap .hdc-page-gap {
    display: grid;
    place-items: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    margin: 0;
    padding: .15rem .4rem;
    border: 1px solid #49413c;
    border-radius: .45rem;
    background: #252527;
    color: #e5e5e5;
    font-size: .85rem;
    line-height: 1.2;
    text-decoration: none;
}

.comment-pagination-wrap .pagination .active > .page-link {
    border-color: #e69460;
    background: #e69460;
    color: #201712;
    font-weight: 700;
}

.comment-pagination-wrap .pagination .page-item > a:hover,
.comment-pagination-wrap .pagination .page-item > a:focus-visible {
    border-color: #e69460;
    background: #352922;
    color: #ffd2b6;
}

.comment-pagination-wrap .pagination .disabled > .page-link,
.comment-pagination-wrap .hdc-page-gap {
    border-color: transparent;
    background: transparent;
    color: #a8a19b;
}

@media (max-width: 600px) {
    .comment-pagination-wrap .pagination {
        gap: .2rem;
    }

    .comment-pagination-wrap .pagination .page-item > .page-link,
    .comment-pagination-wrap .hdc-page-gap {
        min-width: 1.9rem;
        min-height: 2.25rem;
        padding-inline: .25rem;
    }

    .comment-pagination-wrap .hdc-page-gap {
        min-width: .85rem;
    }

    #commentSection .comment-item.hdc-comment-thread {
        --reply-indent: .8rem;
    }

    .comment-sort-tabs,
    .comment-actions {
        flex-wrap: wrap;
    }

    .comment-section-box .hdc-comment-primary .btn-reply,
    .hdc-comment-options summary {
        min-height: 32px;
    }

    .comment-section-box .hdc-comment-primary .btn-reply {
        padding-inline: .4rem !important;
    }

    .comment-section-box .hdc-comment-menu .btn-reply {
        min-height: 40px;
    }
}
/* Comment inline edit box: override legacy reply flex & ensure crisp readable layout */
.comment-section-box .comment-body.is-editing,
.comment-section-box .comment-item p.comment-body.is-editing,
.comment-section-box .comment-reply-item p.comment-body.is-editing {
    display: none !important;
}

.comment-section-box .hdc-comment-card > .comment-edit-box,
.comment-section-box .comment-reply-item > div:first-of-type > .comment-edit-box,
.comment-section-box .comment-edit-box {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: .45rem 0 .25rem !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.comment-section-box .comment-edit-box .comment-edit-textarea {
    display: block !important;
    width: 100% !important;
    min-height: 104px !important;
    padding: 10px 12px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.55 !important;
    color: #f4f4f5 !important;
    background: #1c1c20 !important;
    border: 1px solid #52525b !important;
    border-radius: 8px !important;
    outline: none !important;
    box-shadow: none !important;
    resize: vertical !important;
    white-space: pre-wrap !important;
}

.comment-section-box .comment-edit-box .comment-edit-textarea:focus {
    border-color: #e69460 !important;
    box-shadow: 0 0 0 2px rgba(230, 148, 96, 0.25) !important;
    outline: none !important;
}

.comment-section-box .comment-edit-box .comment-edit-actions,
.comment-section-box .comment-reply-item > div:first-of-type > .comment-edit-box > .comment-edit-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 8px 0 0 !important;
}

.comment-section-box .comment-edit-box .comment-edit-actions button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 68px !important;
    min-height: 34px !important;
    padding: 6px 14px !important;
    border: 0 !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    transition: filter .15s ease, background-color .15s ease;
}

.comment-section-box .comment-edit-box .comment-edit-save {
    background: #e69460 !important;
    color: #1a120d !important;
}

.comment-section-box .comment-edit-box .comment-edit-save:hover {
    filter: brightness(1.08);
}

.comment-section-box .comment-edit-box .comment-edit-cancel {
    background: #3f3f46 !important;
    color: #e4e4e7 !important;
}

.comment-section-box .comment-edit-box .comment-edit-cancel:hover {
    background: #52525b !important;
}
