﻿:root {
    --c-coral: #eb6753;
    --c-coral-light: #ff8a7a;
    --c-coral-dark: #e05544;
    --c-ink: var(--headings-color, #2b2c31);
    --c-body-text: #565a63;
    --c-muted: #9aa0a8;
    --c-faint: #b7bcc4;
    --c-line: #ecedf0;
    --c-line-soft: #f3f4f6;
    --c-surface: #ffffff;
    --c-surface-2: #f8f9fb;
    --tf: var(--title-font-family, "Poppins", sans-serif);
    --bf: var(--body-font-family, "DM Sans", sans-serif);
    --panel-radius: 18px;
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.comments-section-wrap {
    padding-top: 64px;
    padding-bottom: 96px;
    background-color: var(--c-surface);
}

.comments-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 22px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--c-line);
    position: relative;
}
.comments-header::after {
    content: '';
    position: absolute;
    left: 0; bottom: -1px;
    width: 64px; height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--c-coral) 0%, var(--c-coral-light) 100%);
}
.comments-header-left { display: flex; flex-direction: column; gap: 4px; }
.comments-eyebrow {
    font-family: var(--tf);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c-coral);
}
.comments-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.comments-title-row .title,
#section-posts .title {
    font-family: var(--tf);
    font-weight: 700;
    font-size: 30px;
    color: var(--c-ink);
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.1;
}

.comments-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 28px;
    padding: 0 11px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--c-coral) 0%, var(--c-coral-light) 100%);
    color: #ffffff !important;
    font-family: var(--tf);
    font-weight: 700;
    font-size: 14px !important;
    line-height: 1;
    vertical-align: middle;
    box-shadow: 0 4px 14px rgba(235, 103, 83, 0.32);
    transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease;
}
.comments-count-badge:hover {
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 8px 20px rgba(235, 103, 83, 0.45);
}

.comments-header-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.btn-expand-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--c-surface-2);
    border: 1px solid var(--c-line);
    border-radius: 12px;
    padding: 9px 16px;
    font-family: var(--tf);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--c-muted);
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.btn-expand-all:hover {
    color: var(--c-coral);
    border-color: rgba(235, 103, 83, 0.35);
    background: rgba(235, 103, 83, 0.06);
    box-shadow: 0 6px 16px -10px rgba(235, 103, 83, 0.5);
}
.btn-expand-all i {
    font-size: 11px;
    transition: transform 0.4s var(--ease-spring);
}
.btn-expand-all.all-open i { transform: rotate(180deg); }

.page_control_shorting { gap: 0; }
.pcs_dropdown { position: relative; display: flex; align-items: center; }
.pcs_dropdown span {
    font-family: var(--tf);
    font-weight: 600; font-size: 12px; color: var(--c-muted); margin-right: 8px;
    letter-spacing: 0.01em;
}
.pcs_dropdown select.selectpicker {
    appearance: none; -webkit-appearance: none;
    background: var(--c-surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23eb6753'/%3E%3C/svg%3E") no-repeat right 14px center;
    border: 1px solid var(--c-line); border-radius: 12px;
    padding: 9px 36px 9px 16px;
    font-family: var(--tf);
    font-size: 13px; font-weight: 600; color: var(--c-ink);
    cursor: pointer; outline: none; min-width: 148px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}
.pcs_dropdown select.selectpicker:hover { border-color: #d9dce0; background-color: #f3f4f6; }
.pcs_dropdown select.selectpicker:focus {
    border-color: var(--c-coral); box-shadow: 0 0 0 4px rgba(235, 103, 83, 0.10);
}

.comment-input-area {
    --ld-orange: #EB6753;
    --ld-black: #181A20;
    --ld-charcoal: #303137;
    position: relative;
    display: flex;
    gap: 16px;
    background: linear-gradient(135deg, var(--ld-black) 0%, var(--ld-charcoal) 100%);
    border: none;
    border-radius: var(--panel-radius);
    padding: 32px;
    margin-bottom: 32px;
    overflow: hidden;
    color: #fff;
    box-shadow: 0 5px 5px rgba(16, 24, 40, 0.03), 0 10px 30px -18px rgba(16, 24, 40, 0.18);
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}
.comment-input-area:focus-within {
    box-shadow: 0 20px 50px -20px rgba(24, 26, 32, 0.55), 0 0 0 1px rgba(235, 103, 83, 0.25);
    transform: translateY(-4px);
}
.comment-input-area::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--ld-orange) 0%, transparent 70%);
    opacity: 0.25;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.6s ease, transform 0.8s ease;
}
.comment-input-area::after {
    content: '';
    position: absolute;
    bottom: -200px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--ld-orange) 0%, transparent 65%);
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.6s ease;
}
.comment-input-area:focus-within::before { opacity: 0.38; transform: scale(1.08); }
.comment-input-area:focus-within::after { opacity: 0.2; }

