/* Комментарии v2 — единый блок для аниме, форума, рецензий, подборок и стен */

/* Цвета берутся из темы страницы: классика (--bg/--border/--accent), v2-дизайн (--mp-*), иначе — фиолетовая палитра сайта */
.cm2-section,
.cm2-sheet,
.cm2-toast {
    --cm2-text: var(--mp-ink, var(--text, #E3E1EE));
    --cm2-soft: var(--mp-text, #C9C6DA);
    --cm2-muted: var(--mp-muted, #A3A0BC);
    --cm2-line: rgba(160, 156, 210, 0.16);
    --cm2-line-strong: var(--mp-line-strong, var(--border, #4A4A6C));
    --cm2-hover: rgba(160, 156, 210, 0.07);
    --cm2-surface: rgba(58, 58, 92, 0.38);
    --cm2-surface-2: rgba(120, 118, 170, 0.2);
    --cm2-popover: var(--mp-panel-3, var(--bg-2, #3A3A5C));
    --cm2-dock: rgba(42, 42, 75, 0.94);
    --cm2-accent: var(--mp-accent-2, var(--accent, #D8C8A8));
    --cm2-accent-soft: rgba(216, 200, 168, 0.14);
    --cm2-primary-bg: var(--mp-accent, linear-gradient(135deg, #60A5FA, #2563EB));
    --cm2-on-primary: #FFFFFF;
    --cm2-link: #A5B4FC;
    --cm2-up: #93C5FD;
    --cm2-up-soft: rgba(147, 197, 253, 0.14);
    --cm2-down: #F9A8A8;
    --cm2-down-soft: rgba(249, 168, 168, 0.12);
}

.cm2-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: var(--cm2-text);
    font-size: 14.5px;
    line-height: 1.55;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
}

.cm2-section *,
.cm2-sheet * {
    box-sizing: border-box;
}

.cm2-sr {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.cm2-heading {
    margin: 0;
    padding: 0 8px;
    font-size: 18px;
    font-weight: 700;
}

.cm2-headrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
}

.cm2-forum-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    color: var(--cm2-link);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
}

.cm2-forum-link:hover {
    background: var(--cm2-surface-2);
    color: var(--cm2-text);
}

/* ---------- Композер ---------- */

.cm2-composer {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 0;
    padding: 0 8px;
}

.cm2-me {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    object-fit: cover;
    margin-top: 2px;
}

.cm2-section .cm2-box {
    display: block;
    gap: 0;
    flex: 1;
    min-width: 0;
    border: 1px solid var(--cm2-line-strong);
    border-radius: 12px;
    background: var(--cm2-surface);
    transition: border-color .15s, background-color .15s;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

.cm2-box:focus-within,
.cm2-box.is-dragover {
    border-color: var(--cm2-accent);
}

.cm2-box.is-dragover {
    background: var(--cm2-accent-soft);
}

.cm2-replying {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 6px 0 14px;
    font-size: 13px;
    color: var(--cm2-muted);
}

.cm2-replying[hidden] {
    display: none;
}

.cm2-replying b {
    color: var(--cm2-accent);
    font-weight: 600;
}

.cm2-section .cm2-input {
    display: block;
    width: 100%;
    min-height: 64px;
    max-height: 50vh;
    resize: none;
    overflow-y: hidden;
    scrollbar-width: thin;
    padding: 12px 14px;
    margin: 0;
    border: 0;
    border-radius: 12px 12px 0 0;
    background: transparent;
    color: var(--cm2-text);
    font: inherit;
    line-height: 1.5;
    outline: none;
    box-shadow: none;
}

.cm2-input::placeholder {
    color: var(--cm2-muted);
}

.cm2-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 2px 14px 10px;
}

.cm2-attachments[hidden] {
    display: none;
}

.cm2-thumb {
    position: relative;
    width: 88px;
    height: 64px;
    border-radius: 8px;
    background: var(--cm2-surface-2) center / cover no-repeat;
    border: 1px solid var(--cm2-line-strong);
}

.cm2-thumb.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 20px;
    height: 20px;
    border: 2px solid var(--cm2-line-strong);
    border-top-color: var(--cm2-accent);
    border-radius: 50%;
    animation: cm2-spin .8s linear infinite;
}

.cm2-thumb-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 0;
    background: #444;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

@keyframes cm2-spin {
    to { transform: rotate(360deg); }
}

.cm2-tools {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    border-top: 1px solid var(--cm2-line);
}

.cm2-tools-extra {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

.cm2-tool {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--cm2-soft);
    cursor: pointer;
    font-size: 15px;
    padding: 0;
    margin: 0;
}

.cm2-tool:hover,
.cm2-tool:focus-visible {
    background: var(--cm2-surface-2);
    color: #fff;
}

.cm2-ep-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    margin-left: 6px;
    padding: 0 4px 0 10px;
    border: 1px solid var(--cm2-line-strong);
    border-radius: 8px;
    color: var(--cm2-soft);
    font-size: 13px;
    cursor: text;
}

.cm2-section .cm2-ep-input {
    width: 52px;
    height: 26px;
    padding: 0 4px;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--cm2-text);
    font: 600 13px/1 inherit;
    font-family: inherit;
    outline: none;
    box-shadow: none;
    -moz-appearance: textfield;
}

.cm2-ep-input::-webkit-outer-spin-button,
.cm2-ep-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cm2-hint {
    margin-left: 10px;
    font-size: 12px;
    color: var(--cm2-muted);
    white-space: nowrap;
}

.cm2-spacer {
    flex: 1;
}

.cm2-send {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: var(--cm2-primary-bg);
    color: var(--cm2-on-primary);
    font: 600 14px/1 inherit;
    font-family: inherit;
    cursor: pointer;
}

.cm2-send:disabled {
    opacity: .6;
    cursor: progress;
}

.cm2-send i {
    display: none;
}

.cm2-guest {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--cm2-line);
    border-radius: 12px;
    background: var(--cm2-surface);
    color: var(--cm2-soft);
}

.cm2-guest span {
    flex: 1 1 220px;
}

.cm2-btn {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid var(--cm2-line-strong);
    color: var(--cm2-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.cm2-btn--primary {
    background: var(--cm2-primary-bg);
    border-color: transparent;
    color: var(--cm2-on-primary);
}

/* ---------- Сортировка и фильтр ---------- */

.cm2-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 8px;
}

.cm2-seg {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--cm2-line);
    border-radius: 10px;
    background: var(--cm2-surface);
}

.cm2-seg button {
    height: 30px;
    padding: 0 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--cm2-muted);
    font: 500 13px/1 inherit;
    font-family: inherit;
    cursor: pointer;
}

.cm2-seg button[aria-pressed="true"] {
    background: var(--cm2-surface-2);
    color: var(--cm2-text);
}

.cm2-section .cm2-filter {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--cm2-line-strong);
    border-radius: 8px;
    background: var(--cm2-surface);
    color: var(--cm2-soft);
    font: 500 13px/1 inherit;
    font-family: inherit;
}

.cm2-filter option {
    background: #2A2A4B;
    color: #E3E1EE;
}

/* ---------- Список ---------- */

.cm2-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
}

.cm2-list.is-loading {
    opacity: .5;
    pointer-events: none;
}

.cm2-empty {
    margin: 8px 0;
    color: var(--cm2-muted);
}

.cm2-thread.is-collapsed {
    display: none;
}

.cm2 {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 10px 8px 6px;
    border-radius: 10px;
    transition: background-color .3s;
}

.cm2:hover,
.cm2:focus-within {
    background: var(--cm2-hover);
}

.cm2.is-highlight {
    background: var(--cm2-accent-soft);
}

.cm2 .cm2-av {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    margin: 2px 0 0;
    padding: 0;
    border-radius: 50%;
}

.cm2 .cm2-av .comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0;
    border: 0;
}

.cm2--reply .cm2-av,
.cm2--reply .cm2-av .comment-avatar {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
}

.cm2-main {
    flex: 1;
    min-width: 0;
}

.cm2-hd {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-size: 13px;
    line-height: 20px;
    padding-right: 36px;
}

.cm2-nick {
    font-weight: 600;
    color: var(--cm2-text);
    text-decoration: none;
}

.cm2-nick:hover {
    text-decoration: underline;
}

.cm2-badge {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.cm2-lv,
.cm2-status,
.cm2-you {
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--cm2-surface-2);
    color: var(--cm2-soft);
}

.cm2-you {
    background: var(--cm2-up-soft);
    color: var(--cm2-up);
}

.cm2-time,
.cm2-edited {
    color: var(--cm2-muted);
    text-decoration: none;
}

.cm2-time:hover {
    color: var(--cm2-soft);
}

.cm2-edited[hidden] {
    display: none;
}

.cm2-ep {
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--cm2-accent-soft);
    color: var(--cm2-accent);
}

.cm2-body {
    margin-top: 3px;
    color: var(--cm2-text);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.cm2-body.is-clamped {
    max-height: 260px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(#000 70%, transparent);
    mask-image: linear-gradient(#000 70%, transparent);
}

.cm2-body a {
    color: var(--cm2-link);
}

.cm2-body .cm2-mention {
    font-weight: 500;
    text-decoration: none;
}

.cm2-body .forum-rich-image-link {
    display: inline-block;
    margin: 6px 6px 2px 0;
    vertical-align: top;
}

.cm2-body .forum-rich-image {
    display: block;
    max-width: min(100%, 360px);
    max-height: 260px;
    width: auto;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--cm2-line);
    background: var(--cm2-surface);
}

.cm2-body .forum-rich-quote {
    margin: 6px 0;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: var(--cm2-surface-2);
    color: var(--cm2-soft);
    font-size: 13.5px;
}

.cm2-body .forum-rich-quote__author {
    font-weight: 600;
    color: var(--cm2-text);
    margin-bottom: 2px;
}

.cm2-body .forum-rich-quote__author::after {
    content: ":";
}

.cm2-body .forum-rich-spoiler {
    margin: 6px 0;
    border: 1px dashed var(--cm2-line-strong);
    border-radius: 8px;
    background: var(--cm2-surface);
}

.cm2-body .forum-rich-spoiler > summary {
    padding: 8px 12px;
    cursor: pointer;
    color: var(--cm2-soft);
    font-weight: 500;
    font-size: 13px;
    list-style: none;
}

.cm2-body .forum-rich-spoiler > summary::-webkit-details-marker {
    display: none;
}

.cm2-body .forum-rich-spoiler > summary::before {
    content: "\f070";
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free", sans-serif;
    font-weight: 900;
    margin-right: 8px;
}

.cm2-body .forum-rich-spoiler[open] > summary::before {
    content: "\f06e";
}

.cm2-body .forum-rich-spoiler__content {
    padding: 0 12px 10px;
}

.cm2-body .forum-rich-code {
    margin: 6px 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    overflow-x: auto;
    font-size: 13px;
}

.cm2-body .forum-rich-list {
    margin: 4px 0;
    padding-left: 20px;
}

.cm2-body .forum-rich-underline { text-decoration: underline; }
.cm2-body .forum-rich-small { font-size: .85em; }
.cm2-body .forum-rich-big { font-size: 1.2em; }
.cm2-body .forum-rich-heading { font-size: 1.15em; margin: 8px 0 4px; }
.cm2-body .forum-rich-align-center { text-align: center; }
.cm2-body .forum-rich-align-right { text-align: right; }
.cm2-body .forum-rich-indent { padding-left: 20px; }
.cm2-body .forum-rich-divider { border: 0; border-top: 1px solid var(--cm2-line-strong); margin: 8px 0; }

.cm2-readmore,
.cm2-linkbtn {
    border: 0;
    background: none;
    padding: 2px 0;
    color: var(--cm2-accent);
    font: 600 13px/1.4 inherit;
    font-family: inherit;
    cursor: pointer;
}

.cm2-hidden-note {
    margin-top: 2px;
    color: var(--cm2-muted);
    font-size: 13.5px;
}

.cm2-ft {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    margin: 4px 0 0 -8px;
}

.cm2-vote,
.cm2-textbtn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--cm2-muted);
    font: 600 13px/1 inherit;
    font-family: inherit;
    cursor: pointer;
}

.cm2-textbtn {
    font-weight: 500;
}

.cm2-vote:hover,
.cm2-textbtn:hover {
    background: var(--cm2-surface-2);
    color: var(--cm2-text);
}

.cm2-vote--up .cm2-count:not(:empty),
.cm2-vote--up.is-active {
    color: var(--cm2-up);
}

.cm2-vote--down .cm2-count:not(:empty),
.cm2-vote--down.is-active {
    color: var(--cm2-down);
}

.cm2-vote--up.is-active { background: var(--cm2-up-soft); }
.cm2-vote--down.is-active { background: var(--cm2-down-soft); }

.cm2-edit-left {
    color: var(--cm2-muted);
    font-weight: 400;
}

.cm2-acts {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--cm2-line-strong);
    border-radius: 8px;
    background: var(--cm2-popover);
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s;
    z-index: 2;
}

