.comments-shell {
    max-width: 980px;
    margin: 34px auto 0;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(22,22,22,.94), rgba(14,14,14,.96));
    box-shadow: 0 18px 45px rgba(0,0,0,.25);
}

.comments-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.comments-kicker {
    display: inline-flex;
    margin-bottom: 5px;
    color: #ff7777;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.comments-head h2 {
    margin: 0;
    color: #fff;
    font-size: 24px;
}

.comments-count {
    color: #aaa;
    font-size: 13px;
    white-space: nowrap;
}

.comment-form,
.comment-login-box,
.comment-error-box {
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    background: rgba(255,255,255,.035);
    padding: 14px;
    margin-bottom: 18px;
}

.comment-login-box {
    color: #cfcfcf;
}

.comment-error-box {
    border-color: rgba(255, 77, 77, .45);
    background: rgba(255, 77, 77, .08);
    color: #ffb4b4;
}

.comment-form textarea,
.comment-reply-form textarea {
    width: 100%;
    resize: vertical;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 14px;
    background: #0f0f0f;
    color: #fff;
    padding: 12px 14px;
    line-height: 1.6;
    outline: none;
}

.comment-form textarea:focus,
.comment-reply-form textarea:focus {
    border-color: rgba(255, 77, 77, .62);
    box-shadow: 0 0 0 4px rgba(255, 77, 77, .08);
}

.comment-form-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 12px;
}

.comment-form-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.comment-select-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #bdbdbd;
    font-size: 12px;
    font-weight: 500;
}

.comment-select-label.compact {
    font-size: 11px;
}

.comment-select-label select {
    min-height: 36px;
    max-width: 260px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    background: #111;
    color: #fff;
    padding: 0 10px;
}

.comment-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #cfcfcf;
    font-size: 13px;
    cursor: pointer;
}

.comment-check input {
    accent-color: #ff4d4d;
}

.comment-submit {
    border: 0;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff4d4d, #d93636);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    padding: 0 14px;
    box-shadow: 0 12px 28px rgba(255, 77, 77, .16);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.comment-submit.small {
    min-height: 34px;
    padding: 0 14px;
    font-size: 15px;
}

.comment-submit:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 15px 32px rgba(255, 77, 77, .22);
}

.comments-list {
    display: grid;
    gap: 12px;
}

.comment-card {
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 18px;
    background: rgba(255,255,255,.028);
    padding: 14px;
}

.comment-reply-card {
    border-radius: 15px;
    background: rgba(255,255,255,.025);
    padding: 12px;
}

.comment-main {
    display: flex;
    gap: 12px;
}

.comment-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #241a1a;
    border: 1px solid rgba(255, 77, 77, .18);
    color: #ff9a9a;
    font-weight: 900;
    text-transform: uppercase;
    overflow: hidden;
}

.comment-avatar img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.comment-avatar span{
    display:grid;
    place-items:center;
    width:100%;
    height:100%;
}

.comment-content {
    min-width: 0;
    flex: 1;
}

.comment-topline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 7px;
}

.comment-topline strong {
    color: #fff;
    font-size: 14px;
}

.comment-topline span {
    color: #858585;
    font-size: 12px;
}

.comment-body,
.comment-spoiler p {
    margin: 0;
    color: #ddd;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.comment-spoiler {
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    background: rgba(0,0,0,.22);
    padding: 10px 12px;
}

.comment-spoiler summary {
    color: #ffb4b4;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.comment-spoiler[open] summary {
    margin-bottom: 8px;
}

.comment-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.comment-vote-form {
    display: inline-flex;
}

.comment-vote {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 999px;
    background: rgba(255,255,255,.04);
    color: #cfcfcf;
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    padding: 0 10px;
    transition: background .18s ease, transform .18s ease, border-color .18s ease, color .18s ease;
}

.comment-vote:hover,
.comment-vote.is-active {
    background: rgba(255, 77, 77, .12);
    border-color: rgba(255, 77, 77, .32);
    color: #ff8a8a;
    transform: translateY(-1px);
}

.comment-vote-down.is-active {
    background: rgba(130, 130, 130, .16);
    border-color: rgba(180, 180, 180, .25);
    color: #ddd;
}

.comment-vote.ghost {
    cursor: default;
}

.comment-reply-toggle {
    display: inline-block;
}

.comment-reply-toggle summary {
    list-style: none;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 999px;
    background: rgba(255,255,255,.035);
    color: #e7e7e7;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    padding: 7px 11px;
}

.comment-reply-toggle summary::-webkit-details-marker {
    display: none;
}

.comment-reply-form {
    margin-top: 11px;
    min-width: min(560px, 78vw);
}