.comment-input-area > .comment-avatar,
.comment-input-area > .comment-form {
    position: relative;
    z-index: 2;
}

.comment-input-area > .comment-avatar,
.comment-item .comment-avatar {
    flex-shrink: 0; width: 46px; height: 46px;
    border-radius: 50%; overflow: hidden;
    background: linear-gradient(135deg, #eef0f3 0%, #dfe3e8 100%);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.08);
    position: relative;
    transition: transform 0.35s var(--ease-spring), box-shadow 0.35s ease;
}
.comment-avatar::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    pointer-events: none;
}
.comment-avatar img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
    transition: transform 0.45s ease;
}
.comment-avatar .avatar-placeholder {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; color: var(--c-faint); font-size: 18px;
}
.comment-item-inner:hover .comment-avatar {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(235, 103, 83, 0.28), 0 0 0 2px rgba(235, 103, 83, 0.35);
}
.comment-item-inner:hover .comment-avatar img { transform: scale(1.08); }
.comment-input-area > .comment-avatar {
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 100%);
}

.comment-form { flex: 1; min-width: 0; }
.comment-form .inp-hero { margin-bottom: 0; position: relative; }
.comment-form .inp-hero textarea {
    width: 100%;
    min-height: 110px;
    max-height: 280px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 4px solid var(--ld-orange);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    font-size: 15px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #ffffff;
    font-weight: 500;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    transition: border-color .25s, background-color .25s;
}
.comment-form .inp-hero label {
    position: absolute;
    left: 12px;
    top: 18px;
    transform: none;
    padding: 0 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-weight: 500;
    pointer-events: none;
    transition: .2s cubic-bezier(.4, 0, .2, 1);
}
.comment-form .inp-hero textarea:focus + label,
.comment-form .inp-hero textarea:not(:placeholder-shown) + label {
    top: -14px;
    transform: translateY(0);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--ld-orange);
    border-radius: 12px;
    background-color: var(--ld-charcoal);
}
.comment-form .inp-hero textarea:focus {
    border-color: var(--ld-orange);
    background-color: rgba(255, 255, 255, 0.07);
}

.comment-form-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 12px; flex-wrap: wrap; gap: 10px;
}
.comment-form-hint {
    font-family: var(--bf);
    font-size: 12px; color: var(--c-faint);
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.comment-form-hint .hint-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 12px;
    background: var(--c-surface-2); border: 1px solid var(--c-line);
    color: var(--c-muted); font-weight: 500;
    transition: transform 0.25s var(--ease-spring), background 0.25s ease, border-color 0.25s ease;
}
.comment-form-hint .hint-chip:hover { transform: translateY(-2px); }
.comment-form-hint .hint-chip i { font-size: 11px; color: var(--c-coral); }
.comment-input-area .comment-form-hint .hint-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
}
.comment-input-area .comment-form-hint .hint-chip:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(235, 103, 83, 0.5);
}
.comment-input-area .comment-form-hint .hint-chip i { color: var(--ld-orange); }
.comment-form-actions { display: flex; align-items: center; gap: 12px; }

