.btn-sticker {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: var(--bg-item);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.btn-sticker:hover {
    background: rgba(255, 200, 0, 0.15);
    border-color: rgba(255, 200, 0, 0.4);
    color: var(--accent);
    transform: scale(1.08);
}

.btn-sticker:active {
    transform: scale(0.95);
}

.btn-sticker.active {
    background: rgba(255, 200, 0, 0.2);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px rgba(255, 200, 0, 0.3);
}

.btn-sticker svg {
    width: 18px;
    height: 18px;
}

.sticker-modal {
    position: relative; /* [변경] 에디터 내 인라인 표시를 위해 absolute 해제 */
    bottom: auto;
    left: auto;
    width: 100%;
    min-width: 100%;
    max-height: 240px;
    margin: 8px 0;
    background: var(--bg-panel);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10; /* [변경] 모달 헤더보다 낮게 설정 */
    opacity: 0;
    display: none; /* [변경] hidden 속성과 연동하기 위해 display: none 기본값 */
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px) scale(0.95);
    transition: all 0.2s ease;
}

.sticker-modal.active {
    opacity: 1;
    display: block; /* [변경] 활성화 시 표시 */
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}


.sticker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-height: 212px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sticker-grid::-webkit-scrollbar {
    width: 4px;
}

.sticker-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.sticker-item {
    width: 100%;
    aspect-ratio: 1;
    min-width: 56px;
    min-height: 56px;
    background: var(--bg-item);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.15s ease;
    object-fit: contain;
}

.sticker-item:hover {
    background: var(--bg-item-hover);
    border-color: var(--border);
    transform: scale(1.08);
}

.sticker-item:active {
    transform: scale(0.95);
}

.comment-sticker,
img.comment-sticker {
    display: inline-block;
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    vertical-align: middle;
    margin: 3px;
    object-fit: contain;
}

.comment-text>.comment-sticker:only-child,
.comment-text>img.comment-sticker:only-child {
    width: 96px;
    height: 96px;
    max-width: 96px;
    max-height: 96px;
    display: block;
    margin: 8px 0;
}