.comment-replies {
    display: grid;
    gap: 10px;
    margin-top: 13px;
    padding-left: 16px;
    border-left: 2px solid rgba(255,255,255,.07);
}

.comments-empty {
    border: 1px dashed rgba(255,255,255,.14);
    border-radius: 18px;
    padding: 20px;
    color: #aaa;
    text-align: center;
}

.comments-pagination {
    margin-top: 18px;
}

@media (max-width: 700px) {
    .comments-shell {
        padding: 16px;
        border-radius: 18px;
    }

    .comments-head,
    .comment-form-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .comment-submit {
        width: 100%;
    }

    .comment-main {
        gap: 10px;
    }

    .comment-avatar {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .comment-select-label {
        align-items: flex-start;
        flex-direction: column;
        width: 100%;
    }

    .comment-select-label select,
    .comment-reply-form {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .comment-replies {
        padding-left: 10px;
    }
}

/* === Comentarios UX polish: acciones compactas + modal propio === */
.comment-card.is-deleted {
    background: rgba(255,255,255,.018);
}

.comment-deleted-box {
    border: 1px dashed rgba(255,255,255,.12);
    border-radius: 13px;
    background: rgba(0,0,0,.18);
    color: #a8a8a8;
    font-size: 13px;
    font-style: italic;
    line-height: 1.55;
    padding: 10px 12px;
}

.comment-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.comment-action-left,
.comment-action-right {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-action-right {
    justify-content: flex-end;
    margin-left: auto;
}

.comment-mini-btn {
    min-height: 34px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 8px;
    background: rgba(255,255,255,.035);
    color: #e7e7e7;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1;
    padding: 0 14px;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.comment-mini-btn:hover {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.18);
    transform: translateY(-1px);
}

.comment-mini-btn.danger {
    color: #ff8d8d;
    border-color: rgba(255, 77, 77, .18);
}

.comment-mini-btn.danger:hover {
    background: rgba(255, 77, 77, .10);
    border-color: rgba(255, 77, 77, .34);
}

.comment-reply-panel {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.06);
}

.comment-reply-panel.is-open {
    display: block;
}

.comment-reply-toggle summary {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
}

.comment-edit-box {
    margin-top: 12px;
}

.comment-edit-box > summary {
    display: none;
}

.comment-edit-form {
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    background: rgba(0,0,0,.18);
    padding: 10px;
}

.comment-form-bottom.slim {
    margin-top: 9px;
}

.comment-vote:disabled {
    opacity: .65;
    cursor: wait;
    transform: none;
}

.comment-modal-is-open {
    overflow: hidden;
}

.comment-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0,0,0,.72);
    backdrop-filter: blur(8px);
}

.comment-modal-backdrop[hidden] {
    display: none;
}

.comment-modal {
    width: min(460px, 100%);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 20px;
    background: linear-gradient(180deg, #1b1b1b, #111);
    box-shadow: 0 22px 70px rgba(0,0,0,.48);
    padding: 22px;
}

.comment-modal h3 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 21px;
}

.comment-modal p {
    margin: 0 0 16px;
    color: #cfcfcf;
    line-height: 1.55;
}

.comment-modal-reason {
    display: grid;
    gap: 8px;
    color: #cfcfcf;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 16px;
}

.comment-modal-reason textarea {
    width: 100%;
    resize: vertical;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 13px;
    background: #0f0f0f;
    color: #fff;
    padding: 11px 12px;
    outline: none;
}

.comment-modal-reason textarea:focus {
    border-color: rgba(255,77,77,.55);
    box-shadow: 0 0 0 4px rgba(255,77,77,.08);
}

.comment-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.comment-modal-cancel,
.comment-modal-danger {
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 900;
    padding: 10px 14px;
}