.char-counter {
    font-family: var(--tf);
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.03em;
    white-space: nowrap;
    transition: color 0.25s ease;
}
.char-counter.near-limit { color: #f1c948; }
.char-counter.at-limit { color: var(--c-coral-light); }
.reply-form .char-counter { color: var(--c-faint); margin-right: auto; }
.reply-form .char-counter.near-limit { color: #d9a406; }
.reply-form .char-counter.at-limit { color: var(--c-coral); }

.comment-list { position: relative; min-height: 40px; display: flex; flex-direction: column; gap: 18px; }

.comments-loading {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 56px 20px; color: var(--c-faint);
    font-family: var(--bf); font-size: 14px; gap: 16px;
}
.comments-loading .spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--c-line); border-top-color: var(--c-coral); border-radius: 50%;
    animation: commentSpin 0.7s linear infinite;
}
@keyframes commentSpin { to { transform: rotate(360deg); } }

.comments-empty {
    text-align: center; padding: 60px 30px; color: var(--c-muted);
    opacity: 0; transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.comments-empty.anim-visible { opacity: 1; transform: translateY(0); }
.comments-empty .empty-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 76px; height: 76px; margin-bottom: 18px; border-radius: 50%;
    background: linear-gradient(135deg, rgba(235,103,83,0.10) 0%, rgba(255,138,122,0.10) 100%);
    color: var(--c-coral);
    animation: emptyFloat 3.4s ease-in-out infinite;
}
@keyframes emptyFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.comments-empty .empty-ico i { font-size: 32px; }
.comments-empty p {
    font-size: 14.5px; max-width: 380px; margin: 0 auto; line-height: 1.75; color: var(--c-muted);
}

.comment-item { position: relative; }

.comment-item[data-depth="0"] {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--panel-radius);
    padding: 22px 24px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.02);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    overflow: hidden;
    isolation: isolate;
}
.comment-item[data-depth="0"]::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: linear-gradient(135deg, var(--c-coral) 0%, rgba(255,138,122,0.35) 30%, transparent 55%, rgba(235,103,83,0.4) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}
.comment-item[data-depth="0"]::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--c-coral) 0%, var(--c-coral-light) 100%);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.4s var(--ease-spring);
    z-index: 2;
}
.comment-item[data-depth="0"]:hover {
    border-color: transparent;
    box-shadow: 0 18px 44px -24px rgba(16, 24, 40, 0.35), 0 6px 18px -12px rgba(235, 103, 83, 0.25);
    transform: translateY(-3px);
}
.comment-item[data-depth="0"]:hover::before { opacity: 1; }
.comment-item[data-depth="0"]:hover::after { transform: scaleY(1); }
.comment-item[data-depth="0"].comment-expanded {
    border-color: rgba(235, 103, 83, 0.28);
    box-shadow: 0 14px 36px -24px rgba(16, 24, 40, 0.28);
}
.comment-item[data-depth="0"].comment-expanded::after { transform: scaleY(1); }

