/* Свои комментарии (reboot-child / inc/comments.php, assets/comments.js) */

.cm-area {
    margin: 28px 0 8px;
    padding: 24px 24px 18px;
    background: #fff;
    border: 1px solid #eceef1;
    border-radius: 16px;
    font-family: 'Inter', sans-serif;
    color: #1c1c1c;
}
.cm-area__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.cm-area__title {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 22px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em;
}
.cm-area__title svg { width: 24px; height: 24px; color: #2d81e0; }
.cm-area__n {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 30px; height: 26px; padding: 0 9px;
    border-radius: 999px; background: #eef4fd; color: #2d81e0;
    font-size: 14px; font-weight: 700;
}
.cm-closed { margin: 0 0 12px; color: #8a8f98; font-size: 14px; }

/* ---------- форма ---------- */
.cm-form { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 22px; }
.cm-form__ava img, .cm__ava img, .cm-lk__ava img { display: block; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #eef1f5; }
.cm-form__ava span, .cm__ava span, .cm-lk__ava span { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; font-size: 16px; font-weight: 700; flex-shrink: 0; user-select: none; }
.cm-form__box { flex: 1; min-width: 0; }
.cm-form__to { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: #2d81e0; }
.cm-form__ta {
    display: block; width: 100%; min-height: 84px; max-height: 420px; box-sizing: border-box;
    padding: 12px 14px; resize: none; overflow-y: auto;
    border: 1.5px solid #e1e5eb; border-radius: 12px; background: #f7f8fa;
    font: 400 15px/1.5 'Inter', sans-serif; color: #1c1c1c;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.cm-form__ta::placeholder { color: #9aa0a8; }
.cm-form__ta:focus { outline: none; border-color: #2d81e0; background: #fff; box-shadow: 0 0 0 4px rgba(45, 129, 224, .12); }
.cm-form__bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.cm-form__who { flex: 1; min-width: 0; font-size: 13px; color: #8a8f98; }
.cm-form__who b { color: #1c1c1c; font-weight: 600; }
.cm-form__cnt { font-size: 12px; color: #8a8f98; font-variant-numeric: tabular-nums; }
.cm-form__cnt.is-over { color: #d23b3b; font-weight: 700; }
.cm-form__send {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; border: 0; border-radius: 10px; cursor: pointer;
    background: #2d81e0; color: #fff !important; text-decoration: none !important;
    font: 600 14px/1.2 'Inter', sans-serif;
    transition: background .15s, box-shadow .15s, transform .1s;
}
.cm-form__send:hover { background: #1f6fcb; box-shadow: 0 4px 14px rgba(45, 129, 224, .3); }
.cm-form__send:active { transform: scale(.97); }
.cm-form__send:disabled { opacity: .6; cursor: progress; }
.cm-form__cancel {
    padding: 10px 14px; border: 0; border-radius: 10px; background: #eef1f5; color: #4a4f57; cursor: pointer;
    font: 600 14px/1.2 'Inter', sans-serif;
}
.cm-form__cancel:hover { background: #e3e7ed; }
.cm-form.is-sending .cm-form__ta { opacity: .6; }
.cm-form__note { margin-top: 10px; padding: 10px 14px; border-radius: 10px; font-size: 14px; line-height: 1.4; }
.cm-form__note[hidden] { display: none; }
.cm-form__note--ok { background: #e9f8ef; color: #12733b; }
.cm-form__note--wait { background: #eef4fd; color: #1f5fa8; }
.cm-form__note--err { background: #fdecee; color: #b4232f; }

/* форма ответа под комментарием */
.cm-form--reply { margin: 12px 0 4px; }
.cm-form--reply .cm-form__ava { display: none; }
.cm-form--reply .cm-form__ta { min-height: 64px; }
.cm-form--reply .cm-form__who { display: none; }
.cm-form--reply .cm-form__bar { justify-content: flex-end; }

/* ---------- гость: пустое поле + регистрация ---------- */
.cm-guest { margin: 0 0 22px; }
.cm-guest__ta { min-height: 70px; }
.cm-guest__panel {
    margin-top: 12px; padding: 18px 18px 16px;
    border-radius: 14px; background: linear-gradient(135deg, #f3f8fe 0%, #f7f8fa 100%);
    border: 1px solid #e3ecf8;
    transition: box-shadow .2s, border-color .2s;
}
.cm-guest.is-active .cm-guest__panel { border-color: #b9d4f3; box-shadow: 0 6px 22px -10px rgba(45, 129, 224, .45); }
.cm-guest__head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.cm-guest__ico {
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 12px; background: #fff; font-size: 20px;
    box-shadow: 0 2px 6px rgba(20, 40, 80, .08);
}
.cm-guest__title { font-size: 16px; font-weight: 700; line-height: 1.3; }
.cm-guest__sub { margin-top: 3px; font-size: 13px; line-height: 1.45; color: #6b7079; }
.cm-guest__soc { display: flex; gap: 8px; flex-wrap: wrap; }
.cm-guest__soc .lk-social { flex: 1 1 160px; margin: 0; }
.cm-guest__or { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-size: 12px; color: #9aa0a8; }
.cm-guest__or::before, .cm-guest__or::after { content: ""; flex: 1; height: 1px; background: #dfe5ee; }
.cm-reg__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cm-reg__f { display: block; margin: 0; }
.cm-reg__f span { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: #6b7079; }
.cm-reg__f input {
    display: block; width: 100%; box-sizing: border-box; height: 42px; padding: 0 12px;
    border: 1.5px solid #dfe5ee; border-radius: 10px; background: #fff;
    font: 400 14px/1 'Inter', sans-serif; color: #1c1c1c;
}
.cm-reg__f input:focus { outline: none; border-color: #2d81e0; box-shadow: 0 0 0 4px rgba(45, 129, 224, .12); }
.cm-reg__agree { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; font-size: 12px; line-height: 1.4; color: #6b7079; cursor: pointer; }
.cm-reg__agree input { margin: 1px 0 0; flex-shrink: 0; }
.cm-reg__bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.cm-reg__login { font-size: 13px; color: #6b7079; }
.cm-reg__login a { color: #2d81e0; font-weight: 600; text-decoration: none; }
.cm-reg__login a:hover { text-decoration: underline; }
.cm-reg .lk-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ---------- список ---------- */
.cm-list, .cm-children { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.cm-list:empty { display: none; }
.cm-empty {
    display: flex; align-items: center; gap: 10px; padding: 16px 18px;
    border-radius: 12px; background: #f7f8fa; color: #6b7079; font-size: 14px;
}
.cm-empty span { font-size: 20px; }
.cm-list:not(:empty) + .cm-empty { display: none; }

.cm-item { margin: 0 !important; padding: 0 !important; list-style: none !important; }
.cm-item::before, .cm-item::marker { content: none !important; }
.cm {
    display: flex; gap: 12px; padding: 14px 10px 10px; margin: 0 -10px;
    border-radius: 12px; transition: background .3s;
}
.cm-list > .cm-item + .cm-item { border-top: 1px solid #f0f1f4; }
.cm__ava { flex-shrink: 0; }
.cm__main { flex: 1; min-width: 0; }
.cm__head { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; font-size: 13px; line-height: 1.3; }
.cm__name { font-size: 14px; font-weight: 700; color: #1c1c1c; }
.cm__badge {
    padding: 2px 7px; border-radius: 6px; background: #fff1ec; color: #e0531f;
    font-size: 11px; font-weight: 700; text-transform: lowercase;
}
.cm__badge--me { background: #eef4fd; color: #2d81e0; }
.cm__to {
    display: inline-flex; align-items: center; gap: 3px;
    color: #8a8f98 !important; text-decoration: none !important; font-weight: 500;
}
.cm__to svg { width: 13px; height: 13px; }
.cm__to:hover { color: #2d81e0 !important; }
.cm__time { color: #9aa0a8 !important; text-decoration: none !important; }
.cm__time:hover { color: #2d81e0 !important; }
.cm__pending {
    display: inline-block; margin-top: 6px; padding: 4px 9px; border-radius: 7px;
    background: #fff7e6; color: #9a6400; font-size: 12px; font-weight: 600;
}
.cm__text { margin-top: 5px; font-size: 15px; line-height: 1.55; color: #24272b; overflow-wrap: anywhere; }
.cm__text p { margin: 0 0 8px !important; }
.cm__text p:last-child { margin-bottom: 0 !important; }
.cm__text a { color: #2d81e0; }
.cm-item--pending > .cm .cm__text { color: #6b7079; }

.cm__foot { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.cm__act {
    display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px;
    border: 0; border-radius: 8px; background: transparent; color: #6b7079; cursor: pointer;
    font: 600 13px/1 'Inter', sans-serif; transition: background .15s, color .15s;
}
.cm__act svg { width: 15px; height: 15px; }
.cm__act:hover, .cm__act.is-active { background: #eef4fd; color: #2d81e0; }
.cm__fold[hidden] { display: none; }
.cm__fold svg { transition: transform .2s; }
.cm-item.is-folded > .cm .cm__fold svg { transform: rotate(-90deg); }
.cm-item.is-folded > .cm-children { display: none; }

/* оценка */
.cm-rate { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; padding: 2px; border-radius: 9px; background: #f4f5f7; }
.cm-rate__btn {
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px;
    border: 0; border-radius: 7px; background: transparent; color: #8a8f98; cursor: pointer;
    transition: background .15s, color .15s, transform .1s;
}
.cm-rate__btn svg { width: 15px; height: 15px; }
.cm-rate__btn--up:hover { color: #1a9e52; background: #e6f6ec; }
.cm-rate__btn--down:hover { color: #e0475a; background: #fdebee; }
.cm-rate__btn--up.is-active { color: #fff; background: #1fa45a; }
.cm-rate__btn--down.is-active { color: #fff; background: #e5484d; }
.cm-rate__btn.is-pop { animation: cm-pop .35s ease; }
@keyframes cm-pop { 40% { transform: scale(1.25); } }
.cm-rate__n { min-width: 22px; padding: 0 2px; text-align: center; font-size: 13px; font-weight: 700; color: #6b7079; font-variant-numeric: tabular-nums; }
.cm-rate.is-pos .cm-rate__n { color: #1a9e52; }
.cm-rate.is-neg .cm-rate__n { color: #e0475a; }
.cm-rate.is-busy { opacity: .75; }

/* ветки ответов */
.cm-children { margin-left: 26px !important; padding-left: 14px !important; border-left: 2px solid #eef0f3; }
.cm-children .cm__ava img { width: 32px; height: 32px; }
/* глубокие ветки не сужаем бесконечно */
.cm-children .cm-children .cm-children .cm-children { margin-left: 0 !important; padding-left: 10px !important; }

/* подсветка: новый / переход по ссылке */
.cm-item.lv-new > .cm { animation: cm-new 4s ease-out; }
@keyframes cm-new {
    0% { background: rgba(45, 129, 224, .16); transform: translateY(8px); opacity: 0; }
    10% { transform: none; opacity: 1; }
    60% { background: rgba(45, 129, 224, .10); }
    100% { background: transparent; }
}
.cm.is-flash { animation: cm-flash 2.4s ease-out; }
@keyframes cm-flash { 0%, 30% { background: #fff6d6; } 100% { background: transparent; } }

/* всплывающая подсказка */
.cm-toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 9995;
    max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
    background: #1c1f24; color: #fff; font: 500 14px/1.4 'Inter', sans-serif;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s, transform .2s;
}
.cm-toast.is-visible { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.cm-toast a { color: #7cb8ff; font-weight: 700; margin-left: 6px; }

@media (max-width: 767px) {
    .cm-area { padding: 18px 14px 12px; border-radius: 14px; margin-top: 20px; }
    .cm-area__title { font-size: 19px; }
    .cm-form__ava { display: none; }
    .cm-reg__row { grid-template-columns: 1fr; }
    .cm-children { margin-left: 8px !important; padding-left: 10px !important; }
    .cm-children .cm-children .cm-children { margin-left: 0 !important; padding-left: 8px !important; }
    .cm__ava img { width: 34px; height: 34px; }
    .cm-toast { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
    .cm-item.lv-new > .cm, .cm.is-flash, .cm-rate__btn.is-pop { animation: none; }
}

/* ---------- личный кабинет: /lk/kommentarii/ ---------- */
.lk-tab__n {
    display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
    margin-left: 4px; padding: 0 5px; border-radius: 999px; background: #e5484d; color: #fff;
    font-size: 11px; font-weight: 700; line-height: 1; vertical-align: 1px;
}
.cm-lk__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.cm-lk__stat { padding: 14px 16px; border-radius: 12px; background: #f7f8fa; }
.cm-lk__stat b { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; color: #1c1c1c; }
.cm-lk__stat b.is-pos { color: #1a9e52; }
.cm-lk__stat b.is-neg { color: #e0475a; }
.cm-lk__stat span { font-size: 13px; color: #6b7079; }
.cm-lk__tabs { display: flex; gap: 6px; margin-bottom: 8px; border-bottom: 1px solid #eef0f3; }
.cm-lk__tab {
    display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; margin-bottom: -1px;
    border-bottom: 2px solid transparent; color: #6b7079 !important; text-decoration: none !important;
    font: 600 14px/1.2 'Inter', sans-serif;
}
.cm-lk__tab:hover { color: #1c1c1c !important; }
.cm-lk__tab.is-active { color: #2d81e0 !important; border-bottom-color: #2d81e0; }
.cm-lk__new {
    display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px;
    background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; line-height: 1.2;
}
.cm-lk__list { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.cm-lk__item { display: flex; gap: 12px; margin: 0 !important; padding: 14px 4px !important; border-bottom: 1px solid #f0f1f4; list-style: none !important; }
.cm-lk__item:last-child { border-bottom: 0; }
.cm-lk__item.is-new { background: linear-gradient(90deg, #f3f8fe, transparent 70%); border-radius: 10px; }
.cm-lk__ava { flex-shrink: 0; }
.cm-lk__body { flex: 1; min-width: 0; }
.cm-lk__top { font-size: 14px; line-height: 1.35; color: #4a4f57; }
.cm-lk__top a { color: #1c1c1c !important; text-decoration: none !important; }
.cm-lk__top a:hover { color: #2d81e0 !important; }
.cm-lk__text { margin-top: 5px; font-size: 15px; line-height: 1.5; color: #24272b; overflow-wrap: anywhere; }
.cm-lk__quote { margin-top: 6px; padding: 6px 10px; border-left: 3px solid #dfe5ee; color: #6b7079; font-size: 13px; line-height: 1.4; }
.cm-lk__meta { margin-top: 7px; font-size: 13px; color: #8a8f98; }
.cm-lk__meta a { color: #2d81e0 !important; text-decoration: none !important; }
.cm-lk__meta a:hover { text-decoration: underline !important; }
.cm-lk__r { font-weight: 700; }
.cm-lk__r.is-pos { color: #1a9e52; }
.cm-lk__r.is-neg { color: #e0475a; }
.cm-lk__go { font-weight: 600; }
@media (max-width: 600px) {
    .cm-lk__stats { gap: 6px; }
    .cm-lk__stat { padding: 10px; }
    .cm-lk__stat b { font-size: 20px; }
    .cm-lk__stat span { font-size: 12px; }
}