.comment-modal-cancel {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.comment-modal-danger {
    background: linear-gradient(135deg, #ff4d4d, #d93636);
    color: #fff;
    box-shadow: 0 12px 26px rgba(255,77,77,.18);
}

@media (max-width: 700px) {
    .comment-action-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .comment-action-right {
        justify-content: flex-start;
        margin-left: 0;
    }

    .comment-modal-actions {
        flex-direction: column-reverse;
    }

    .comment-modal-cancel,
    .comment-modal-danger {
        width: 100%;
    }
}

.comment-reply-panel .comment-reply-form {
    min-width: 0;
    width: 100%;
}

/* === Fix edición inline: se edita el mismo comentario, sin caja blanca ni bloque extraño === */
.comment-view-content[hidden],
.comment-edit-inline[hidden] {
    display: none !important;
}

.comment-edit-inline {
    margin-top: 2px;
    padding: 0;
    border: 0;
    background: transparent;
}

.comment-edit-inline textarea {
    width: 100%;
    min-height: 92px;
    resize: vertical;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    background: #0f0f0f;
    color: #fff;
    padding: 12px 14px;
    line-height: 1.6;
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.22);
}

.comment-edit-inline textarea:focus {
    border-color: rgba(255, 77, 77, .62);
    box-shadow: 0 0 0 4px rgba(255, 77, 77, .08);
}

.comment-edit-inline .comment-form-bottom.slim {
    align-items: center;
    justify-content: space-between;
    margin-top: 9px;
}

.comment-edit-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.comment-card.is-editing .comment-action-row {
    margin-top: 10px;
}

.comment-card.is-editing [data-comment-edit-open] {
    color: #ffb4b4;
    border-color: rgba(255,77,77,.30);
    background: rgba(255,77,77,.10);
}

@media (max-width: 700px) {
    .comment-edit-inline .comment-form-bottom.slim,
    .comment-edit-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .comment-edit-actions .comment-mini-btn,
    .comment-edit-actions .comment-submit {
        width: 100%;
    }
}

/* === Hilos anidados con profundidad visual controlada === */
.comment-thread-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin-top: 12px;
    border: 1px solid rgba(255, 77, 77, .22);
    border-radius: 999px;
    background: rgba(255, 77, 77, .08);
    color: #ffb4b4;
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    padding: 0 14px;
    transition: background .18s ease, border-color .18s ease, transform .18s ease, color .18s ease;
}

.comment-thread-open:hover {
    background: rgba(255, 77, 77, .14);
    border-color: rgba(255, 77, 77, .38);
    color: #fff;
    transform: translateY(-1px);
}

.comment-thread-backdrop {
    align-items: stretch;
    justify-items: center;
    overflow-y: auto;
}

.comment-thread-modal {
    width: min(920px, 100%);
    max-height: calc(100vh - 40px);
    margin: auto 0;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 22px;
    background: linear-gradient(180deg, #1a1a1a, #101010);
    box-shadow: 0 22px 70px rgba(0,0,0,.52);
    overflow: hidden;
}

.comment-thread-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.025);
}

.comment-thread-head h3 {
    margin: 0;
    color: #fff;
    font-size: 21px;
}

.comment-thread-close {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 999px;
    background: rgba(255,255,255,.05);
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    transition: background .18s ease, transform .18s ease, border-color .18s ease;
}

.comment-thread-close:hover {
    background: rgba(255,77,77,.14);
    border-color: rgba(255,77,77,.28);
    transform: rotate(4deg) scale(1.04);
}

.comment-thread-body {
    overflow-y: auto;
    padding: 18px;
}

.comment-thread-body > .comment-card {
    background: rgba(255,255,255,.025);
}

.comment-thread-body .comment-replies {
    margin-left: 0;
}

@media (max-width: 700px) {
    .comment-thread-backdrop {
        padding: 10px;
    }

    .comment-thread-modal {
        max-height: calc(100vh - 20px);
        border-radius: 18px;
    }

    .comment-thread-head {
        padding: 15px;
    }

    .comment-thread-body {
        padding: 12px;
    }

    .comment-thread-open {
        width: 100%;
    }
}

.comment-thread-subtitle {
    margin: 4px 0 0;
    color: #9ca3af;
    font-size: 12px;
    line-height: 1.45;
}

.comment-thread-loading {
    min-height: 140px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(255,255,255,.12);
    border-radius: 16px;
    background: rgba(255,255,255,.025);
    color: #bdbdbd;
    font-size: 13px;
    font-weight: 800;
}

.comment-thread-loading.is-error {
    color: #ffb4b4;
    border-color: rgba(255,77,77,.25);
    background: rgba(255,77,77,.06);
}

/* === Moderación de comentarios: restore + estado === */
.comment-deleted-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.comment-deleted-box span {
    color: #777;
    font-size: 12px;
    font-style: normal;
}

.comment-restore-form {
    display: inline-flex;
    margin: 0;
}

.comment-mini-btn.success {
    color: #9ff0c2;
    border-color: rgba(34, 197, 94, .25);
    background: rgba(34, 197, 94, .08);
}

.comment-mini-btn.success:hover {
    background: rgba(34, 197, 94, .14);
    border-color: rgba(34, 197, 94, .42);
    color: #dcffe9;
}

/* Detail view button consistency */
.comment-reply-toggle summary,
.comment-mini-btn {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    padding: 0 14px;
}

.comment-reply-toggle summary {
    border-color: rgba(255,255,255,.10);
    background: rgba(255,255,255,.035);
    color: #e7e7e7;
}

.comment-mini-btn.danger {
    font-size: 15px;
    font-weight: 700;
}