.cm2:hover .cm2-acts,
.cm2:focus-within .cm2-acts {
    opacity: 1;
    pointer-events: auto;
}

.cm2-ib {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--cm2-soft);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.cm2-ib:hover,
.cm2-ib:focus-visible {
    background: var(--cm2-surface-2);
    color: #fff;
}

.cm2-dots {
    display: none;
}

/* ---------- Ветки ответов ---------- */

.cm2-replies-wrap {
    padding-left: 44px;
}

.cm2-replies-wrap[hidden],
.cm2-replies[hidden] {
    display: none;
}

.cm2-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    margin: 0 0 4px 8px;
    padding: 0 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--cm2-accent);
    font: 600 13px/1 inherit;
    font-family: inherit;
    cursor: pointer;
}

.cm2-toggle:hover {
    background: var(--cm2-accent-soft);
}

.cm2-toggle i {
    transition: transform .15s;
}

.cm2-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.cm2-replies {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Форма, перенесённая под комментарий для ответа (десктоп) */
.cm2-thread > .cm2-composer,
.cm2-replies > .cm2-composer {
    margin: 4px 8px 10px 52px;
}

.cm2-replies > .cm2-composer {
    margin-left: 44px;
}

.cm2-thread > .cm2-composer .cm2-me,
.cm2-replies > .cm2-composer .cm2-me {
    display: none;
}

/* Редактирование */
.cm2-editor {
    margin-top: 6px;
}

.cm2-section .cm2-editor textarea {
    display: block;
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid var(--cm2-line-strong);
    border-radius: 10px;
    background: var(--cm2-surface);
    color: var(--cm2-text);
    font: inherit;
    resize: vertical;
    outline: none;
}

.cm2-editor-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.cm2-editor-actions button {
    height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid var(--cm2-line-strong);
    background: transparent;
    color: var(--cm2-text);
    font: 600 13px/1 inherit;
    font-family: inherit;
    cursor: pointer;
}

.cm2-editor-actions .is-primary {
    background: var(--cm2-primary-bg);
    border-color: transparent;
    color: var(--cm2-on-primary);
}

.cm2-more {
    align-self: center;
    height: 40px;
    padding: 0 20px;
    border: 1px solid var(--cm2-line-strong);
    border-radius: 10px;
    background: var(--cm2-surface);
    color: var(--cm2-text);
    font: 500 14px/1 inherit;
    font-family: inherit;
    cursor: pointer;
}

.cm2-more[hidden] {
    display: none;
}

/* ---------- Панель действий (⋯) и жалобы ---------- */

.cm2-sheet {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.cm2-sheet[hidden] {
    display: none;
}

.cm2-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    border: 0;
    padding: 0;
    cursor: default;
}

.cm2-sheet-panel {
    position: relative;
    width: min(360px, calc(100vw - 32px));
    max-height: 80vh;
    overflow-y: auto;
    padding: 8px 0;
    border-radius: 14px;
    background: var(--cm2-popover);
    border: 1px solid var(--cm2-line-strong);
    color: var(--cm2-text);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.cm2-sheet-grab {
    display: none;
}

.cm2-sheet-title {
    padding: 8px 20px 12px;
    border-bottom: 1px solid var(--cm2-line);
    color: var(--cm2-soft);
    font-size: 13.5px;
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cm2-sheet-title b {
    color: var(--cm2-text);
}

.cm2-sheet-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 48px;
    padding: 0 20px;
    border: 0;
    background: transparent;
    color: var(--cm2-text);
    font: 500 15px/1.3 inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.cm2-sheet-item i {
    width: 18px;
    text-align: center;
    color: var(--cm2-soft);
}

.cm2-sheet-item:hover,
.cm2-sheet-item:focus-visible {
    background: var(--cm2-surface-2);
    outline: none;
}

.cm2-sheet-item.is-danger,
.cm2-sheet-item.is-danger i {
    color: var(--cm2-down);
}

.cm2-sheet-cancel {
    display: none;
}

.cm2-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 10060;
    transform: translateX(-50%);
    max-width: calc(100vw - 32px);
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--cm2-popover);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* ---------- Телефон ---------- */

@media (max-width: 640px) {
    .cm2-section {
        gap: 10px;
    }

    .cm2-list {
        margin: 0;
    }

    .cm2 {
        gap: 10px;
        padding: 10px 0 4px 4px;
    }

    .cm2:hover {
        background: transparent;
    }

    .cm2 .cm2-av,
    .cm2 .cm2-av .comment-avatar {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
    }

    .cm2--reply .cm2-av,
    .cm2--reply .cm2-av .comment-avatar {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
    }

    .cm2-hd {
        padding-right: 0;
        font-size: 12.5px;
    }

    .cm2-acts {
        display: none;
    }

    .cm2-dots {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
        margin: -10px -4px 0 0;
        border: 0;
        background: transparent;
        color: var(--cm2-muted);
        padding: 0;
        cursor: pointer;
    }

    .cm2-vote,
    .cm2-textbtn {
        height: 36px;
    }

    .cm2-edit-left {
        display: none;
    }

    .cm2-replies-wrap {
        padding-left: 20px;
    }

    .cm2-toggle {
        margin-left: 8px;
        height: 36px;
    }

    /* Поле ввода закреплено внизу экрана, пока виден блок комментариев */
    .cm2-composer {
        order: 10;
        position: sticky;
        bottom: 0;
        z-index: 20;
        margin: 0;
        padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
        background: transparent;
    }

    .cm2-section .cm2-composer .cm2-box {
        padding: 6px;
        border: 1px solid var(--cm2-line-strong);
        border-radius: 26px;
        background: var(--cm2-dock);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        box-shadow: none;
    }

    .cm2-more {
        order: 9;
    }

    .cm2-me {
        display: none;
    }

    .cm2-section .cm2-box {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        grid-template-areas:
            "reply reply reply"
            "img text send"
            "att att att"
            "extra extra extra";
        align-items: end;
        border: 0;
        background: transparent;
    }

    .cm2-replying { grid-area: reply; padding: 0 0 6px 8px; }
    .cm2-attachments { grid-area: att; padding: 8px 4px 0; }
    .cm2-tools { display: contents; }
    .cm2-tool--image { grid-area: img; width: 44px; height: 44px; flex-basis: 44px; font-size: 20px; }
    .cm2-spacer { display: none; }

    .cm2-section .cm2-input {
        grid-area: text;
        height: 44px;
        min-height: 44px;
        max-height: 140px;
        padding: 11px 12px;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .cm2-send {
        grid-area: send;
        width: 44px;
        height: 44px;
        margin-left: 4px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }

    .cm2-send-label {
        display: none;
    }

    .cm2-send i {
        display: inline;
        font-size: 16px;
    }

    .cm2-tools-extra {
        grid-area: extra;
        display: none;
        flex-wrap: wrap;
        padding: 6px 0 0 44px;
    }

    .cm2-composer:focus-within .cm2-tools-extra,
    .cm2-composer.has-text .cm2-tools-extra {
        display: flex;
    }

    .cm2-tools-extra .cm2-tool {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .cm2-hint {
        display: none;
    }

    .cm2-thread > .cm2-composer,
    .cm2-replies > .cm2-composer {
        margin: 0;
    }

    body.cm2-docked .chat-trigger {
        display: none !important;
    }

    .cm2-sheet {
        align-items: flex-end;
    }

    .cm2-sheet-panel {
        width: 100%;
        max-width: none;
        border-radius: 18px 18px 0 0;
        border-bottom: 0;
        padding: 8px 0 calc(12px + env(safe-area-inset-bottom, 0px));
        animation: cm2-sheet-in .18s ease-out;
    }

    .cm2-sheet-grab {
        display: block;
        width: 40px;
        height: 4px;
        margin: 0 auto 8px;
        border-radius: 2px;
        background: #444;
    }

    .cm2-sheet-item {
        min-height: 52px;
    }

    .cm2-sheet-cancel {
        display: block;
        width: calc(100% - 32px);
        height: 46px;
        margin: 8px 16px 0;
        border: 0;
        border-radius: 12px;
        background: var(--cm2-surface-2);
        color: var(--cm2-text);
        font: 600 15px/1 inherit;
        font-family: inherit;
    }

    .cm2-toast {
        bottom: 90px;
    }
}

@keyframes cm2-sheet-in {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .cm2-sheet-panel,
    .cm2-thumb.is-loading::after {
        animation: none;
    }
}