.comment-item[data-depth="0"] > .comment-item-inner {
    display: flex;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.comment-flash {
    animation: commentFlash 1.8s ease 1;
}
@keyframes commentFlash {
    0% { box-shadow: 0 0 0 4px rgba(235, 103, 83, 0.45), 0 18px 44px -24px rgba(16, 24, 40, 0.35); }
    100% { box-shadow: 0 1px 2px rgba(16, 24, 40, 0.02); }
}

.comment-avatar-col {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.comment-pm-action { display: flex; justify-content: center; margin-top: 8px; text-align: center; }
.comment-pm-action .btn-pm {
    background: none; border: none; color: var(--c-faint); cursor: pointer;
    padding: 4px; transition: color 0.25s ease, transform 0.25s var(--ease-spring);
    font-size: 15px; line-height: 1;
}
.comment-pm-action .btn-pm:hover { color: var(--c-coral); transform: scale(1.22) rotate(-6deg); }

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

.comment-meta {
    display: flex; align-items: center; gap: 10px; margin-bottom: 7px; flex-wrap: wrap;
}
.comment-author-name {
    font-family: var(--tf);
    font-weight: 700; font-size: 14.5px; color: var(--c-ink);
    letter-spacing: -0.01em;
    position: relative;
    transition: color 0.25s ease;
}
.comment-item-inner:hover .comment-author-name { color: var(--c-coral-dark); }
.comment-timestamp {
    font-family: var(--bf);
    font-size: 12px; color: var(--c-faint); font-weight: 400;
    position: relative; padding-left: 13px;
}
.comment-timestamp::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 3px; border-radius: 50%; background: #d3d7dd;
}

.comment-text {
    font-family: var(--bf);
    font-size: 14.5px; line-height: 1.78; color: var(--c-body-text);
    word-break: break-word; margin-bottom: 12px; padding: 0;
}

.comment-text.comment-text-editable {
    background: #fffdf4; border: 1.5px solid #f1c948; border-radius: 12px;
    padding: 12px 16px; outline: none;
    box-shadow: 0 0 0 4px rgba(241, 201, 72, 0.14);
    transition: all 0.25s ease;
}

.comment-link {
    color: var(--c-coral) !important; text-decoration: underline;
    text-decoration-color: rgba(235, 103, 83, 0.35);
    text-underline-offset: 3px; word-break: break-all;
    transition: text-decoration-color 0.2s ease;
}
.comment-link:hover { text-decoration-color: var(--c-coral); }
.comment-mention {
    color: var(--c-coral); font-weight: 600;
    cursor: default;
    border-radius: 5px;
    padding: 1px 3px;
    transition: background 0.2s ease;
}
.comment-mention:hover { background: rgba(235, 103, 83, 0.1); }
.comment-hashtag {
    color: #16a34a; font-weight: 600; background: rgba(34, 197, 94, 0.10);
    padding: 1px 6px; border-radius: 5px; cursor: default;
    transition: background 0.2s ease;
}
.comment-hashtag:hover { background: rgba(34, 197, 94, 0.18); }

.comment-quote {
    background: linear-gradient(135deg, #f7f8fa 0%, #f1f2f5 100%);
    border-left: 3px solid var(--c-coral);
    border-radius: 10px;
    padding: 10px 14px;
    margin: 0 0 10px;
    font-size: 13px;
    color: #7a8089;
    display: block;
}
.comment-quote-author {
    display: block;
    font-family: var(--tf);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--c-coral);
    margin-bottom: 4px;
}
.comment-quote-author i { font-size: 10px; margin-right: 4px; }
.comment-quote-body { display: block; line-height: 1.65; }

.comment-actions {
    display: flex; align-items: center; gap: 2px; flex-wrap: wrap; margin-top: 2px;
}
.comment-action-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: none; border: none; padding: 7px 11px; border-radius: 10px;
    font-family: var(--tf);
    font-size: 13px; font-weight: 600; color: var(--c-muted); cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s var(--ease-spring), box-shadow 0.25s ease;
    line-height: 1; white-space: nowrap;
    position: relative;
}
.comment-action-btn:hover {
    background: var(--c-surface-2);
    color: var(--c-ink);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px -10px rgba(16, 24, 40, 0.35);
}
.comment-action-btn:active { transform: scale(0.94); }
.comment-action-btn i { font-size: 15px; transition: transform 0.2s ease; }
.comment-action-btn:hover i { transform: scale(1.12); }

.comment-action-btn.liked { color: var(--c-coral); background: rgba(235, 103, 83, 0.10); }
.comment-action-btn.liked i { animation: likePopComment 0.4s ease; }
@keyframes likePopComment { 0%{transform:scale(1)} 40%{transform:scale(1.35)} 70%{transform:scale(0.92)} 100%{transform:scale(1)} }

