/**
 * Cloud Comments — styles
 *
 * Design based on knife-id reference:
 * - Avatar left, content right (sidebar layout)
 * - Nested comments with left border line
 * - Compact vote buttons (green +, red -)
 * - Theme CSS variables for consistency with bratsk/irkutsk
 */

.cloud-comments {
    max-width: var(--width-content, 46rem);
    margin: 2rem auto;
    padding: 0 var(--space-outer, 1.25rem);
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-dark, #212529);
}

/* ========================
   Reactions block ("Оцените материал")
   ======================== */

.cc-reactions {
    text-align: center;
    padding: 1.5rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-muted, #e0e0e0);
}

.cc-reactions__title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.375rem;
}

.cc-reactions__total {
    font-size: 0.8125rem;
    color: #808080;
    margin: 0 0 1rem;
}

.cc-reactions__list {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cc-reactions__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-muted, #e0e0e0);
    border-radius: 0.625rem;
    background: var(--color-light, #fff);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
    min-width: 3.75rem;
    font-family: inherit;
    position: relative;
    overflow: visible;
}

.cc-reactions__btn:hover {
    background: var(--color-summary, #f5f5f5);
}

.cc-reactions__btn--active {
    border-color: var(--cc-primary, var(--color-primary, #e3410b));
    background: var(--color-summary, #f5f5f5);
}

/* SVG icon with ring animation container */
.cc-reactions__emoji {
    width: 2rem;
    height: 2rem;
    display: block;
    position: relative;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

/* Pulse ring behind emoji on click */
.cc-reactions__btn--animating .cc-reactions__emoji {
    transform: scale(1.15);
}

.cc-reactions__ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3rem;
    height: 3rem;
    margin-top: -1.75rem;
    margin-left: -1.5rem;
    border-radius: 50%;
    border: 3px solid var(--cc-primary, var(--color-primary, #e3410b));
    opacity: 0;
    transform: scale(0.3);
    pointer-events: none;
}

.cc-reactions__btn--animating .cc-reactions__ring {
    animation: cc-ring-pulse 0.5s ease-out forwards;
}

@keyframes cc-ring-pulse {
    0% {
        opacity: 0.8;
        transform: scale(0.3);
    }
    100% {
        opacity: 0;
        transform: scale(1.4);
    }
}

/* Confetti particles */
.cc-reactions__particles {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
}

.cc-reactions__particle {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    opacity: 0;
}

.cc-reactions__btn--animating .cc-reactions__particle {
    animation: cc-particle-burst 0.6s ease-out forwards;
}

.cc-reactions__particle:nth-child(1) { background: #ff6b6b; --cc-px: -18px; --cc-py: -22px; animation-delay: 0s; }
.cc-reactions__particle:nth-child(2) { background: #ffd93d; --cc-px: 16px; --cc-py: -20px; animation-delay: 0.03s; }
.cc-reactions__particle:nth-child(3) { background: #6bcb77; --cc-px: 22px; --cc-py: 5px; animation-delay: 0.06s; }
.cc-reactions__particle:nth-child(4) { background: #4d96ff; --cc-px: -20px; --cc-py: 8px; animation-delay: 0.02s; }
.cc-reactions__particle:nth-child(5) { background: #ff6b6b; --cc-px: 8px; --cc-py: 20px; animation-delay: 0.05s; }
.cc-reactions__particle:nth-child(6) { background: #c77dff; --cc-px: -12px; --cc-py: 18px; animation-delay: 0.04s; }

@keyframes cc-particle-burst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--cc-px), var(--cc-py)) scale(0);
    }
}

.cc-reactions__count {
    font-size: 0.9375rem;
    font-weight: 400;
    color: #808080;
    transition: transform 0.2s ease;
}

/* Bump count number on click */
.cc-reactions__btn--animating .cc-reactions__count {
    animation: cc-count-bump 0.3s ease;
}

@keyframes cc-count-bump {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@media screen and (max-width: 479px) {
    .cc-reactions__list {
        gap: 0.375rem;
    }

    .cc-reactions__list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(3.5rem, 1fr));
        gap: 0.5rem;
    }

    .cc-reactions__btn {
        padding: 0.5rem 0.25rem;
        min-width: 0;
        width: 100%;
    }

    .cc-reactions__emoji {
        width: 1.75rem;
        height: 1.75rem;
    }

    .cc-reactions__count {
        font-size: 0.8125rem;
    }
}

/* ========================
   User bar
   ======================== */

.cc-userbar__logout {
    margin-left: auto;
    background: none;
    border: none;
    color: #808080;
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: color 0.2s;
}

.cc-userbar__logout:hover {
    color: var(--cc-primary, var(--color-primary, #e3410b));
}

/* ========================
   Login
   ======================== */

.cc-login {
    padding: 1.5rem;
    background: var(--color-summary, #f5f5f5);
    border-radius: var(--radius-frame, 0.3125rem);
    margin-bottom: 1.5rem;
}

.cc-login__text {
    margin: 0 0 0.875rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-dark, #212529);
}

.cc-login__buttons {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.cc-login__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.125rem;
    border: none;
    border-radius: var(--radius-frame, 0.3125rem);
    font-size: 0.8125rem;
    font-family: inherit;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s;
}

.cc-login__btn:hover {
    opacity: 0.85;
}

.cc-login__btn--vk {
    background: #0077ff;
}

.cc-login__btn--yandex {
    background: #fc3f1d;
}

.cc-login__btn svg {
    flex-shrink: 0;
}

/* ========================
   Form — inline input with send button inside
   ======================== */

.cc-form {
    margin-bottom: 1.25rem;
    position: relative;
}

/* Name + logout above form */
.cc-form-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.cc-form-header__name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-dark, #212529);
}

/* Avatar inside the input wrap */
.cc-form__avatar {
    width: 2rem !important;
    height: 2rem !important;
    max-width: 2rem !important;
    max-height: 2rem !important;
    min-width: 2rem !important;
    border-radius: 50% !important;
    object-fit: cover;
    flex-shrink: 0;
    margin-right: 0.375rem;
}

.cc-form__input-wrap--multiline .cc-form__avatar,
.cc-form__input-wrap--multiline .cc-form__attach {
    margin-top: 0.25rem;
}

.cc-form__input-wrap {
    display: flex;
    align-items: center;
    background: var(--color-summary, #f0f0f0);
    border-radius: 1.25rem;
    padding: 0.375rem 0.375rem 0.375rem 0.5rem;
    transition: background-color 0.2s;
}

/* When textarea grows, pin elements to top */
.cc-form__input-wrap--multiline {
    align-items: flex-start;
}

.cc-form__input-wrap:focus-within {
    background: var(--color-muted, #e0e0e0);
}

.cc-form__textarea {
    flex: 1;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.4;
    padding: 0.375rem 0;
    resize: none;
    outline: none;
    min-height: 1.4em;
    overflow: hidden;
    color: var(--color-dark, #212529);
    box-sizing: border-box;
}

.cc-form__textarea::placeholder {
    color: #808080;
}

.cc-form__submit {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 50%;
    background: var(--cc-primary, var(--color-primary, #e3410b));
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    padding: 0;
    margin-left: 0.5rem;
    margin-top: 0.125rem;
}

.cc-form__submit:hover {
    opacity: 0.85;
}

.cc-form__submit:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Arrow icon inside send button */
.cc-form__submit svg {
    width: 1rem;
    height: 1rem;
}

.cc-form__footer {
    display: none;
}

/* Cancel button for reply forms */
.cc-form__cancel {
    flex-shrink: 0;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.75rem;
    color: #808080;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    margin-left: 0.25rem;
    transition: color 0.15s;
}

.cc-form__cancel:hover {
    color: var(--color-dark, #212529);
}

/* ========================
   Attachments — in comments and form
   ======================== */

/* Attach button (paperclip) — left of textarea */
.cc-form__attach {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    background: none;
    border: none;
    padding: 0;
    margin-right: 0.25rem;
    color: #808080;
    cursor: pointer;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cc-form__attach svg {
    width: 1.25rem;
    height: 1.25rem;
}

.cc-form__attach:hover {
    color: var(--cc-primary, var(--color-primary, #e3410b));
}

/* Attachment preview in form */
.cc-form__attachment-preview {
    padding: 0.5rem 0;
}

.cc-form__attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    background: var(--color-summary, #f5f5f5);
    border-radius: 0.375rem;
    font-size: 0.8125rem;
}

.cc-form__attachment-thumb {
    width: 3rem;
    height: 3rem;
    object-fit: cover;
    border-radius: 0.25rem;
}

.cc-form__attachment-filename {
    color: var(--color-dark, #212529);
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-form__attachment-remove {
    background: none;
    border: none;
    font-size: 1.125rem;
    color: #808080;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

.cc-form__attachment-remove:hover {
    color: var(--color-warning, #d32f2f);
}

.cc-form__attachment-loading {
    font-size: 0.8125rem;
    color: #808080;
    font-style: italic;
}

/* Attachment in comment */
.cc-attachment {
    grid-column: 2;
    margin-top: 0.5rem;
}

.cc-attachment__image {
    display: inline-block;
    max-width: 20rem;
    border-radius: 0.375rem;
    overflow: hidden;
}

.cc-attachment__image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0.375rem;
    transition: opacity 0.15s;
}

.cc-attachment__image:hover img {
    opacity: 0.9;
}

.cc-attachment__file {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--color-summary, #f5f5f5);
    border-radius: 0.375rem;
    color: var(--color-dark, #212529);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: background-color 0.15s;
}

.cc-attachment__file:hover {
    background: var(--color-muted, #e0e0e0);
}

.cc-attachment__icon {
    flex-shrink: 0;
    color: var(--cc-primary, var(--color-primary, #e3410b));
}

.cc-attachment__name {
    max-width: 15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-attachment__size {
    color: #808080;
    font-size: 0.75rem;
}

@media screen and (max-width: 479px) {
    .cc-attachment__image {
        max-width: 100%;
    }
}

/* ========================
   Lightbox
   ======================== */

.cc-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cc-lightbox--visible {
    opacity: 1;
}

.cc-lightbox__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.cc-lightbox__wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
}

.cc-lightbox__img {
    display: block;
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 0.25rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.cc-lightbox__close {
    position: absolute;
    top: -2.5rem;
    right: -0.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.cc-lightbox__close:hover {
    opacity: 1;
}

/* ========================
   Auth popup
   ======================== */

.cc-auth-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cc-auth-popup--visible {
    opacity: 1;
}

.cc-auth-popup__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.cc-auth-popup__box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 0.75rem;
    padding: 2rem;
    min-width: 18rem;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.cc-auth-popup__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #808080;
    cursor: pointer;
    line-height: 1;
}

.cc-auth-popup__close:hover {
    color: var(--color-dark, #212529);
}

.cc-auth-popup__title {
    margin: 0 0 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
}

.cc-auth-popup__vk-onetap,
.cc-auth-popup__ya-suggest {
    margin-bottom: 1rem;
    min-height: 3rem;
}

.cc-auth-popup__buttons {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    align-items: center;
}

/* ========================
   Toast notifications
   ======================== */

.cc-toasts {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.cc-toast {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(1rem);
    transition: opacity 0.25s ease, transform 0.25s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-width: 90vw;
    text-align: center;
}

.cc-toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.cc-toast--error {
    background: #d32f2f;
}

.cc-toast--success {
    background: #2e7d32;
}

.cc-toast--info {
    background: #37474f;
}

/* ========================
   Sort bar
   ======================== */

.cc-sort {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-muted, #e0e0e0);
    padding-bottom: 0.75rem;
}

.cc-sort__buttons {
    display: flex;
    gap: 0.25rem;
}

.cc-stats {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cc-stats__item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: #808080;
}

.cc-stats__item svg {
    flex-shrink: 0;
}

.cc-sort__btn {
    background: none;
    border: none;
    padding: 0.375rem 0.75rem;
    font-family: inherit;
    font-size: 0.8125rem;
    color: #808080;
    cursor: pointer;
    border-radius: 1rem;
    transition: color 0.15s, background-color 0.15s;
}

.cc-sort__btn:hover {
    color: var(--color-dark, #212529);
    background: var(--color-summary, #f5f5f5);
}

.cc-sort__btn--active {
    color: var(--cc-primary, var(--color-primary, #e3410b));
    background: var(--color-summary, #f5f5f5);
    font-weight: 600;
}

/* Load more */
.cc-load-more-wrap {
    text-align: center;
    padding: 1rem 0;
}

.cc-load-more {
    padding: 0.5rem 2rem;
    background: var(--cc-primary, var(--color-primary, #e3410b));
    border: none;
    border-radius: 1.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.15s;
}

.cc-load-more:hover {
    opacity: 0.85;
}

.cc-load-more:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* ========================
   Comments list
   ======================== */

.cc-list {
    margin-top: 0.5rem;
}

.cc-empty {
    text-align: center;
    color: #808080;
    font-size: 0.9375rem;
    padding: 2rem 0;
}

.cc-error {
    text-align: center;
    color: var(--color-warning, #d32f2f);
    font-size: 0.9375rem;
    padding: 2rem 0;
}

/* ========================
   Single comment — sidebar avatar layout (like knife-id)
   ======================== */

.cc-comment {
    margin-bottom: 0;
}

/* ========================
   Nested comments — smooth L-connector
   ::before = L-curve from way above (covers parent) to child avatar
   Uses large negative top + bottom to always reach parent avatar
   regardless of comment text length.
   ======================== */

.cc-depth-1,
.cc-depth-2,
.cc-depth-3,
.cc-depth-4 {
    padding-left: 2.5rem;
    position: relative;
    overflow: visible;
}

/* L-connector: top is set dynamically by JS via --cc-line-top */
.cc-depth-1::before,
.cc-depth-2::before,
.cc-depth-3::before,
.cc-depth-4::before {
    content: '';
    position: absolute;
    left: 0.625rem;
    top: var(--cc-line-top, -3rem);
    bottom: var(--cc-line-bottom, calc(100% - 3.5rem));
    width: 1.25rem;
    border-left: 2px solid #ddd;
    border-bottom: 2px solid #ddd;
    border-bottom-left-radius: 0.75rem;
    border-right: none;
    border-top: none;
    pointer-events: none;
}

@media screen and (max-width: 767px) {
    .cc-depth-1,
    .cc-depth-2,
    .cc-depth-3,
    .cc-depth-4 {
        padding-left: 1.75rem;
    }

    .cc-depth-1::before,
    .cc-depth-2::before,
    .cc-depth-3::before,
    .cc-depth-4::before {
        left: 0.375rem;
        width: 0.875rem;
        border-bottom-left-radius: 0.5rem;
    }
}

/* ========================
   Comment body — avatar sidebar layout (matches reference)
   ======================== */

.cc-comment__body {
    display: grid;
    grid-template-columns: 2.25rem 1fr;
    column-gap: 0.75rem;
    padding: 0.875rem 0;
}

.cc-comment__avatar {
    grid-column: 1;
    grid-row: 1 / -1;
    width: 2.25rem !important;
    height: 2.25rem !important;
    max-width: 2.25rem !important;
    max-height: 2.25rem !important;
    min-width: 2.25rem !important;
    border-radius: 50% !important;
    object-fit: cover;
    margin-top: 0.125rem;
}

/* Nested — smaller avatar */
.cc-depth-1 .cc-comment__body,
.cc-depth-2 .cc-comment__body,
.cc-depth-3 .cc-comment__body,
.cc-depth-4 .cc-comment__body {
    grid-template-columns: 1.75rem 1fr;
    column-gap: 0.625rem;
    padding: 0.625rem 0;
}

.cc-depth-1 .cc-comment__avatar,
.cc-depth-2 .cc-comment__avatar,
.cc-depth-3 .cc-comment__avatar,
.cc-depth-4 .cc-comment__avatar {
    width: 1.75rem !important;
    height: 1.75rem !important;
}

/* Header: name (left) + vote group (right) */
.cc-comment__header {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cc-comment__header-spacer {
    flex: 1;
}

.cc-comment__name {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.3;
    color: var(--cc-primary, var(--color-primary, #e3410b));
}

.cc-comment__time {
    display: none;
}

/* Content — 15px, good line height */
.cc-comment__content {
    grid-column: 2;
    min-width: 0; /* prevent grid blowout on long words */
    font-size: 0.9375rem;
    line-height: 1.5;
    margin-top: 0.125rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.cc-comment__content a {
    color: var(--cc-primary, var(--color-primary, #e3410b));
    text-decoration: none;
}

.cc-comment__content a:hover {
    text-decoration: underline;
}

/* Actions: [Ответить]  ···spacer···  10 нед   0  [+][-] */
.cc-comment__actions {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.375rem;
}

.cc-comment__actions-time {
    font-size: 0.8125rem;
    color: #808080;
    white-space: nowrap;
}

.cc-comment__actions-spacer {
    flex: 1;
}

/* ========================
   Removed
   ======================== */

.cc-comment--removed {
    padding: 0.75rem 0;
}

.cc-comment__deleted {
    font-style: italic;
    font-size: 0.8125rem;
    color: #808080;
}

/* ========================
   Votes — thin [+][-] pair, primary color (matches reference)
   ======================== */

.cc-vote-group {
    display: flex;
    align-items: center;
}

.cc-vote-score {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--cc-primary, var(--color-primary, #e3410b));
    min-width: 1rem;
    text-align: right;
    padding-right: 0.375rem;
}

.cc-vote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.5rem;
    background: none;
    border: 1px solid var(--cc-primary, var(--color-primary, #e3410b));
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--cc-primary, var(--color-primary, #e3410b));
    transition: background-color 0.15s, color 0.15s;
    line-height: 1;
    padding: 0;
}

.cc-vote--plus {
    border-radius: 0.625rem 0 0 0.625rem;
    border-right: none;
}

.cc-vote--minus {
    border-radius: 0 0.625rem 0.625rem 0;
}

.cc-vote:hover {
    background: var(--cc-primary, var(--color-primary, #e3410b));
    color: #fff;
}

.cc-vote--active {
    background: var(--cc-primary, var(--color-primary, #e3410b));
    color: #fff;
}

.cc-vote--disabled {
    opacity: 0.35;
    cursor: default;
}

.cc-vote--disabled:hover {
    background: none;
    color: var(--cc-primary, var(--color-primary, #e3410b));
}

.cc-vote--readonly-group {
    display: flex;
    align-items: center;
}

.cc-vote--readonly-score {
    font-size: 0.875rem;
    color: #808080;
    padding-right: 0.25rem;
}

/* ========================
   Action buttons — Ответить, Удалить
   ======================== */

.cc-action {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--cc-primary, var(--color-primary, #e3410b));
    cursor: pointer;
    transition: opacity 0.15s;
}

.cc-action:hover {
    opacity: 0.7;
}

.cc-action--edit {
    color: #808080;
}

.cc-action--edit:hover {
    color: var(--cc-primary, var(--color-primary, #e3410b));
    opacity: 1;
}

.cc-action--delete {
    color: #808080;
}

.cc-action--delete:hover {
    color: var(--color-warning, #d32f2f);
    opacity: 1;
}

/* Edited badge */
.cc-comment__edited {
    font-size: 0.75rem;
    font-style: italic;
    color: #808080;
    padding-right: 0.25rem;
}

/* ========================
   Inline edit form
   ======================== */

/* Edit form — same style as comment input */
.cc-edit__wrap {
    display: flex;
    align-items: center;
    background: var(--color-summary, #f0f0f0);
    border-radius: 1.5rem;
    padding: 0.25rem 0.25rem 0.25rem 1rem;
}

.cc-edit__wrap:focus-within {
    background: var(--color-muted, #e0e0e0);
}

.cc-edit__textarea {
    flex: 1;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.4;
    padding: 0.5rem 0;
    resize: none;
    outline: none;
    min-height: 1.4em;
    max-height: 6rem;
    overflow-y: auto;
    color: var(--color-dark, #212529);
    box-sizing: border-box;
}

.cc-edit-cancel {
    flex-shrink: 0;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.75rem;
    color: #808080;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    margin-left: 0.25rem;
    transition: color 0.15s;
}

.cc-edit-cancel:hover {
    color: var(--color-dark, #212529);
}

.cc-edit-save {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 50%;
    background: var(--cc-primary, var(--color-primary, #e3410b));
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    padding: 0;
    margin-left: 0.5rem;
}

.cc-edit-save:hover {
    opacity: 0.85;
}

.cc-edit-save:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cc-edit-save svg {
    width: 1rem;
    height: 1rem;
}

/* ========================
   Reply form inside comment thread
   ======================== */

.cc-reply-form .cc-form {
    margin: 0.5rem 0 0.25rem;
    margin-left: 3rem; /* avatar(2.25rem) + gap(0.75rem) */
}

.cc-reply-form .cc-form__input-wrap {
    padding: 0.25rem 0.25rem 0.25rem 0.25rem;
}

.cc-reply-form .cc-form__textarea {
    font-size: 0.875rem;
}

.cc-reply-form .cc-form__submit {
    width: 1.875rem;
    height: 1.875rem;
}

@media screen and (max-width: 767px) {
    .cc-reply-form .cc-form {
        margin-left: 0;
    }

    .cc-comment__body {
        grid-template-columns: 1.75rem 1fr;
        column-gap: 0.5rem;
    }

    .cc-comment__avatar {
        width: 1.75rem;
        height: 1.75rem;
    }

    .cc-depth-1,
    .cc-depth-2,
    .cc-depth-3,
    .cc-depth-4 {
        padding-left: 1.5rem;
    }

    .cc-depth-1 .cc-comment__body,
    .cc-depth-2 .cc-comment__body,
    .cc-depth-3 .cc-comment__body,
    .cc-depth-4 .cc-comment__body {
        grid-template-columns: 1.375rem 1fr;
        column-gap: 0.375rem;
    }

    .cc-depth-1 .cc-comment__avatar,
    .cc-depth-2 .cc-comment__avatar,
    .cc-depth-3 .cc-comment__avatar,
    .cc-depth-4 .cc-comment__avatar {
        width: 1.375rem;
        height: 1.375rem;
    }

    .cc-comment__name {
        font-size: 0.8125rem;
    }

    .cc-comment__content {
        font-size: 0.8125rem;
    }

    /* Actions row — wrap on mobile */
    .cc-comment__actions {
        flex-wrap: wrap;
        gap: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .cc-action {
        font-size: 0.75rem;
    }

    .cc-comment__actions-time {
        font-size: 0.6875rem;
    }

    .cc-vote {
        width: 1.375rem;
        height: 1.25rem;
        font-size: 0.75rem;
    }

    .cc-vote-score {
        font-size: 0.75rem;
        min-width: 0.75rem;
        padding-right: 0.25rem;
    }

    .cc-comment__edited {
        font-size: 0.625rem;
    }
}

@media screen and (max-width: 479px) {
    .cloud-comments {
        padding: 0 0.5rem;
    }

    .cc-depth-1,
    .cc-depth-2,
    .cc-depth-3,
    .cc-depth-4 {
        padding-left: 1.25rem;
    }

    .cc-depth-1::before,
    .cc-depth-2::before,
    .cc-depth-3::before,
    .cc-depth-4::before {
        left: 0.25rem;
        width: 0.625rem;
        border-bottom-left-radius: 0.375rem;
    }

    .cc-login {
        padding: 1rem;
    }

    .cc-login__btn {
        font-size: 0.75rem;
        padding: 0.4375rem 0.875rem;
    }

    .cc-form__avatar {
        width: 2rem;
        height: 2rem;
    }
}