.comment-action-btn.disliked { color: #5b616b; background: rgba(91, 97, 107, 0.09); }

.action-count { font-size: 12px; font-weight: 700; min-width: 8px; }

.action-separator {
    display: inline-block; width: 3px; height: 3px; border-radius: 50%;
    background: #dde0e4; margin: 0 6px;
}

.comment-action-flag,
.comment-action-copylink {
    opacity: 0; transform: translateX(4px);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease, color 0.2s ease;
}
.comment-action-flag { margin-left: auto; }
.comment-item-inner:hover .comment-action-flag,
.comment-item-inner:hover .comment-action-copylink {
    opacity: 1; transform: translateX(0);
}
.comment-action-flag:hover { color: #ef4444 !important; background: rgba(239, 68, 68, 0.10) !important; }
.comment-action-copylink.copied { color: #16a34a !important; background: rgba(34, 197, 94, 0.1) !important; }

.show-replies-btn {
    display: inline-flex; align-items: center; gap: 9px;
    background: var(--c-surface-2); border: 1px solid var(--c-line);
    padding: 8px 15px; margin-top: 12px;
    border-radius: 12px;
    font-family: var(--tf);
    font-size: 12.5px; font-weight: 700; color: var(--c-coral); cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.25s var(--ease-spring);
}
.show-replies-btn:hover {
    background: rgba(235, 103, 83, 0.07);
    border-color: rgba(235, 103, 83, 0.30);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px -12px rgba(235, 103, 83, 0.55);
}
.show-replies-btn i {
    font-size: 10px; transition: transform 0.4s var(--ease-spring);
}
.show-replies-btn.expanded i { transform: rotate(180deg); }

.comment-replies-container {
    display: grid; grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s var(--ease-smooth), margin-top 0.5s var(--ease-smooth);
    margin-left: 62px;
    margin-top: 0;
    padding-left: 26px;
    position: relative;
}
.comment-replies-container.visible { grid-template-rows: 1fr; margin-top: 14px; }
.comment-replies-container::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: linear-gradient(180deg, rgba(235, 103, 83, 0.55) 0%, rgba(235, 103, 83, 0.10) 60%, transparent 100%);
    border-radius: 2px;
    opacity: 0; transition: opacity 0.4s ease;
}
.comment-replies-container.visible::before { opacity: 1; }
.comment-replies-inner { overflow: hidden; display: flex; flex-direction: column; gap: 10px; }
.comment-replies-inner > .comment-item:first-child { margin-top: 4px; }
.comment-replies-inner > .comment-item:last-child { margin-bottom: 4px; }

.comment-replies-container.visible .comment-replies-inner > .comment-item {
    animation: replySlideIn 0.45s var(--ease-smooth) both;
}
.comment-replies-container.visible .comment-replies-inner > .comment-item:nth-child(1) { animation-delay: 0.05s; }
.comment-replies-container.visible .comment-replies-inner > .comment-item:nth-child(2) { animation-delay: 0.11s; }
.comment-replies-container.visible .comment-replies-inner > .comment-item:nth-child(3) { animation-delay: 0.17s; }
.comment-replies-container.visible .comment-replies-inner > .comment-item:nth-child(4) { animation-delay: 0.23s; }
.comment-replies-container.visible .comment-replies-inner > .comment-item:nth-child(5) { animation-delay: 0.29s; }
.comment-replies-container.visible .comment-replies-inner > .comment-item:nth-child(n+6) { animation-delay: 0.34s; }
@keyframes replySlideIn {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: translateX(0); }
}

.comment-item[data-depth="1"] { position: relative; }
.comment-item[data-depth="1"]::before {
    content: ''; position: absolute; left: -26px; top: 30px; width: 18px; height: 2px;
    background: rgba(235, 103, 83, 0.30); border-radius: 2px;
    transition: background 0.3s ease, width 0.3s ease;
}
.comment-item[data-depth="1"]:hover::before {
    background: rgba(235, 103, 83, 0.6);
    width: 22px;
}
.comment-item[data-depth="1"] > .comment-item-inner {
    display: flex; gap: 14px;
    padding: 16px 18px;
    background: linear-gradient(180deg, #fbfbfc 0%, #f7f8fa 100%);
    border: 1px solid var(--c-line-soft);
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.comment-item[data-depth="1"] > .comment-item-inner::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--c-coral) 0%, var(--c-coral-light) 100%);
    transform: scaleY(0); transform-origin: center;
    transition: transform 0.35s var(--ease-spring);
}
.comment-item[data-depth="1"] > .comment-item-inner:hover {
    background: #ffffff;
    border-color: rgba(235, 103, 83, 0.22);
    box-shadow: 0 10px 26px -18px rgba(16, 24, 40, 0.3);
    transform: translateY(-2px) translateX(2px);
}
.comment-item[data-depth="1"] > .comment-item-inner:hover::before { transform: scaleY(1); }
.comment-item[data-depth="1"] .comment-avatar { width: 38px; height: 38px; }
.comment-item[data-depth="1"] .comment-author-name { font-size: 13.5px; }
.comment-item[data-depth="1"] .comment-text { font-size: 14px; }

.reply-tag {
    display: inline-flex; align-items: center; gap: 4px;
    font-family: var(--tf); font-weight: 700; font-size: 10px;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--c-coral);
    background: rgba(235, 103, 83, 0.10);
    padding: 3px 8px; border-radius: 12px;
}
.reply-tag i { font-size: 9px; }

.reply-input-area {
    display: grid; grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s var(--ease-smooth);
}
.reply-input-area.anim-visible { grid-template-rows: 1fr; }
.reply-input-inner { overflow: hidden; }
.reply-input-content {
    display: flex; gap: 12px; padding: 16px 18px;
    background: #ffffff; border-radius: 14px; border: 1px solid var(--c-line);
    margin: 6px 0 4px;
    box-shadow: 0 8px 24px -20px rgba(16, 24, 40, 0.30);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.reply-input-content:focus-within {
    border-color: rgba(235, 103, 83, 0.35);
    box-shadow: 0 12px 30px -16px rgba(235, 103, 83, 0.45);
}
.reply-form { flex: 1; min-width: 0; }
.reply-form textarea {
    width: 100%;
    min-height: 62px; max-height: 280px;
    font-size: 13.5px; padding: 11px 14px; border-radius: 12px;
    border: 1.5px solid var(--c-line);
    background: var(--c-surface);
    font-family: var(--bf);
    line-height: 1.7; color: var(--c-ink);
    resize: vertical; outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.reply-form textarea:focus {
    border-color: var(--c-coral); box-shadow: 0 0 0 4px rgba(235, 103, 83, 0.09);
}
.reply-form textarea::placeholder { color: var(--c-faint); font-weight: 400; }
.reply-form-actions {
    display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px;
}

.btn-reply-cancel {
    background: none; border: 1px solid var(--c-line); border-radius: 12px;
    padding: 8px 18px;
    font-family: var(--tf);
    font-size: 13px; font-weight: 600; color: var(--c-muted); cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-reply-cancel:hover { background: var(--c-surface-2); color: var(--c-ink); border-color: #d3d7dd; }
.btn-reply-submit {
    background: linear-gradient(135deg, var(--c-coral) 0%, var(--c-coral-dark) 100%);
    border: none; border-radius: 12px; padding: 8px 22px;
    font-family: var(--tf);
    font-size: 13px; font-weight: 700; color: #ffffff; cursor: pointer;
    box-shadow: 0 6px 16px -6px rgba(235, 103, 83, 0.55);
    transition: transform 0.2s var(--ease-spring), box-shadow 0.25s ease, opacity 0.2s ease;
}
.btn-reply-submit:hover { box-shadow: 0 10px 22px -8px rgba(235, 103, 83, 0.65); transform: translateY(-2px); }
.btn-reply-submit:active { transform: scale(0.97); }
.btn-reply-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.pm-modal-container textarea.form-control {
    width: 100%; height: 150px; padding: 14px 16px;
    border-radius: 12px; border: 1.5px solid var(--c-line);
    font-family: var(--bf);
    font-size: 14px; line-height: 1.7; color: var(--c-ink);
    resize: vertical; outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.pm-modal-container textarea.form-control:focus {
    border-color: var(--c-coral); box-shadow: 0 0 0 4px rgba(235, 103, 83, 0.09);
}
.pm-status > div {
    border-radius: 12px !important;
    font-family: var(--bf); font-size: 14px;
}

@keyframes commentSlideIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 767.98px) {
    .comments-title-row .title, #section-posts .title { font-size: 24px; }
    .comment-input-area { padding: 22px 18px 18px; gap: 12px; }
    .comment-item[data-depth="0"] { padding: 18px 16px; }

    /* --- Row 1: avatar + username + date / Row 2: text / Row 3: actions --- */
    .comment-item[data-depth="0"] > .comment-item-inner,
    .comment-item[data-depth="1"] > .comment-item-inner {
        flex-wrap: wrap;
        align-items: center;
        gap: 0 12px;               /* row-gap 0, column-gap 12px */
    }

    /* Dissolve the body wrapper so meta/text/actions become flex rows */
    .comment-item .comment-body { display: contents; }

    /* Avatar column: put the PM icon beside the avatar, not under it */
    .comment-item .comment-avatar-col {
        flex-direction: row;
        align-items: center;
        gap: 6px;
    }
    .comment-item .comment-pm-action { margin-top: 0; }

    /* Meta fills the rest of row 1, vertically centered against the avatar */
    .comment-item .comment-meta {
        flex: 1 1 0;
        min-width: 0;
        margin-bottom: 0;
    }

    /* Comment text takes its own full-width row */
    .comment-item .comment-text {
        flex: 0 0 100%;
        width: 100%;
        margin: 10px 0 8px;
    }

    /* Action buttons take their own full-width row */
    .comment-item .comment-actions {
        flex: 0 0 100%;
        width: 100%;
        margin-top: 0;
    }

    /* Show-replies button gets its own row too */
    .comment-item .show-replies-btn {
        flex: 0 0 100%;
        justify-content: center;
        margin-top: 10px;
    }

    .comment-replies-container { margin-left: 24px; padding-left: 18px; }
    .comment-item[data-depth="1"]::before { left: -18px; width: 12px; }
    .comment-item[data-depth="1"]:hover::before { width: 14px; }
    .comment-form-footer { flex-direction: column; align-items: flex-start; }
    .comment-form-actions { width: 100%; justify-content: space-between; }
    .comment-form-actions .ud-btn { flex: 1; justify-content: center; text-align: center; }
    .comment-actions { gap: 0; }
    .action-separator { display: none; }
    .comment-action-flag, .comment-action-copylink { opacity: 1; transform: none; }
    .comments-header-tools { width: 100%; justify-content: space-between; }
}
@media (max-width: 575.98px) {
    .comment-input-area > .comment-avatar { display: none; }
    .comment-item .comment-avatar { width: 36px; height: 36px; }
    .comment-pm-action { display: none; }
    .comment-item .comment-text { margin: 8px 0 6px; }   /* tighter spacing */
    .reply-input-content { padding: 12px 14px; }
    .comment-item[data-depth="1"] > .comment-item-inner { padding: 14px; }
    .comment-replies-container { margin-left: 10px; padding-left: 14px; }
    .comment-item[data-depth="1"]::before { left: -14px; width: 9px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
